8 files added
20 files modified
| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AgentDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyChargeListDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyFlowListDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefund; |
| | | import cc.mrbird.febs.mall.service.IAdminMallMemberService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Map; |
| | | |
| | |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-列表 |
| | | * @param agentLevelDto |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getAgentLevelList") |
| | | public FebsResponse getAgentLevelList(AgentLevelDto agentLevelDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.getAgentLevelList(agentLevelDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-更新 |
| | | */ |
| | | @PostMapping("agentLevelUpdate") |
| | | @ControllerEndpoint(operation = "商家支付方式-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse agentLevelUpdate(@Valid AgentLevelUpdateDto agentLevelUpdateDto) { |
| | | return mallMemberService.agentLevelUpdate(agentLevelUpdateDto); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @RequiresPermissions("categoryUpdate:update") |
| | | public String detail(@PathVariable long id, Model model) { |
| | | AdminMallGoodsCategoryVo data = mallGoodsCategoryService.getMallGoodsCategoryInfoById(id); |
| | | model.addAttribute("member", data); |
| | | model.addAttribute("goodsCategoryVo", data); |
| | | return FebsUtil.view("modules/product/categoryUpdate"); |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.service.IAdminMallMemberService; |
| | | import cc.mrbird.febs.mall.vo.AdminAgentLevelUpdateInfoVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallMemberPaymentVo; |
| | | import cc.mrbird.febs.mall.vo.MallMemberVo; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return FebsUtil.view("modules/mallMember/agentList"); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("agentLevelList") |
| | | @RequiresPermissions("agentLevelList:view") |
| | | public String agentLevelList() { |
| | | return FebsUtil.view("modules/mallMember/agentLevelList"); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-详情 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("agentLevelUpdate/{id}") |
| | | @RequiresPermissions("agentLevelUpdate:update") |
| | | public String agentLevelUpdate(@PathVariable long id, Model model) { |
| | | AdminAgentLevelUpdateInfoVo data = mallMemberService.getAgentLevelUpdateInfoById(id); |
| | | model.addAttribute("agentLevelUpdateInfo", data); |
| | | return FebsUtil.view("modules/mallMember/agentLevelUpdate"); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | return FebsUtil.view("modules/order/refundOrderDetail"); |
| | | } |
| | | |
| | | /** |
| | | * 退款记录-收款方式 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("refundPayInfo/{id}") |
| | | @RequiresPermissions("refundPayInfo:update") |
| | | public String refundPayInfo(@PathVariable long id, Model model) { |
| | | AdminMallMemberPaymentVo data = adminMallOrderService.getMallMemberRefundPayInfoByFlowId(id); |
| | | model.addAttribute("refundPayInfo", data); |
| | | return FebsUtil.view("modules/order/refundPayInfo"); |
| | | } |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AgentDto", description = "地址接收参数类") |
| | | @ApiModel(value = "AgentDto", description = "接收参数类") |
| | | public class AgentDto { |
| | | |
| | | private String name; |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AgentLevelDto", description = "接收参数类") |
| | | public class AgentLevelDto { |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AgentLevelUpdateDto", description = "接收参数类") |
| | | public class AgentLevelUpdateDto { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 下单数量要求 1-直推 2-团队 |
| | | */ |
| | | private Integer orderType; |
| | | public static final Integer ORDER_TYPE_DIRECT = 1; |
| | | public static final Integer ORDER_TYPE_TEAM = 2; |
| | | |
| | | /** |
| | | * 下单数量 |
| | | */ |
| | | private Integer orderCnt; |
| | | |
| | | /** |
| | | * 需要上一级的数量 |
| | | */ |
| | | private Integer lastCnt; |
| | | |
| | | /** |
| | | * 直推收益 |
| | | */ |
| | | private BigDecimal directIncome; |
| | | |
| | | /** |
| | | * 团队收益 |
| | | */ |
| | | private BigDecimal teamIncome; |
| | | |
| | | /** |
| | | * 团队收益 1-指定金额 2-比例 |
| | | */ |
| | | private Integer teamIncomeType; |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.AgentDto; |
| | | import cc.mrbird.febs.mall.dto.AgentLevelDto; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.vo.AdminAgentLevelVo; |
| | | import cc.mrbird.febs.mall.vo.AdminAgentVo; |
| | | import cc.mrbird.febs.mall.vo.MallMemberVo; |
| | | import cc.mrbird.febs.mall.vo.TeamListVo; |
| | |
| | | List<MallMember> selectAllChildAgentListByInviteId(@Param("inviteId")String inviteId); |
| | | |
| | | List<MallMember> selectMemberParentAgentList(@Param("list") List<String> inviteIds); |
| | | IPage<AdminAgentLevelVo> getAgentLevelListInPage(Page<AdminAgentLevelVo> page, @Param("record")AgentLevelDto agentLevelDto); |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AgentDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyChargeListDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyFlowListDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | AdminMallMemberPaymentVo getMallMemberPaymentInfoByFlowId(long id); |
| | | |
| | | IPage<AdminAgentVo> getAgentList(AgentDto agentDto, QueryRequest request); |
| | | |
| | | IPage<AdminAgentLevelVo> getAgentLevelList(AgentLevelDto agentLevelDto, QueryRequest request); |
| | | |
| | | AdminAgentLevelUpdateInfoVo getAgentLevelUpdateInfoById(long id); |
| | | |
| | | FebsResponse agentLevelUpdate(AgentLevelUpdateDto agentLevelUpdateDto); |
| | | } |
| | |
| | | FebsResponse payMethodEdit(PayMethodEditDto payMethodEditDto); |
| | | |
| | | FebsResponse cancelOrder(Long id); |
| | | |
| | | AdminMallMemberPaymentVo getMallMemberRefundPayInfoByFlowId(long id); |
| | | } |
| | |
| | | |
| | | MallGoodsCategory goodsCategory = new MallGoodsCategory(); |
| | | goodsCategory.setName(name); |
| | | goodsCategory.setImage(mallGoodsCategory.getImage()); |
| | | if(ObjectUtil.isNotEmpty(mallGoodsCategory.getParentId())){ |
| | | Long parentId = mallGoodsCategory.getParentId(); |
| | | MallGoodsCategory mallGoodsCategoryParent = mallGoodsCategoryMapper.selectById(parentId); |
| | |
| | | Long id = mallGoodsCategoryParam.getId(); |
| | | MallGoodsCategory mallGoodsCategory = mallGoodsCategoryMapper.selectById(id); |
| | | mallGoodsCategory.setName(mallGoodsCategoryParam.getName()); |
| | | mallGoodsCategory.setImage(mallGoodsCategoryParam.getImage()); |
| | | if(ObjectUtil.isNotEmpty(mallGoodsCategoryParam.getParentId())){ |
| | | Long parentId = mallGoodsCategoryParam.getParentId(); |
| | | MallGoodsCategory mallGoodsCategoryParent = mallGoodsCategoryMapper.selectById(parentId); |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AgentDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyChargeListDto; |
| | | import cc.mrbird.febs.mall.dto.MoneyFlowListDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMoneyFlow; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberPaymentMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMoneyFlowMapper; |
| | |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private final MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | |
| | | private final MallMemberPaymentMapper mallMemberPaymentMapper; |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | private final IApiMallMemberWalletService iApiMallMemberWalletService; |
| | | |
| | |
| | | return adminAgentVos; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AdminAgentLevelVo> getAgentLevelList(AgentLevelDto agentLevelDto, QueryRequest request) { |
| | | Page<AdminAgentLevelVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AdminAgentLevelVo> adminAgentVos = this.baseMapper.getAgentLevelListInPage(page, agentLevelDto); |
| | | return adminAgentVos; |
| | | } |
| | | |
| | | @Override |
| | | public AdminAgentLevelUpdateInfoVo getAgentLevelUpdateInfoById(long id) { |
| | | AdminAgentLevelUpdateInfoVo adminAgentLevelUpdateInfoVo = new AdminAgentLevelUpdateInfoVo(); |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectById(id); |
| | | String value = dataDictionaryCustom.getValue(); |
| | | //{"directIncome":36,"lastCnt":3,"orderCnt":500,"orderType":2,"teamIncome":6,"teamIncomeType":2} |
| | | JSONObject jsonObject = JSONObject.parseObject(value); |
| | | adminAgentLevelUpdateInfoVo.setDirectIncome(new BigDecimal((jsonObject.get("directIncome")==null?0:jsonObject.get("directIncome")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setLastCnt(Integer.parseInt((jsonObject.get("lastCnt")==null?0:jsonObject.get("lastCnt")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setOrderCnt(Integer.parseInt((jsonObject.get("orderCnt")==null?0:jsonObject.get("orderCnt")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setOrderType(Integer.parseInt(jsonObject.get("orderType").toString())); |
| | | adminAgentLevelUpdateInfoVo.setTeamIncome(new BigDecimal((jsonObject.get("teamIncome")==null?0:jsonObject.get("teamIncome")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setTeamIncomeType(Integer.parseInt(jsonObject.get("orderType").toString())); |
| | | adminAgentLevelUpdateInfoVo.setId(id); |
| | | return adminAgentLevelUpdateInfoVo; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agentLevelUpdate(AgentLevelUpdateDto agentLevelUpdateDto) { |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectById(agentLevelUpdateDto.getId()); |
| | | AgentLevelUpdateDto agentLevelUpdateDtoJson = new AgentLevelUpdateDto(); |
| | | agentLevelUpdateDtoJson.setDirectIncome(agentLevelUpdateDto.getDirectIncome()); |
| | | agentLevelUpdateDtoJson.setLastCnt(agentLevelUpdateDto.getLastCnt()); |
| | | agentLevelUpdateDtoJson.setOrderCnt(agentLevelUpdateDto.getOrderCnt()); |
| | | agentLevelUpdateDtoJson.setTeamIncome(agentLevelUpdateDto.getTeamIncome()); |
| | | agentLevelUpdateDtoJson.setOrderType(agentLevelUpdateDto.getOrderType()); |
| | | agentLevelUpdateDtoJson.setTeamIncomeType(agentLevelUpdateDto.getTeamIncomeType()); |
| | | JSONObject jsonObject = (JSONObject)JSONObject.toJSON(agentLevelUpdateDtoJson); |
| | | dataDictionaryCustom.setValue(jsonObject.toString()); |
| | | dataDictionaryCustomMapper.updateById(dataDictionaryCustom); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private final IApiMallMemberWalletService iApiMallMemberWalletService; |
| | | |
| | | private final MallMemberPaymentMapper mallMemberPaymentMapper; |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Override |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public AdminMallMemberPaymentVo getMallMemberRefundPayInfoByFlowId(long id) { |
| | | AdminMallMemberPaymentVo adminMallMemberPaymentVo = new AdminMallMemberPaymentVo(); |
| | | MallOrderRefund mallOrderRefund = mallOrderRefundMapper.selectById(id); |
| | | AdminMallMemberPaymentVo adminMallMemberPaymentVoa = mallMemberPaymentMapper.getMallMemberPaymentInfoByMemberId(mallOrderRefund.getMemberId()); |
| | | if(ObjectUtil.isNotEmpty(adminMallMemberPaymentVoa)){ |
| | | adminMallMemberPaymentVo = adminMallMemberPaymentVoa; |
| | | } |
| | | return adminMallMemberPaymentVo; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminAgentLevelUpdateInfoVo", description = "信息返回类") |
| | | public class AdminAgentLevelUpdateInfoVo { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 下单数量要求 1-直推 2-团队 |
| | | */ |
| | | private Integer orderType; |
| | | public static final Integer ORDER_TYPE_DIRECT = 1; |
| | | public static final Integer ORDER_TYPE_TEAM = 2; |
| | | |
| | | /** |
| | | * 下单数量 |
| | | */ |
| | | private Integer orderCnt; |
| | | |
| | | /** |
| | | * 需要上一级的数量 |
| | | */ |
| | | private Integer lastCnt; |
| | | |
| | | /** |
| | | * 直推收益 |
| | | */ |
| | | private BigDecimal directIncome; |
| | | |
| | | /** |
| | | * 团队收益 |
| | | */ |
| | | private BigDecimal teamIncome; |
| | | |
| | | /** |
| | | * 团队收益 1-指定金额 2-比例 |
| | | */ |
| | | private Integer teamIncomeType; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminAgentLevelVo", description = "信息返回类") |
| | | public class AdminAgentLevelVo { |
| | | private Long id; |
| | | |
| | | private String name; |
| | | } |
| | |
| | | |
| | | private Long parentId; |
| | | |
| | | private String image; |
| | | |
| | | private Integer isRecommend; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMallMemberPaymentVo", description = "商城商品列表") |
| | | @ApiModel(value = "AdminMallMemberPaymentVo", description = "") |
| | | public class AdminMallMemberPaymentVo { |
| | | |
| | | private Long id; |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMallMemberRefundPayInfoVo", description = "") |
| | | public class AdminMallMemberRefundPayInfoVo { |
| | | |
| | | private Long id; |
| | | |
| | | private Long memberId; |
| | | |
| | | private String wxQrcode; |
| | | |
| | | private String wxName; |
| | | |
| | | private String wxAccount; |
| | | |
| | | private String aliQrcode; |
| | | |
| | | private String aliName; |
| | | |
| | | private String aliAccount; |
| | | |
| | | /** |
| | | * 持卡人姓名 |
| | | */ |
| | | private String bankName; |
| | | |
| | | /** |
| | | * 银行卡号 |
| | | */ |
| | | private String bankNo; |
| | | |
| | | /** |
| | | * 开户行 |
| | | */ |
| | | private String bank; |
| | | } |
| | |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallGoodsCategoryMapper"> |
| | | |
| | | <select id="selectCategoryListInPage" resultType="cc.mrbird.febs.mall.entity.MallGoodsCategory"> |
| | | SELECT m.id,m.name,b.name parentName,m.is_recommend isComand |
| | | SELECT m.id,m.name,b.name parentName,m.is_recommend isComand,m.image |
| | | FROM mall_goods_category m |
| | | left join mall_goods_category b on m.parent_id = b.id |
| | | <where> |
| | |
| | | </foreach > |
| | | order by id desc |
| | | </select> |
| | | |
| | | <select id="getAgentLevelListInPage" resultType="cc.mrbird.febs.mall.vo.AdminAgentLevelVo"> |
| | | SELECT |
| | | a.id,b.description name |
| | | FROM |
| | | data_dictionary_custom a |
| | | left JOIN data_dictionary_custom b on a.code = b.code |
| | | where a.type = 'AGENT_LEVEL_REQUIRE' |
| | | GROUP BY a.id |
| | | ORDER BY |
| | | a.CREATED_TIME DESC |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-user-agent-level" 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> |
| | | </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="userAgentLevelTable" lay-data="{id: 'userAgentLevelTable'}"></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-agent-level'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userAgentLevelTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'agentLevelUpdate') { |
| | | febs.modal.open('编辑', 'modules/mallMember/agentLevelUpdate/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#agent-level-edit').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(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userAgentLevelTable', |
| | | url: ctx + 'admin/mallMember/getAgentLevelList', |
| | | cols: [[ |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentLevelUpdate" shiro:hasPermission="user:update">编辑</button>' |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return {}; |
| | | } |
| | | |
| | | }) |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #agent-level-edit { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #agent-level-edit .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #agent-level-edit #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #agent-level-edit .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #agent-level-edit img{ |
| | | max-width:200px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="agent-level-edit"> |
| | | <form class="layui-form" action="" lay-filter="agent-level-edit-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="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="radio" name="orderType" value="1" title="直推" > |
| | | <input type="radio" name="orderType" value="2" title="团队"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">下单数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="orderCnt" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">需要上一级的数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="lastCnt" class="layui-input"> |
| | | </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="teamIncomeType" value="1" title="指定金额" > |
| | | <input type="radio" name="teamIncomeType" value="2" title="比例"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">团队收益:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="teamIncome" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">直推收益:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="directIncome" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="agent-level-edit-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, |
| | | agentLevelUpdateInfo = [[${agentLevelUpdateInfo}]], |
| | | $view = $('#agent-level-edit'), |
| | | validate = layui.validate, |
| | | _deptTree; |
| | | form.render(); |
| | | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | $('#imageUrls').attr('src', agentLevelUpdateInfo.value); |
| | | form.val("agent-level-edit-form", { |
| | | "id": agentLevelUpdateInfo.id, |
| | | "orderType": agentLevelUpdateInfo.orderType, |
| | | "orderCnt": agentLevelUpdateInfo.orderCnt, |
| | | "directIncome": agentLevelUpdateInfo.directIncome, |
| | | "teamIncome": agentLevelUpdateInfo.teamIncome, |
| | | "teamIncomeType": agentLevelUpdateInfo.teamIncomeType, |
| | | "lastCnt": agentLevelUpdateInfo.lastCnt |
| | | }); |
| | | } |
| | | |
| | | form.on('submit(agent-level-edit-submit)', function (data) { |
| | | febs.post(ctx + 'admin/mallMember/agentLevelUpdate', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-user-agent-level').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
| | |
| | | refundConfirm(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'paymentInfo') { |
| | | febs.modal.open( '收款信息', 'modules/order/refundPayInfo/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function agreeRefund(id) { |
| | |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundOrderDetail" shiro:hasPermission="user:update">订单详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">收款方式</button>' |
| | | }else if(d.type === 2){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agreeWithAddress" shiro:hasPermission="user:update">同意</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundOrderDetail" shiro:hasPermission="user:update">订单详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">收款方式</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundOrderDetail" shiro:hasPermission="user:update">订单详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">收款方式</button>' |
| | | } |
| | | }else if(d.status === 4){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundConfirm" shiro:hasPermission="user:update">退款确认</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundOrderDetail" shiro:hasPermission="user:update">订单详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">收款方式</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundOrderDetail" shiro:hasPermission="user:update">订单详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">收款方式</button>' |
| | | } |
| | | |
| | | },minWidth: 300,align:'center'} |
New file |
| | |
| | | <style> |
| | | #user-refundPayInfo-info { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #user-refundPayInfo-info .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #user-refundPayInfo-info #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #user-refundPayInfo-info .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="user-refundPayInfo-info"> |
| | | <form class="layui-form" action="" lay-filter="user-refundPayInfo-info-form"> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">微信姓名:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="wxName" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">微信账号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="wxAccount" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">微信收款码:</label> |
| | | <div class="layui-input-block"> |
| | | <img alt="微信收款码" data-th-src="${refundPayInfo.wxQrcode}" style="width: 200px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">支付宝姓名:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="aliName" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">支付宝账号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="aliAccount" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">支付宝收款码:</label> |
| | | <div class="layui-input-block"> |
| | | <img alt="支付宝收款码" data-th-src="${refundPayInfo.aliQrcode}" style="width: 200px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">持卡人姓名:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="bankName" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">开户行:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="bank" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">银行卡号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="bankNo" class="layui-input" readonly> |
| | | </div> |
| | | </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, |
| | | refundPayInfo = [[${refundPayInfo}]], |
| | | $view = $('#user-refundPayInfo-info'), |
| | | validate = layui.validate, |
| | | _deptTree; |
| | | |
| | | form.render(); |
| | | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | form.val("user-refundPayInfo-info-form", { |
| | | "wxName": refundPayInfo.wxName, |
| | | "wxAccount": refundPayInfo.wxAccount, |
| | | "wxQrcode": refundPayInfo.wxQrcode, |
| | | "aliName": refundPayInfo.aliName, |
| | | "aliAccount": refundPayInfo.aliAccount, |
| | | "aliQrcode": refundPayInfo.aliQrcode, |
| | | "bankName": refundPayInfo.bankName, |
| | | "bankNo": refundPayInfo.bankNo, |
| | | "bank": refundPayInfo.bank |
| | | }); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <style> |
| | | #user-add { |
| | | #categary-add { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #user-add .layui-treeSelect .ztree li a, .ztree li span { |
| | | #categary-add .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #user-add #data-permission-tree-block { |
| | | #categary-add #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #user-add .layui-treeSelect .ztree li span.button.switch { |
| | | #categary-add .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #categary-add img{ |
| | | max-width:100px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="user-add"> |
| | | <form class="layui-form" action="" lay-filter="user-add-form"> |
| | | <div class="layui-fluid" id="categary-add"> |
| | | <form class="layui-form" action="" lay-filter="categary-add-form"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" |
| | | lay-verify="name" autocomplete="off" class="layui-input" > |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">图片:</label> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn" id="test1">上传图片</button> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload-list"> |
| | | <img class="layui-upload-img" id="imageUrls" width="100%" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label ">图片链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="imageUrl" lay-verify="required" name="image" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label ">父类:</label>--> |
| | |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate'], function () { |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate','upload'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | member = [[${member}]], |
| | | $view = $('#user-add'), |
| | | $view = $('#categary-add'), |
| | | upload = layui.upload, |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | |
| | | |
| | | formSelects.render(); |
| | | |
| | | //普通图片上传 |
| | | var uploadInst = upload.render({ |
| | | elem: '#test1' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#imageUrls').attr('src', result); //图片链接(base64) |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $("#imageUrl").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/goodsCategory/categorys/tree', function (data) { |
| | | for (var k in data) |
| | |
| | | </div> |
| | | </form> |
| | | <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table> |
| | | <style type="text/css"> |
| | | .layui-table-cell{ |
| | | text-align:center; |
| | | height: auto; |
| | | white-space: normal; |
| | | } |
| | | .layui-table img{ |
| | | max-width:100px |
| | | } |
| | | </style> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'close') { |
| | | febs.modal.confirm('禁用', '确认禁用该账号?', function () { |
| | | closeAccount(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'open') { |
| | | febs.modal.confirm('开启', '确认开启该账号?', function () { |
| | | openAccount(data.id); |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'see') { |
| | | febs.modal.open('编辑', 'modules/product/categoryUpdate/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-add').find('#submit').trigger('click'); |
| | | $('#categary-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'seeImges') { |
| | | var t = $view.find('#seeImges'+data.id+''); |
| | | //页面层 |
| | | layer.open({ |
| | | type: 1, |
| | | title: "图片", |
| | | skin: 'layui-layer-rim', //加上边框 |
| | | area: ['80%', '80%'], //宽高 |
| | | shadeClose: true, //开启遮罩关闭 |
| | | end: function (index, layero) { |
| | | return false; |
| | | }, |
| | | content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' |
| | | }); |
| | | } |
| | | }); |
| | | function closeAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/closeAccount/' + id, null, function () { |
| | | febs.alert.success('禁用成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function openAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/openAccount/' + id, null, function () { |
| | | febs.alert.success('开启成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 查询按钮 |
| | |
| | | febs.modal.open('新增', 'modules/product/categoryAdd/', { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-add').find('#submit').trigger('click'); |
| | | $('#categary-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | |
| | | cols: [[ |
| | | {field: 'name', title: '名称', minWidth: 150,align:'left'}, |
| | | {field: 'parentName', title: '父级名称', minWidth: 150,align:'left'}, |
| | | {field: 'image', title: '图片', |
| | | templet: function (d) { |
| | | return '<a lay-event="seeImges"><img id="seeImges'+d.id+'" src="'+d.image+'" alt=""></a>'; |
| | | }, minWidth: 100,align:'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">编辑</button>' |
| | |
| | | <style> |
| | | #user-add { |
| | | #categary-update { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #user-add .layui-treeSelect .ztree li a, .ztree li span { |
| | | #categary-update .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #user-add #data-permission-tree-block { |
| | | #categary-update #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #user-add .layui-treeSelect .ztree li span.button.switch { |
| | | #categary-update .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #categary-update img{ |
| | | max-width:100px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="user-add"> |
| | | <div class="layui-fluid" id="categary-update"> |
| | | <form class="layui-form" action="" lay-filter="categary-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}"> |
| | | <input type="text" name="id" data-th-value="${goodsCategoryVo.id}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | <select name="parentId" class="categary-update-category" id="categarySelect"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">图片:</label> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn" id="test1">上传图片</button> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload-list"> |
| | | <img class="layui-upload-img" id="imageUrls" width="100%" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">图片链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="imageUrl" name="image" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate'], function () { |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate','upload'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | member = [[${member}]], |
| | | $view = $('#user-add'), |
| | | goodsCategoryVo = [[${goodsCategoryVo}]], |
| | | $view = $('#categary-update'), |
| | | upload = layui.upload, |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | |
| | | |
| | | formSelects.render(); |
| | | |
| | | //普通图片上传 |
| | | var uploadInst = upload.render({ |
| | | elem: '#test1' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#imageUrls').attr('src', result); //图片链接(base64) |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $("#imageUrl").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/goodsCategory/categorys/tree', function (data) { |
| | | for (var k in data) |
| | |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | $("#categarySelect").val(member.parentId) |
| | | $("#categarySelect").val(goodsCategoryVo.parentId) |
| | | form.render(); |
| | | }); |
| | | }); |
| | |
| | | // return result; |
| | | // }, |
| | | // success: function () { |
| | | // formSelects.value('user-update-category', member.parentId); |
| | | // formSelects.value('user-update-category', goodsCategoryVo.parentId); |
| | | // }, |
| | | // error: function (id, url, searchVal, err) { |
| | | // console.error(err); |
| | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | $('#imageUrls').attr('src', goodsCategoryVo.image); |
| | | form.val("categary-update-form", { |
| | | "id": member.id, |
| | | "name": member.name, |
| | | "parentId": member.parentId, |
| | | "isRecommend": member.isRecommend |
| | | "id": goodsCategoryVo.id, |
| | | "name": goodsCategoryVo.name, |
| | | "parentId": goodsCategoryVo.parentId, |
| | | "image": goodsCategoryVo.image, |
| | | "isRecommend": goodsCategoryVo.isRecommend |
| | | }); |
| | | } |
| | | |
| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.mall.dto.AgentLevelUpdateDto; |
| | | import cc.mrbird.febs.mall.entity.AgentInfo; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | getJson(); |
| | | } |
| | | |
| | | public static void getJson(){ |
| | | AgentLevelUpdateDto adminAgentLevelUpdateInfoVo = new AgentLevelUpdateDto(); |
| | | String jsonStr = "{\"directIncome\":50,\"lastCnt\":3,\"orderCnt\":2000,\"orderType\":2,\"teamIncome\":15,\"teamIncomeType\":2}"; |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | adminAgentLevelUpdateInfoVo.setDirectIncome(new BigDecimal((jsonObject.get("directIncome")==null?0:jsonObject.get("directIncome")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setLastCnt(Integer.parseInt((jsonObject.get("lastCnt")==null?0:jsonObject.get("lastCnt")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setOrderCnt(Integer.parseInt((jsonObject.get("orderCnt")==null?0:jsonObject.get("orderCnt")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setOrderType(Integer.parseInt(jsonObject.get("orderType").toString())); |
| | | adminAgentLevelUpdateInfoVo.setTeamIncome(new BigDecimal((jsonObject.get("teamIncome")==null?0:jsonObject.get("teamIncome")).toString())); |
| | | adminAgentLevelUpdateInfoVo.setTeamIncomeType(Integer.parseInt(jsonObject.get("orderType").toString())); |
| | | adminAgentLevelUpdateInfoVo.setId(14L); |
| | | AgentLevelUpdateDto agentLevelUpdateDtoJson = new AgentLevelUpdateDto(); |
| | | agentLevelUpdateDtoJson.setDirectIncome(adminAgentLevelUpdateInfoVo.getDirectIncome()); |
| | | agentLevelUpdateDtoJson.setLastCnt(adminAgentLevelUpdateInfoVo.getLastCnt()); |
| | | agentLevelUpdateDtoJson.setOrderCnt(adminAgentLevelUpdateInfoVo.getOrderCnt()); |
| | | agentLevelUpdateDtoJson.setTeamIncome(adminAgentLevelUpdateInfoVo.getTeamIncome()); |
| | | agentLevelUpdateDtoJson.setOrderType(adminAgentLevelUpdateInfoVo.getOrderType()); |
| | | agentLevelUpdateDtoJson.setTeamIncomeType(adminAgentLevelUpdateInfoVo.getTeamIncomeType()); |
| | | JSONObject jsonObjectA = (JSONObject)JSONObject.toJSON(agentLevelUpdateDtoJson); |
| | | System.out.println(jsonObjectA.toJSONString()); |
| | | } |
| | | |
| | | @Test |
| | | public void autoLevelUp() { |
| | | // agentService.autoUpAgentLevel(3L); |