Merge branch 'blnka' of http://120.27.238.55:7000/r/xc-mall into blnka
| | |
| | | /** |
| | | * 会员日 |
| | | */ |
| | | VIP_SCORE_RULE("VIP_SCORE_RULE", "VIP_SCORE_RULE"), |
| | | |
| | | /** |
| | | * 会员日 |
| | | */ |
| | | UNALIVE_COUPON("UNALIVE_COUPON", "UNALIVE_COUPON"); |
| | | |
| | | private String type; |
| | |
| | | commonService.addDataDic(DataDictionaryEnum.VIP_DATE.getType(), DataDictionaryEnum.VIP_DATE.getCode(), vipSettingVo.getVipDate(), null, false); |
| | | |
| | | commonService.addDataDic(DataDictionaryEnum.UNALIVE_COUPON.getType(), DataDictionaryEnum.UNALIVE_COUPON.getCode(), vipSettingVo.getItems(), "失活会员优惠券配置", true); |
| | | |
| | | commonService.addDataDic(DataDictionaryEnum.VIP_SCORE_RULE.getType(), DataDictionaryEnum.VIP_SCORE_RULE.getCode(), vipSettingVo.getRule(), "会员规则", false); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | List<VipSettingUnAliveSettingBo> items = JSONObject.parseArray(couponData.getValue(), VipSettingUnAliveSettingBo.class); |
| | | setting.setItems(items); |
| | | } |
| | | |
| | | DataDictionaryCustom rule = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.VIP_SCORE_RULE.getType(), DataDictionaryEnum.VIP_SCORE_RULE.getCode()); |
| | | setting.setRule(rule.getValue()); |
| | | model.addAttribute("vipSetting", setting); |
| | | return FebsUtil.view("modules/vip/vip-setting"); |
| | | } |
| | |
| | | private String vipDate; |
| | | |
| | | private List<VipSettingUnAliveSettingBo> items; |
| | | |
| | | private String rule; |
| | | } |
| | |
| | | <table id="unAliveCouponItem" lay-filter="unAliveCouponItem"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <blockquote class="layui-elem-quote blue-border">会员规则</blockquote> |
| | | <div class="layui-form-item"> |
| | | <div style="border: 1px solid #ccc;"> |
| | | <div id="toolbar-container" class="toolbar"></div> |
| | | <div id="editor-container" class="text" style="height: 450px;"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-card-footer"> |
| | | <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="vip-setting-form-submit" id="submit">保存</button> |
| | | </div> |
| | |
| | | |
| | | form.on('submit(vip-setting-form-submit)', function (data) { |
| | | data.field.items = unAliveCouponItemsData; |
| | | data.field.rule = editor.txt.html(); |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/vip/config/vipSetting', |
| | | 'type':'post', |
| | |
| | | } |
| | | } |
| | | }); |
| | | const E = window.wangEditor; |
| | | const editor = new E('#toolbar-container', '#editor-container'); // 传入两个元素 |
| | | editor.config.showLinkImg = false; |
| | | editor.config.uploadFileName = 'file'; |
| | | editor.config.customUploadImg = function (files, insertImgFn) { |
| | | for (let i = 0; i < files.length; i++){ |
| | | var form = new FormData(); |
| | | form.append("file", files[0]); |
| | | $.ajax({ |
| | | url:'/admin/goods/uploadFileBase64', |
| | | type: "post", |
| | | processData: false, |
| | | contentType: false, |
| | | data: form, |
| | | dataType: 'json', |
| | | success(res) { |
| | | // 上传代码返回结果之后,将图片插入到编辑器中 |
| | | insertImgFn(res.data.src, res.data.title, '') |
| | | } |
| | | }) |
| | | } |
| | | }; |
| | | editor.create(); |
| | | |
| | | |
| | | function addTableDate(data) { |
| | | var hasData = table.cache['unAliveCouponItem']; |
| | |
| | | unAliveCouponItemsData = details; |
| | | reloadTable(details); |
| | | } |
| | | |
| | | |
| | | editor.txt.html(vipSetting.rule); |
| | | } |
| | | }); |
| | | </script> |