New file |
| | |
| | | package com.xcong.excoin.modules.documentary.controller;
|
| | |
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.validation.Valid;
|
| | |
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.xcong.excoin.common.annotation.ControllerEndpoint;
|
| | | import com.xcong.excoin.common.controller.BaseController;
|
| | | import com.xcong.excoin.common.entity.FebsResponse;
|
| | | import com.xcong.excoin.common.entity.QueryRequest;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.service.DocumentaryService;
|
| | | import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto;
|
| | |
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | @Slf4j
|
| | | @Validated
|
| | | @RestController
|
| | | @RequiredArgsConstructor
|
| | | @RequestMapping(value = "/documentary")
|
| | | public class DocumentaryController extends BaseController {
|
| | | |
| | | private final DocumentaryService documentaryService;
|
| | | |
| | | /**
|
| | | * 交易员申请---列表
|
| | | * @return
|
| | | */
|
| | | @GetMapping("traderList")
|
| | | public FebsResponse traderList(FollowTraderInfoEntity followTraderInfoEntity, QueryRequest request) {
|
| | | Map<String, Object> data = getDataTable(documentaryService.findTraderListInPage(followTraderInfoEntity, request));
|
| | | return new FebsResponse().success().data(data);
|
| | | }
|
| | | |
| | | /**
|
| | | * 交易员申请---确认
|
| | | * @return
|
| | | */
|
| | | @PostMapping("traderConfirm")
|
| | | @ControllerEndpoint(operation = "实名认证---确认", exceptionMessage = "认证失败")
|
| | | public FebsResponse traderConfirm(@Valid FollowTraderInfoEntity followTraderInfoEntity) {
|
| | | return documentaryService.traderConfirm(followTraderInfoEntity);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.documentary.controller;
|
| | |
|
| | | import org.apache.shiro.authz.annotation.RequiresPermissions;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.ui.Model;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import com.xcong.excoin.common.controller.BaseController;
|
| | | import com.xcong.excoin.common.entity.FebsConstant;
|
| | | import com.xcong.excoin.common.utils.FebsUtil;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.service.DocumentaryService;
|
| | | import com.xcong.excoin.modules.member.entity.MemberEntity;
|
| | |
|
| | | import lombok.RequiredArgsConstructor;
|
| | | @Controller("documentaryView")
|
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/documentary")
|
| | | @RequiredArgsConstructor
|
| | | public class ViewController extends BaseController{
|
| | | |
| | | private final DocumentaryService documentaryService;
|
| | | |
| | | /**
|
| | | * 交易员申请
|
| | | * @return
|
| | | */
|
| | | @GetMapping("traderUpdate")
|
| | | @RequiresPermissions("traderUpdate:view")
|
| | | public String traderUpdate() {
|
| | | return FebsUtil.view("modules/documentary/traderUpdate");
|
| | | }
|
| | | |
| | | /**
|
| | | * 交易员申请--审核
|
| | | * @return
|
| | | */
|
| | | @GetMapping("traderDetail/{id}")
|
| | | @RequiresPermissions("traderDetail:update")
|
| | | public String traderDetail(@PathVariable long id, Model model) {
|
| | | FollowTraderInfoEntity data = documentaryService.selectTraderDetailByid(id);
|
| | | model.addAttribute("member", data);
|
| | | return FebsUtil.view("modules/documentary/traderDetail");
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.documentary.entity;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import com.xcong.excoin.common.entity.BaseEntity;
|
| | |
|
| | | import lombok.Data;
|
| | |
|
| | | /**
|
| | | * 交易员信息表
|
| | | */
|
| | | @Data
|
| | | @TableName("follow_trader_info")
|
| | | public class FollowTraderInfoEntity extends BaseEntity{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | /**
|
| | | * 会员ID
|
| | | */
|
| | | private Long memberId;
|
| | | /**
|
| | | * 头像
|
| | | */
|
| | | private String avatar;
|
| | | /**
|
| | | * 名称
|
| | | */
|
| | | private String nickname;
|
| | | /**
|
| | | * 宣言
|
| | | */
|
| | | private String declaration;
|
| | | /**
|
| | | * 是否满员 1-是2-否
|
| | | */
|
| | | private Integer isAll;
|
| | | public static final Integer IS_ALL_Y = 1;
|
| | | public static final Integer IS_ALL_N = 2;
|
| | | /**
|
| | | * 利润
|
| | | */
|
| | | private BigDecimal profitRatio;
|
| | | /**
|
| | | * 审核状态 1通过2不通过3待审核
|
| | | */
|
| | | private Integer verifyStatus;
|
| | | public static final Integer VERIFYSTATUS_Y = 1;
|
| | | public static final Integer VERIFYSTATUS_N = 2;
|
| | | public static final Integer VERIFYSTATUS_ING = 3;
|
| | | /**
|
| | | * 是否开启带单 1是2否
|
| | | */
|
| | | private Integer isOpen;
|
| | | public static final Integer ISOPEN_Y = 1;
|
| | | public static final Integer ISOPEN_N = 2;
|
| | | |
| | | @TableField(exist = false)
|
| | | private String account;
|
| | | |
| | | @TableField(exist = false)
|
| | | private String realName;
|
| | | @TableField(exist = false)
|
| | | private String phone;
|
| | | @TableField(exist = false)
|
| | | private String email;
|
| | | @TableField(exist = false)
|
| | | private String inviteId;
|
| | | @TableField(exist = false)
|
| | | private int accountType;
|
| | | |
| | | @TableField(exist = false)
|
| | | private double walletNum;
|
| | | @TableField(exist = false)
|
| | | private double walletCoinNum;
|
| | | @TableField(exist = false)
|
| | | private double agentNum;
|
| | | |
| | |
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.documentary.mapper;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | |
|
| | |
|
| | | public interface FollowTraderInfoMapper extends BaseMapper<FollowTraderInfoEntity> {
|
| | |
|
| | | IPage<FollowTraderInfoEntity> findTraderListInPage(Page<FollowTraderInfoEntity> page, @Param("record") FollowTraderInfoEntity followTraderInfoEntity);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.documentary.service;
|
| | |
|
| | | import javax.validation.Valid;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.xcong.excoin.common.entity.FebsResponse;
|
| | | import com.xcong.excoin.common.entity.QueryRequest;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | |
|
| | | public interface DocumentaryService extends IService<FollowTraderInfoEntity> {
|
| | |
|
| | | IPage<FollowTraderInfoEntity> findTraderListInPage(FollowTraderInfoEntity followTraderInfoEntity, QueryRequest request);
|
| | |
|
| | | FollowTraderInfoEntity selectTraderDetailByid(long id);
|
| | |
|
| | | FebsResponse traderConfirm(@Valid FollowTraderInfoEntity followTraderInfoEntity);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.documentary.service.impl;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.validation.Valid;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.xcong.excoin.common.entity.FebsResponse;
|
| | | import com.xcong.excoin.common.entity.QueryRequest;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowTraderInfoMapper;
|
| | | import com.xcong.excoin.modules.documentary.service.DocumentaryService;
|
| | | import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
|
| | | import com.xcong.excoin.modules.member.entity.MemberEntity;
|
| | | import com.xcong.excoin.modules.member.mapper.MemberAuthenticationMapper;
|
| | | import com.xcong.excoin.modules.member.mapper.MemberMapper;
|
| | |
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | @Slf4j
|
| | | @Service
|
| | | @RequiredArgsConstructor
|
| | | public class DocumentaryServiceImpl extends ServiceImpl<FollowTraderInfoMapper, FollowTraderInfoEntity> implements DocumentaryService {
|
| | | |
| | | private final FollowTraderInfoMapper followTraderInfoMapper;
|
| | | |
| | | private final MemberAuthenticationMapper memberAuthenticationMapper;
|
| | | |
| | | private final MemberMapper memberMapper;
|
| | | |
| | | @Override
|
| | | public IPage<FollowTraderInfoEntity> findTraderListInPage(FollowTraderInfoEntity followTraderInfoEntity,
|
| | | QueryRequest request) {
|
| | | Page<FollowTraderInfoEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
|
| | | IPage<FollowTraderInfoEntity> followTraderInfoEntitys = followTraderInfoMapper.findTraderListInPage(page, followTraderInfoEntity);
|
| | | List<FollowTraderInfoEntity> records = followTraderInfoEntitys.getRecords();
|
| | | if(CollUtil.isNotEmpty(records)) {
|
| | | for(FollowTraderInfoEntity followTraderInfo : records) {
|
| | | Long memberId = followTraderInfo.getMemberId();
|
| | | Map<String, Object> columnMap = new HashMap<>();
|
| | | columnMap.put("member_id", memberId);
|
| | | List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap );
|
| | | if(CollUtil.isNotEmpty(selectByMap)) {
|
| | | MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0);
|
| | | String firstName = memberAuthenticationEntity.getFirstName();
|
| | | String secondName = memberAuthenticationEntity.getSecondName();
|
| | | String realName = firstName + secondName;
|
| | | followTraderInfo.setRealName(realName);
|
| | | }
|
| | | }
|
| | | }
|
| | | return followTraderInfoEntitys;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FollowTraderInfoEntity selectTraderDetailByid(long id) {
|
| | | FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoMapper.selectById(id);
|
| | | Long memberId = followTraderInfoEntity.getMemberId();
|
| | | MemberEntity memberEntity = memberMapper.selectById(memberId);
|
| | | String phone = memberEntity.getPhone();
|
| | | followTraderInfoEntity.setPhone(phone);
|
| | | String email = memberEntity.getEmail();
|
| | | followTraderInfoEntity.setEmail(email);
|
| | | String inviteId = memberEntity.getInviteId();
|
| | | followTraderInfoEntity.setInviteId(inviteId);
|
| | | Integer accountType = memberEntity.getAccountType();
|
| | | followTraderInfoEntity.setAccountType(accountType);
|
| | | //币币账户
|
| | | String walletNum = memberMapper.selectBBZCForBasicRealDataBymemberId(memberId);
|
| | | followTraderInfoEntity.setWalletNum(walletNum == null ? 0 : Double.parseDouble(walletNum));
|
| | | //合约账户
|
| | | String walletCoinNum = memberMapper.selectHYZCForBasicRealDataBymemberId(memberId);
|
| | | followTraderInfoEntity.setWalletCoinNum(walletCoinNum == null ? 0 : Double.parseDouble(walletCoinNum));
|
| | | //代理账户
|
| | | String agentNum = memberMapper.selectDLZCForBasicRealDataBymemberId(memberId);
|
| | | followTraderInfoEntity.setAgentNum(agentNum == null ? 0 : Double.parseDouble(agentNum));
|
| | | |
| | | Map<String, Object> columnMap = new HashMap<>();
|
| | | columnMap.put("member_id", memberId);
|
| | | List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap );
|
| | | if(CollUtil.isNotEmpty(selectByMap)) {
|
| | | MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0);
|
| | | String firstName = memberAuthenticationEntity.getFirstName();
|
| | | String secondName = memberAuthenticationEntity.getSecondName();
|
| | | String realName = firstName + secondName;
|
| | | followTraderInfoEntity.setRealName(realName);
|
| | | }
|
| | | |
| | | return followTraderInfoEntity;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FebsResponse traderConfirm(@Valid FollowTraderInfoEntity followTraderInfoEntity) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.xcong.excoin.modules.documentary.mapper.FollowTraderInfoMapper">
|
| | |
|
| | | <select id="findTraderListInPage" resultType="com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity">
|
| | | select * from follow_trader_info s left join member m on m.id = s.member_id
|
| | | <where>
|
| | | <if test="record != null" >
|
| | | <if test="record.account!=null and record.account!=''">
|
| | | and (m.phone = #{record.account} or m.email = #{record.account} or m.invite_id=#{record.account})
|
| | | </if>
|
| | | <if test="record.verifyStatus!=null and record.verifyStatus!=''">
|
| | | and s.verify_status= #{record.verifyStatus}
|
| | | </if>
|
| | | </if>
|
| | | </where>
|
| | | order by s.create_time desc |
| | | </select>
|
| | | |
| | | </mapper> |
New file |
| | |
| | | <style>
|
| | | #user-update {
|
| | | padding: 20px 25px 25px 0;
|
| | | }
|
| | |
|
| | | #user-update .layui-treeSelect .ztree li a, .ztree li span {
|
| | | margin: 0 0 2px 3px !important;
|
| | | }
|
| | | #user-update #data-permission-tree-block {
|
| | | border: 1px solid #eee;
|
| | | border-radius: 2px;
|
| | | padding: 3px 0;
|
| | | }
|
| | | #user-add .layui-treeSelect .ztree li span.button.switch {
|
| | | top: 1px;
|
| | | left: 3px;
|
| | | }
|
| | |
|
| | | </style>
|
| | | <div class="layui-fluid" id="user-update">
|
| | | <form class="layui-form" action="" lay-filter="user-update-form">
|
| | | <div class="layui-form-item febs-hide">
|
| | | <label class="layui-form-label febs-form-item-require">用户id:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="id" data-th-value="${member.id}">
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">真实姓名:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="realName" minlength="4" maxlength="10" data-th-id="${member.realName}"
|
| | | lay-verify="range|realName" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">电话:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name=phone minlength="4" maxlength="10" data-th-id="${member.phone}"
|
| | | lay-verify="range|phone" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">邮箱:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="email" minlength="4" maxlength="10" data-th-id="${member.email}"
|
| | | lay-verify="range|email" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">利润率:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="profitRatio" minlength="4" maxlength="10" data-th-id="${member.profitRatio}"
|
| | | lay-verify="range|profitRatio" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">币币账户总余额:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="walletNum" minlength="4" maxlength="10" data-th-id="${member.walletNum}"
|
| | | lay-verify="range|walletNum" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">合约账户总余额:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="walletCoinNum" minlength="4" maxlength="10" data-th-id="${member.walletCoinNum}"
|
| | | lay-verify="range|walletCoinNum" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">币币账户总余额:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="agentNum" minlength="4" maxlength="10" data-th-id="${member.agentNum}"
|
| | | lay-verify="range|agentNum" autocomplete="off" class="layui-input" readonly>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item">
|
| | | <label class="layui-form-label febs-form-item-require">是否同意:</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="radio" name="isok" value="1" title="同意">
|
| | | <input type="radio" name="isok" value="0" title="拒绝" checked="">
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item febs-hide">
|
| | | <button class="layui-btn" lay-submit="" lay-filter="user-update-form-submit" id="submit"></button>
|
| | | </div>
|
| | | </form>
|
| | | </div>
|
| | |
|
| | | <script data-th-inline="javascript">
|
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree'], function () {
|
| | | var $ = layui.$,
|
| | | febs = layui.febs,
|
| | | layer = layui.layer,
|
| | | formSelects = layui.formSelects,
|
| | | treeSelect = layui.treeSelect,
|
| | | form = layui.form,
|
| | | eleTree = layui.eleTree,
|
| | | member = [[${member}]],
|
| | | $view = $('#user-update'),
|
| | | validate = layui.validate,
|
| | | _deptTree;
|
| | |
|
| | | form.render();
|
| | |
|
| | | initUserValue();
|
| | |
|
| | | formSelects.render();
|
| | |
|
| | | function initUserValue() {
|
| | | form.val("user-update-form", {
|
| | | "id": member.id,
|
| | | "profitRatio": member.profitRatio,
|
| | | "realName": member.realName,
|
| | | "phone": member.phone,
|
| | | "email": member.email,
|
| | | "agentNum": member.agentNum,
|
| | | "walletCoinNum": member.walletCoinNum,
|
| | | "walletNum": member.walletNum
|
| | | });
|
| | | }
|
| | |
|
| | | form.on('submit(user-update-form-submit)', function (data) {
|
| | | febs.post(ctx + 'member/memberDetailConfirm', data.field, function () {
|
| | | layer.closeAll();
|
| | | febs.alert.success('认证成功');
|
| | | $('#febs-user').find('#query').click();
|
| | | });
|
| | | return false;
|
| | | });
|
| | | });
|
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="交易员列表">
|
| | | <div class="layui-row febs-container">
|
| | | <div class="layui-col-md12">
|
| | | <div class="layui-card">
|
| | | <div class="layui-card-body febs-table-full">
|
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form">
|
| | | <div class="layui-row">
|
| | | <div class="layui-col-md10">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-inline">
|
| | | <div class="layui-input-inline">
|
| | | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input">
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-inline">
|
| | | <label class="layui-form-label layui-form-label-sm">审核状态</label>
|
| | | <div class="layui-input-inline">
|
| | | <select name="verifyStatus">
|
| | | <option value="">请选择</option>
|
| | | <option value="1">待审核</option>
|
| | | <option value="2">审核通过</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
|
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
|
| | | <i class="layui-icon"></i>
|
| | | </div>
|
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
|
| | | <i class="layui-icon"></i>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </form>
|
| | | <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格操作栏 start -->
|
| | | <script type="text/html" id="user-option">
|
| | | <span shiro:lacksPermission="user:view,user:update,user:delete">
|
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限
|
| | | </span>
|
| | | <a lay-event="edit" shiro:hasPermission="user:update"><i
|
| | | class="layui-icon febs-edit-area febs-blue"></i></a>
|
| | | </script>
|
| | | <!-- 表格操作栏 end -->
|
| | | <script data-th-inline="none" type="text/javascript">
|
| | | // 引入组件并初始化
|
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () {
|
| | | var $ = layui.jquery,
|
| | | febs = layui.febs,
|
| | | form = layui.form,
|
| | | table = layui.table,
|
| | | $view = $('#febs-user'),
|
| | | $query = $view.find('#query'),
|
| | | $reset = $view.find('#reset'),
|
| | | $searchForm = $view.find('form'),
|
| | | sortObject = {field: 'phone', type: null},
|
| | | tableIns;
|
| | |
|
| | | form.render();
|
| | |
|
| | | // 表格初始化
|
| | | initTable();
|
| | |
|
| | | // 初始化表格操作栏各个按钮功能
|
| | | table.on('tool(userTable)', function (obj) {
|
| | | var data = obj.data,
|
| | | layEvent = obj.event;
|
| | | |
| | | if (layEvent === 'edit') {
|
| | | febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, {
|
| | | btn: ['确认', '取消'],
|
| | | yes: function (index, layero) {
|
| | | $('#user-update').find('#submit').trigger('click');
|
| | | },
|
| | | btn2: function () {
|
| | | layer.closeAll();
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | // 查询按钮
|
| | | $query.on('click', function () {
|
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
|
| | | tableIns.reload({where: params, page: {curr: 1}});
|
| | | });
|
| | |
|
| | | // 刷新按钮
|
| | | $reset.on('click', function () {
|
| | | $searchForm[0].reset();
|
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}});
|
| | | });
|
| | |
|
| | | function initTable() {
|
| | | tableIns = febs.table.init({
|
| | | elem: $view.find('table'),
|
| | | id: 'userTable',
|
| | | url: ctx + 'documentary/traderList',
|
| | | cols: [[
|
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'},
|
| | | {field: 'email', title: '邮箱', minWidth: 200,align:'left'},
|
| | | {field: 'realName', title: '姓名', minWidth: 200,align:'left'},
|
| | | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'},
|
| | | {field: 'profitRatio', title: '利润率', minWidth: 80,align:'center'},
|
| | | {field: 'accountType', title: '账号类型',
|
| | | templet: function (d) {
|
| | | if (d.accountType === 2) {
|
| | | return '<span style="color:green;">测试账号</span>'
|
| | | } else if (d.accountType === 1) {
|
| | | return '<span style="color:red;">正常账号</span>'
|
| | | }else{
|
| | | return ''
|
| | | }
|
| | | }, minWidth: 80,align:'center'},
|
| | | {field: 'verifyStatus', title: '审核状态',
|
| | | templet: function (d) {
|
| | | if (d.verifyStatus === 1) {
|
| | | return '<span style="color:blue;">审核通过</span>'
|
| | | } else if (d.verifyStatus === 2) {
|
| | | return '<span style="color:green;">不通过</span>'
|
| | | } else if (d.verifyStatus === 3) {
|
| | | return '<span>待审核</span>'
|
| | | }else{
|
| | | return ''
|
| | | }
|
| | | }, minWidth: 80,align:'center'},
|
| | | {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'},
|
| | | {title: '操作', |
| | | templet: function (d) {
|
| | | if (d.verifyStatus === 3) {
|
| | | return '<a lay-event="edit" shiro:hasPermission="user:update">审核</a>'
|
| | | }else {
|
| | | return ''
|
| | | }
|
| | | },minWidth: 200,align:'center'}
|
| | | ]]
|
| | | });
|
| | | }
|
| | |
|
| | | // 获取查询参数
|
| | | function getQueryParams() {
|
| | | return {
|
| | | account: $searchForm.find('input[name="account"]').val().trim(),
|
| | | verifyStatus: $searchForm.find("select[name='verifyStatus']").val(),
|
| | | };
|
| | | }
|
| | |
|
| | | })
|
| | | </script> |