From d4565c1920cd6f39dba6e2c4b4e11228063d675b Mon Sep 17 00:00:00 2001 From: zhangds Date: Thu, 21 Jul 2022 10:31:32 +0800 Subject: [PATCH 1/8] =?UTF-8?q?1)=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/goods_new_v2.js | 657 ----------------------------------------- 1 file changed, 657 deletions(-) delete mode 100644 public/goods_new_v2.js diff --git a/public/goods_new_v2.js b/public/goods_new_v2.js deleted file mode 100644 index 40f426fd..00000000 --- a/public/goods_new_v2.js +++ /dev/null @@ -1,657 +0,0 @@ -var product = [ - { - id: "119", - name: "支付宝立减金", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zfbreduce.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhifubaolijianjin8rNfKSyqbu.png", - ], - }, - { - id: "102", - name: "奈雪", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/naixue.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/naixuedecha.png", - ], - }, - { - id: "95", - name: "埋堆堆", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/maiduidui.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/maiduidui.png", - ], - }, - { - id: "93", - name: "中石化100", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/shihua.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhongshihua100.png", - ], - }, - { - id: "92", - name: "中石油100", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zhongguoshiyou.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhongshiyou100.png", - ], - }, - { - id: "86", - name: "肯德基宅神卡月卡", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kendeji.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/kendejizhaishenkayueka.png", - ], - }, - { - id: "65", - name: "百度文库", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/baiduwenku.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/baiduwenku.png", - ], - }, - { - id: "64", - name: "全国话费", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/quanguohuafei.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/quanguohuafeizhichong.png", - ], - }, - { - id: "60", - name: "bilibili", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/bilibili.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/bilibili.png", - ], - }, - { - id: "59", - name: "wps", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/wps.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/wpshuiyuan.png", - ], - }, - { - id: "58", - name: "滴滴", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/didi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/didichuhang.png", - ], - }, - { - id: "55", - name: "瑞幸咖啡", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/ruixing.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/ruixingkafei.png", - ], - }, - { - id: "47", - name: "咪咕阅读", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/miguyuedu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/miguyuedu.png", - ], - }, - { - id: "43", - name: "百度网盘", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/baiduwangpan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/baiduwangpan.png", - ], - }, - { - id: "42", - name: "蜻蜓fm", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qingtingfm.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/qingtingfm.png", - ], - }, - { - id: "39", - name: "饿了么", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/eleme.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/elemo.png", - ], - }, - { - id: "36", - name: "e袋洗", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/edaixi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/edaixi.png", - ], - }, - { - id: "35", - name: "keep会员", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/keephuiyuan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/keephuiyuan1.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/keephuiyuan2.png", - ], - }, - { - id: "31", - name: "盐选月卡", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/yanxuan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/yanxuanyuekaqyB7QaVkdk.png", - ], - }, - { - id: "30", - name: "掌悦", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zhangyue.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhangyue.png", - ], - }, - { - id: "29", - name: "樊登读书", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/fandeng.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/fandengdushu.png", - ], - }, - { - id: "27", - name: "美团外卖", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/meituanwaimai.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/meituanwaimaiaxdIPJi9qt.png", - ], - }, - { - id: "24", - name: "新浪微博", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/sina_weibo.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/xinlangweibo.png", - ], - }, - { - id: "23", - name: "爱奇艺黄金会员", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/aiqiyi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/aiqiyihuangjinhuiyuanUJlNYhv2md.png", - ], - }, - { - id: "22", - name: "迅雷", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/xunlei.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/xunlei.png", - ], - }, - { - id: "21", - name: "咪咕视频", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/miguvideo.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/migushipin.png", - ], - }, - { - id: "19", - name: "酷我音乐", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kuwoyinyue.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/kuwoyinle.png", - ], - }, - { - id: "18", - name: "酷狗音乐", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kugou.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/kugouyinlegeLyvcBDTw.png", - ], - }, - { - id: "12", - name: "网易云", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/wangyiyun.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/wangyiyunyinle.png", - ], - }, - { - id: "8", - name: "黄钻", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/huangzuan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/tengxunhuangzuan.png", - ], - }, - { - id: "7", - name: "搜狐", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/souhu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/souhushipin.png", - ], - }, - { - id: "6", - name: "喜马拉雅", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/ximalaya.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/ximalaya.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/ximalayaertonghuiyuan.png", - ], - }, - { - id: "5", - name: "芒果", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/mangguo.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/mangguoleCsmWYPrV.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/mangguopcleCsmWYPrV.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/mangguoquanpinghuiyuan.png", - ], - }, - { - id: "4", - name: "qq音乐", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qqmusic.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/qqyinle.png", - ], - }, - { - id: "3", - name: "腾讯视频", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/tenxun.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/tengxunshipin.png", - ], - }, - { - id: "2", - name: "优酷视频", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/youku.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/youkushipin.png", - ], - }, - { - id: "1", - name: "爱奇艺", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/aiqiyi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/aiqiyibaijinhuiyuan.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/aiqiyihuangjinhuiyuanUJlNYhv2md.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/aiqiyitiyu.png", - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/aiqiyixingzuanhuiyuanUJlNYhv2md.png", - ], - }, - { - id: "", - name: "1905", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/1905.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/1905dianyingwang.png", - ], - }, - { - id: "", - name: "爱阅读", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/aiyuedu.png", - describe_url: [], - }, - { - id: "", - name: "阿里集分宝", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/alijifenbao.png", - describe_url: [], - }, - { - id: "", - name: "百度影音", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/baiduyingyin.png", - describe_url: [], - }, - { - id: "", - name: "百果园", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/baiguoyuan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/baiguoyuan.png", - ], - }, - { - id: "", - name: "百合网", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/baihewang.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/baihewang.png", - ], - }, - { - id: "", - name: "唱吧", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/changba.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/changba.png", - ], - }, - { - id: "", - name: "春雨", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/chunyu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/chunyuyisheng.png", - ], - }, - { - id: "", - name: "刀塔", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/daota.png", - describe_url: [], - }, - { - id: "", - name: "大众点评", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/dazhongdianping.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/dazhongdianping.png", - ], - }, - { - id: "", - name: "得到", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/dedao.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/dedao.png", - ], - }, - { - id: "", - name: "德克士", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/dekeshi.png", - describe_url: [], - }, - { - id: "", - name: "电信", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/dianxin.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhongguodianxin.png", - ], - }, - { - id: "", - name: "地下城", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/dixiacheng.png", - describe_url: [], - }, - { - id: "", - name: "抖音", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/douyin.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/douyin.png", - ], - }, - { - id: "", - name: "哈根达斯", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/hagendashi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/hagendasieBtYZILoSl.png", - ], - }, - { - id: "", - name: "海豚家", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/haitunjia.png", - describe_url: [], - }, - { - id: "", - name: "哈喽单车", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/halou.png", - describe_url: [], - }, - { - id: "", - name: "好大夫", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/haodafu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/haodafu.png", - ], - }, - { - id: "", - name: "好利来", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/haolilai.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/haolilai.png", - ], - }, - { - id: "", - name: "京东plus", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/jindongplus.png", - describe_url: [], - }, - { - id: "", - name: "凯叔讲故事", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kaishujianggushi.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/kaishujianggushi.png", - ], - }, - { - id: "", - name: "kfc会员", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kfc.png", - describe_url: [], - }, - { - id: "", - name: "快看漫画", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kuaikanmanhua.png", - describe_url: [], - }, - { - id: "", - name: "酷喵视频", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/kumiao.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/kumiaoshipiniUAn9bLid1.png", - ], - }, - { - id: "", - name: "懒人听书", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/lanrentinshu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/lanrentingshu.png", - ], - }, - { - id: "", - name: "雷神奥拉夫加速", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/leishenaolafujiasuqi.png", - describe_url: [], - }, - { - id: "", - name: "乐视视频", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/leshishipin.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/leshishipin.png", - ], - }, - { - id: "", - name: "联通", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/liantong.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhongguoliantong.png", - ], - }, - { - id: "", - name: "麦当劳", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/maidanglao.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/maidanglaoIkcTzrPkbN.png", - ], - }, - { - id: "", - name: "猫眼", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/maoyan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/maoyandianying.png", - ], - }, - { - id: "", - name: "美团骑行", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/meituan.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/meituanqihang.png", - ], - }, - { - id: "", - name: "陌陌", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/miguyuedu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/momo.png", - ], - }, - { - id: "", - name: "NBA", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/NBA.png", - describe_url: [], - }, - { - id: "", - name: "NBA", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/NBA.png", - describe_url: [], - }, - { - id: "", - name: "留金树", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/niujinshu.png", - describe_url: [], - }, - { - id: "", - name: "pptv", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/pptv.png", - describe_url: [], - }, - { - id: "", - name: "Q币", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qbi.png", - describe_url: [], - }, - { - id: "", - name: "青桔单车", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qingji.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/qingjudanche.png", - ], - }, - { - id: "", - name: "QQVIP", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qqVip.png", - describe_url: [], - }, - { - id: "", - name: "QQVIP", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qqVip.png", - describe_url: [], - }, - { - id: "", - name: "QQ阅读", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/qqyuedu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/QQyuedu.png", - ], - }, - { - id: "", - name: "十点听书", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/shidiantingshu.png", - describe_url: [], - }, - { - id: "", - name: "同程黑鲸", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/tongchengheijin.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/tongchengheijing.png", - ], - }, - { - id: "", - name: "喜茶", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/xicha.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/xicha.png", - ], - }, - { - id: "", - name: "携程", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/xiecheng.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/xiecheng.png", - ], - }, - { - id: "", - name: "知乎", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zhihu.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhihu.png", - ], - }, - { - id: "", - name: "作业帮", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zuoyebang.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zuoyebang.png", - ], - }, - { - id: "", - name: "中石油200", - pic: "https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zhongguoshiyou.png", - describe_url: [ - "http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/zhongshiyou200.png", - ], - }, -]; From 898efb27cda2d03035480789ca55d330ef7ceea4 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 4 Aug 2022 18:30:16 +0800 Subject: [PATCH 2/8] =?UTF-8?q?copy=E6=96=B0=E5=A2=9Ekey=20=20=E9=87=8D?= =?UTF-8?q?=E5=86=99=E5=A4=8D=E5=88=B6=E5=85=91=E6=8D=A2=E7=A0=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/copyCode/index.jsx | 1179 ++++++++++++++++++++ src/pages/exchangecode/copyCode/index.less | 268 +++++ src/pages/exchangecode/copyCode/utils.js | 158 +++ src/pages/exchangecode/list/list.js | 16 +- src/pages/home/home.js | 542 +++++---- 5 files changed, 1882 insertions(+), 281 deletions(-) create mode 100644 src/pages/exchangecode/copyCode/index.jsx create mode 100644 src/pages/exchangecode/copyCode/index.less create mode 100644 src/pages/exchangecode/copyCode/utils.js diff --git a/src/pages/exchangecode/copyCode/index.jsx b/src/pages/exchangecode/copyCode/index.jsx new file mode 100644 index 00000000..9c0f77c0 --- /dev/null +++ b/src/pages/exchangecode/copyCode/index.jsx @@ -0,0 +1,1179 @@ +import { deWeightThree } from '../../../utils' +import React from 'react' +import { + Card, + Sweetalert, + DateRangePicker, + Drawer, + Button, + Radio, + Notify, + Select, + Input, + Checkbox, + Icon, + RadioGroup, + RadioButton +} from 'zent' +import Ipt from '@/components/input/main' +import Form from '@/components/form/main' +import FormItem from '@/components/form-item/main' +import Grid from '@/components/gird/main.js' +import { Column2, Column, rulesInfo, codeInfo } from './utils' +import { + addPlanStep, + handelResponse, + addKeysBatchInfo, + getKeyBatchDetail, + getReseller, + keyApproval, + getProductInfoSelect +} from '@/assets/api.js' +import Productform from '../product/add' +import KnockGold from '@/components/knockGold' /* 立减金 */ + +import Bus from '@/assets/eventBus.js' +import _ from 'lodash' +import './index.less' +import moment from 'moment' +import { isSameDay } from 'date-fns' + +const initArray = (targetNum) => { + return Array.from({ length: targetNum }, (_, index) => index) +} + +export default class acclist extends React.Component { + constructor(props) { + super(props) + this.state = { + keys: [ + { + style: 1, + quantity: '', + allow_repetition: 0, + allow_loss: 0, + merge_stock: 1, + code_batch: '', + draw_title: '' + } + ], + model: { + //数据模型不可少 + style: 1, + quantity: '', + plan_id: '', + title: '', + allow_repetition: 0, + allow_loss: 0, + merge_stock: 1, + code_batch: '', + draw_title: '', + batch_name: '' + }, + drawerVisible: false, + drawerVisible2: false, + checkedList: [1], + productData: [], + codeInfo: { + //数据模型不可少 + code_name: '', + issued: '', //发放总量 + describe: '', + date_time: '', + range: '' + }, + rank: null, + rankoptions: [], + tempdata: [], + distdata: [], + pagetitle: '新建key', + begintime: '', + endtime: '', + rowIndex: -1, + uploading: false, + audit_visible: false, + phone_list: [], + email_list: [], + paytype: 3, + reseller: null, + payment_direction: ['对私账户', '对公账户', '预付款扣除'], + + white_visible: false, + mobile_excel: '', + mobile_repeat: [], + direct_reseller_id: 0, + newGoodsBtnLoading: false, + newGoldLoading: false, + product_title: '新建商品', + addIsType: '', + copyBatch_id: '' + } + } + + componentDidMount(e) { + let batch_id = sessionStorage.getItem('keybatch_id') + let copy_code_id = ~~sessionStorage.getItem('copy_code_id') + this.setState({ copyBatch_id: batch_id }) + //key样式 + let keystyle = sessionStorage.getItem('keyStyle') + + if (keystyle == 1) { + let model = this.state.model + model.style = 6 + this.setState({ model: model, white_visible: true }) + } + //复制 + getKeyBatchDetail(batch_id).then((res) => { + handelResponse( + res, + (req, msg) => { + this.setState({ pagetitle: '复制key' }) + getReseller(req.reseller_id).then((res) => { + handelResponse(res, (req, msg) => { + this.setState({ + phone_list: req.contact_phone, + direct_reseller_id: req.direct_reseller_id, + email_list: req.contact_email, + reseller: req + }) + getProductInfoSelect({ + reseller_id: req.direct_reseller_id + }).then((res) => { + if (res.code === 200) { + sessionStorage.setItem( + 'productsList', + JSON.stringify(res.data.data) + ) + } + }) + }) + }) + let model = { + title: req.plan_title, + style: req.style, + quantity: req.quantity, + allow_repetition: req.allow_repetition, + allow_loss: req.allow_loss, + merge_stock: req.merge_stock, + code_batch: req.code_batch, + batch_name: req.batch_name, + copy_code_batch_id: copy_code_id + } + let codeInfo = { + //数据模型不可少 + date_time: [req.begin_time, req.end_time] + } + sessionStorage.setItem( + 'plan_item', + JSON.stringify({ + begin_time: req.begin_time, + end_time: req.end_time + }) + ) + this.setState({ + checkedList: req.bind_object, + model: model, + endtime: req.end_time, + begintime: req.begin_time, + codeInfo: codeInfo + }) + + let list = _.map(req.code_batch, (item) => { + item.product = item.product.map((item1) => { + let obj = {} + if (item1.type === 1) { + obj = item1.entity + obj.upstream = '直连天下' + obj.only = item1.entity.product_id + obj.id = item1.entity.product_id + obj.weight = item1.weight + if (copy_code_id === item.id) { + obj.usage = 0 + } else { + obj.usage = item1?.entity.usage + } + obj.type = item1.type + } else if (item1.type === 2) { + obj.type = item1.type + obj.product_id = item1.entity.goods_id + obj.product_type_text = '立减金' + obj.only = item1.entity.channel_activity_id + obj.id = item1.entity.goods_id + obj.upstream = + String(item1.entity.channel) === '1' ? '支付宝' : '微信' + obj.code_batch_id = item1.code_batch_id + obj.contract_price = item1.entity.price + obj.create_time = item1.create_time + obj.official_price = item1.entity.reduce_amount + obj.channel_activity_id = item1.entity.channel_activity_id + obj.product_name = item1.entity.batch_goods_name + obj.quantity = item1.entity.stock + item1.entity.weight = item1.weight + obj.stock = item1.entity.stock + if (copy_code_id === item.id) { + obj.usage = 0 + } else { + obj.usage = item1?.entity.usage + } + obj.effectDate = + item1.entity.time_limit.effect_time.start_time + + ' 至 ' + + item1.entity.time_limit.effect_time.end_time + //有效时间 + delete item1.entity.id + obj.origin = item1.entity + } + + return obj + }) + /* 不是复制得兑换码 无法编辑 */ + if (copy_code_id !== item.id) { + item.checked = true + item.disabled = true + } else { + item.checked = true + item.title = item.title + '_' + ++req.copy_count + } + return item + }) + this.setState({ distdata: list }) + }, + (err) => {} + ) + }) + } + + onPayTypeChange(e) { + this.setState({ paytype: e.target.value }) + } + + async submit() { + let valide = false + if (this.refs.form1.validator()) { + let data = {} + data.batch_name = this.state.model.batch_name + data.style = this.state.model.style + data.quantity = this.state.model.quantity + data.bind_object = this.state.model.bind_object + data.allow_repetition = this.state.model.allow_repetition + data.allow_loss = this.state.model.allow_loss + data.merge_stock = this.state.model.merge_stock + data.code_batch = this.state.distdata + let formdata = {} + formdata.step = 'key' + formdata.data = data + await addPlanStep('', formdata).then((res) => { + handelResponse( + res, + (req, msg) => { + sessionStorage.setItem('plan_id', req.id) + valide = true + return + }, + (err) => { + Notify.error(err) + } + ) + }) + } + return valide + } + + Cancel() { + Sweetalert.confirm({ + type: 'warning', + closeBtn: true, + title: '确认操作', + content:

是否取消本次操作?

, + onConfirm: () => { + window.history.back() + }, + onCancel: this.onCancel, + className: 'questModal', + parentComponent: this + }) + } + + closeDraw() { + this.setState({ drawerVisible: false }) + } + addProduct(type) { + this.setState({ addIsType: type }) /* 类型 */ + let direct_reseller_ids = this.state.direct_reseller_id + if (direct_reseller_ids <= 0) { + // 老数据不能进行新增商品操作 + Notify.error(`请添加映射分销商`) + return + } + + if (type === 'addProduct') { + this.setState({ product_title: '新建商品', newGoodsBtnLoading: true }) + } else { + this.setState({ product_title: '新增立减金', newGoldLoading: true }) + } + let param = { + reseller_id: direct_reseller_ids + } + try { + getProductInfoSelect(param).then((res) => { + if (res.code === 200) { + sessionStorage.setItem('productsList', JSON.stringify(res.data.data)) + this.setState({ productData: null }) + this.setState({ drawerVisible2: true }) + } + if (type === 'addProduct') { + this.setState({ + newGoodsBtnLoading: false + }) + } else { + this.setState({ + newGoldLoading: false + }) + } + }) + } catch (err) { + if (type === 'addProduct') { + this.setState({ + newGoodsBtnLoading: false + }) + } else { + this.setState({ + newGoldLoading: false + }) + } + } + } + //渲染范围列表数据以及数据转换 + async productSubmit() { + let visible = '' + if (this.state.addIsType === 'addProduct') { + visible = await this.refs.product.submit() + } else { + visible = await this.refs.knockGold.submit() + } + + if (visible) { + Notify.success('保存成功') + this.setState({ drawerVisible2: false }) + setTimeout(() => { + let data = null + let temp = null + let concatData = [] + /* 处理商品 */ + if (this.state.addIsType === 'addProduct') { + data = JSON.parse(sessionStorage.getItem('productData')).filter( + (item) => item.type !== 2 + ) + + concatData = this.state.tempdata.filter((item) => item.type !== 1) + + temp = _.map(data, (item) => { + let index = this.state.tempdata.findIndex((o) => { + return o.product_id == item.product_id + }) + + if (index > -1) { + item.checked = this.state.tempdata[index].checked + } + item.type = 1 + item.only = item.product_id + item.upstream = '直连天下' + return item + }) + } else { + /* 处理立减金 */ + data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter( + (item) => item.type !== 1 + ) + + concatData = this.state.tempdata.filter((item) => item.type !== 2) + + temp = _.map(data, (item) => { + let index = this.state.tempdata.findIndex((o) => { + return o.channel_activity_id === item.channel_activity_id + }) + + if (index > -1) { + item.checked = this.state.tempdata[index].checked + } + + /* 转换商品结构 */ + // temp + const newObj = {} + newObj.product_name = item.batch_goods_name + ? item.batch_goods_name + : item.product_name //名字 + newObj.map_product_name = item.product_name + newObj.channel_activity_id = item.channel_activity_id //批次号 + newObj.only = item.channel_activity_id //批次号 + newObj.type = 2 //类型 + newObj.checked = item?.checked + newObj.upstream = String(item.channel) === '1' ? '支付宝' : '微信' //上游 + newObj.edit = 'edit' + newObj.effectDate = item.effectDate + ? item.effectDate + : item.time_limit?.effect_time.start_time + + ' 至 ' + + item.time_limit?.effect_time.end_time //有效时间 + newObj.contract_price = item.contract_price + ? item.contract_price + : item.price //单价 + newObj.official_price = item.official_price + ? item.official_price + : item.reduce_amount //官方价 + newObj.quantity = item.quantity + ? item.quantity + : Math.trunc(item.all_budget / item.reduce_amount) //总库 + newObj.origin = item?.origin ? item?.origin : item + return newObj + }) + } + let newArray = deWeightThree(temp.concat(concatData), 'only') + + //select数据 + let arr = [] + let rank = [] + _.map(newArray, (res) => { + arr.push({ key: res.only, text: res.product_name }) + if (res.checked) { + rank.push({ key: res.only, text: res.product_name }) + } + }) + + arr = deWeightThree(arr, 'key') + this.setState({ tempdata: newArray, rankoptions: arr, rank }) + }, 500) + } + } + onChangeCombinedDate(e) { + let model2 = this.state.codeInfo + model2.date_time = e + this.setState({ codeInfo: model2 }) + } + + //select + onRankChange(e) { + _.forEach(this.state.tempdata, (item) => { + item.checked = + e.findIndex((checks) => { + return checks.key == item.only + }) > -1 + }) + this.setState({ tempdata: this.state.tempdata }) + this.setState({ rank: e }) + } + codeSubmit() { + if (this.refs.code_info.validator() && this.refs.code_rule.validator()) { + if (this.state.uploading) { + Notify.error('还有图片上传中,不可提交') + return + } + + let productlist = _.filter(this.state.tempdata, (item) => { + return item.checked == true + }) + let sum = 0 + _.forEach(productlist, (o) => { + sum += parseInt(o.quantity) + }) + if (sum < this.state.codeInfo.issued) { + Notify.error('所选商品库存总数小于发放量') + return + } + // let productList = JSON.parse(sessionStorage.getItem("productsList")); + + this.setState({ drawerVisible: false }) + let rank = _.map(this.state.rank, (item) => { + return item.text + }) + + let temp = { + title: this.state.codeInfo.code_name, + describe: this.state.codeInfo.describe, + begin_time: this.state.codeInfo.date_time[0], + end_time: this.state.codeInfo.date_time[1], + quantity: this.state.codeInfo.issued, + range: rank.toString(), + restrict: this.state.codeInfo.restrict + } + + let arr = _.map(productlist, (item) => { + let obj = {} + obj.product_id = item.product_id + obj.product_type = item.product_type + obj.product_name = item.product_name + obj.account_type = item.account_type + obj.contract_price = item.contract_price + obj.cost_price = item.cost_price + obj.official_price = item.official_price + obj.quantity = item.quantity + obj.show_url = item.show_url + obj.describe_url = item.describe_url + obj.detail_url = item.detail_url + obj.map_product_name = item.map_product_name + if (item.type === 2) { + obj.channel_activity_id = item.channel_activity_id //批次号 + obj.effectDate = item.effectDate //有效时间 + obj.origin = item.origin // 原始数据 + } + obj.only = item.only + obj.weight = item.weight + obj.type = item.type + obj.upstream = item.upstream + return obj + }) + temp.product = arr + + if (this.state.rowIndex > -1) { + this.state.distdata[this.state.rowIndex] = temp + this.setState({ distdata: this.state.distdata }) + } else { + let tempdata = this.state.distdata + tempdata.push(temp) + this.setState({ distdata: tempdata }) + } + } + } + + onAudit() { + // if (!this.state.reseller) { + // Notify.error('对应分销商数据不存在') + // return + // } + /* 处理数据 区分立减金和商品 开始 2022-05-30 13:40*/ + const dataCopy = this.refs.bindObj.getSelectData() + if (dataCopy.filter((item) => !item.disabled).length == 0) { + Notify.error('请绑定对象') + return + } + dataCopy.map((item) => { + item.products = item.product + }) + + dataCopy.map((item) => + item.products.map(() => { + item.product = { + legal: item.products.filter((item2) => item2.type === 1), + reduce: item.products + .map((item2) => { + if (item2.type === 2) return item2.origin + }) + .filter((item3) => item3) + } + }) + ) + + dataCopy.map((item) => { + delete item.products + }) + /* 处理数据 区分立减金和商品 完成 2022-05-30 13:40*/ + debugger + + let data = {} + data.batch_name = this.state.model.batch_name + data.copy_code_batch_id = this.state.model?.copy_code_batch_id + data.style = this.state.model.style + data.quantity = this.state.model.quantity + data.bind_object = this.state.checkedList + data.allow_repetition = this.state.model.allow_repetition + data.allow_loss = this.state.model.allow_loss + data.merge_stock = this.state.model.merge_stock + data.code_batch = dataCopy + + data.reseller_id = this.state.reseller.id + data.reseller_name = this.state.reseller.name + data.company_name = this.state.reseller.company_name + data.receive_email = this.state.reseller.contact_email[0] + data.payment_direction = + this.state.payment_direction[this.state.paytype - 1] + + data.mobile_excel = this.state.mobile_excel + data.mobile_repeat = this.state.mobile_repeat + + this.setState({ audit_visible: false }) + + let id = sessionStorage.getItem('key_plan_id') + addKeysBatchInfo(id, data).then((res) => { + handelResponse( + res, + (req, msg) => { + keyApproval(id, req.key_batch_id, data).then((res) => { + handelResponse( + res, + (req, msg) => { + Notify.success('成功发起审批') + setTimeout(() => { + window.history.back() + }, 2000) + }, + (err) => { + Notify.error(err) + } + ) + }) + }, + (err) => { + Notify.error(err) + } + ) + }) + } + + onBindNum(e, row, rowIndex) { + this.state.distdata[rowIndex].restrict = e.target.value + this.setState({ distdata: this.state.distdata }) + } + + onDisabledRange = (date, type) => { + let step1 = JSON.parse(sessionStorage.getItem('plan_item')) + let isdisabled = false + let str = moment(date).format('YYYY-MM-DD HH:mm:ss') + if (type == 'start') { + isdisabled = + moment(str).isBefore(step1.begin_time) || + moment(str).isAfter(step1.end_time) + } + + if (type == 'end') { + isdisabled = + moment(str).add(1, 'days').isBefore(step1.begin_time) || + moment(str).isAfter(step1.end_time) + } + return isdisabled + } + + rowItemClick(row, rowIndex) { + let codeInfo = { + //数据模型不可少 + code_name: row.title, + issued: row.quantity, //发放总量 + describe: row.describe, + date_time: [row.begin_time, row.end_time], + range: row.range, + restrict: row.restrict + } + + let arr = _.map(row.product, (res) => { + let obj = {} + obj.key = res.only + obj.text = res.product_name + return obj + }) + this.setState({ + draw_title: '编辑兑换码', + rankoptions: arr, + rank: arr, + codeInfo: codeInfo, + rowIndex: rowIndex + }) + + let temp = _.map(row.product, (o) => { + o.checked = true + return o + }) + + sessionStorage.setItem('productData', JSON.stringify(row.product)) + sessionStorage.setItem('knockGoldData', JSON.stringify(row.product)) + this.setState({ drawerVisible: true, tempdata: temp }) + } + + onDisabledTime = (date, type) => { + const min = new Date() + const hour = min.getHours() + const minute = min.getMinutes() + const second = min.getSeconds() + const isSame = isSameDay(date, min) + + return isSame + ? { + disabledHours: () => initArray(hour), + disabledMinutes: (hourValue) => + hourValue === hour ? initArray(minute) : [], + disabledSeconds: (hourValue, minuteValue) => + hourValue === hour && minuteValue === minute + ? initArray(second) + : [] + } + : {} + } + + submitAudit() { + if (this.refs.form1.validator()) { + this.setState({ audit_visible: true }) + } + } + keyProductClick(row, index) { + console.log('keyProductClick 13==>', row) + if (this.state.direct_reseller_id > 0) { + /* 区分立减金 */ + if (row.type === 2) { + this.setState({ + product_title: '编辑立减金', + productData: row.origin, + addIsType: 'addKnockGold', + drawerVisible2: true + }) + } else { + this.setState({ + product_title: '编辑商品', + productData: row, + addIsType: 'addProduct', + drawerVisible2: true + }) + } + } else { + // 老数据不能进行新增商品操作 + Notify.error(`请添加映射分销商`) + return + } + } + render() { + return ( +
+ +
+ +
{this.state.model.title}
+
+ +
+ {this.state.model.batch_name} +
+
+ + + + 串码 + 链接 + 二维码 + 白名单 + + + + +
+
+ {this.state.model.quantity} +
+ + {this.state.white_visible ? ( + + ) : null} +
+
+ + + + 兑换码 + + 优惠券 + + + + {this.state.checkedList.length > 0 ? ( + + {this.state.checkedList.indexOf(1) > -1 ? ( + + ) : null} + + ) : null} + + { + this.pageChange(e) + }} + checkChange={(selection) => {}} + ComponentHandler={(com, rowData, rowIndex) => { + if (com == 'restrict') { + return ( + { + this.onBindNum(e, rowData, rowIndex) + }} + disabled={rowData.disabled} + /> + ) + } + if (com == 'edit') { + { + return rowData.disabled ? ( + 编辑 + ) : ( + { + this.rowItemClick(rowData, rowIndex) + }} + style={{ color: '#2B66F2' }}> + 编辑 + + ) + } + } + }} + /> + + + + + + + + + + + + + + +
+
+ +
+ + +
+ + + + +
+ } + visible={this.state.drawerVisible} + onClose={(e) => { + this.closeDraw() + }} + maskClosable={false}> +
+ +
+
+ + { + let model = this.state.codeInfo + model.code_name = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.code_name = '' + this.setState({ codeInfo: model }) + }} + value={this.state.codeInfo.code_name} + placeholder={'请输入兑换码名称'} + labelWidth={'0px'} + maxLength={10} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.issued = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.issued = '' + this.setState({ codeInfo: model }) + }} + unit='条' + countShow={false} + value={this.state.codeInfo.issued} + placeholder={'请输入发放总量'} + labelWidth={'0px'} + maxLength={12} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.describe = e.target.value + console.log(model.describe) + this.setState({ codeInfo: model }) + }} + /> + +
+
+
+ +
+
+ + { + Bus.emit('change', 'date_time', e) + this.onChangeCombinedDate(e) + }} + disabledTime={this.onDisabledTime} + disabledDate={this.onDisabledRange} + /> + + +
+ { + this.onBindNum(e, rowData, rowIndex) + }} + disabled={rowData.disabled} + /> + ) + } + if (com == 'edit') { + return ( + { + this.rowItemClick(rowData, rowIndex) + }} + style={{ color: '#2B66F2' }}> + 编辑 + + ) + } + }} + /> + + + this.onRepetitionChange(e)} + value={this.state.model.allow_repetition}> + + + + + + + this.onLossChange(e)} + value={this.state.model.allow_loss}> + + + + + + + +
+ + +
+ + + + +
+ } + visible={this.state.drawerVisible} + onClose={(e) => { + this.closeDraw() + }} + maskClosable={false}> +
+ +
+
+ + { + let model = this.state.codeInfo + model.code_name = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.code_name = '' + this.setState({ codeInfo: model }) + }} + value={this.state.codeInfo.code_name} + placeholder={'请输入兑换码名称'} + labelWidth={'0px'} + maxLength={10} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.issued = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.issued = '' + this.setState({ codeInfo: model }) + }} + unit='条' + countShow={false} + value={this.state.codeInfo.issued} + placeholder={'请输入发放总量'} + labelWidth={'0px'} + maxLength={12} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.describe = e.target.value + console.log(model.describe) + this.setState({ codeInfo: model }) + }} + /> + +
+
+
+ +
+
+ + { + Bus.emit('change', 'date_time', e) + this.onChangeCombinedDate(e) + }} + disabledTime={this.onDisabledTime} + disabledDate={this.onDisabledRange} + /> + + +
+ this.fileChange(e)} + /> + + 更新文件 +
+ )} +
+ {this.state.success_visible ? ( +
+ + 文件解析成功,点击确定导入 即可导入 +
+ ) : null} + {this.state.fail_visible ? ( +
+ + 文件解析失败,请查看导入规则并更新文件 +
+ ) : null} +
+ ) : ( +
+ this.fileChange(e)} + /> + {' '} +
+ )} + +
+
下载模板并填写后上传
+ +
+
+ 请先下载「数字世界营销管理系统_白名单_模板」并按照模板填写后再上传。 +
+
+
+ +
+
+ + +
+
+
+
+ ) : null} + + {this.state.audit_visible ? ( +
+
+
+ { + this.setState({ audit_visible: false }) + }} + /> +
提交审核
+
+ { + this.onPayTypeChange(e) + }} + value={this.state.paytype} + className='audit-obj'> + 预付款扣除 + 对私账户 + 对公账户 + +
+
+ + +
+
+
+ ) : null} + + {this.state.excel_visible ? ( +
+
+
+
+
从Excel导入白名单
+ { + this.setState({ excel_visible: false }) + }} + /> +
+
+ 文件上传成功.共{this.state.excel_count}条手机号,其中 + {this.state.success_count}条可成功导入 +
+
+ 发现以下{this.state.error_count}条不符合要求,将不会被导入 +
+ +
+ +
+ { + this.pageChange(e) + }} + ComponentHandler={(com, rowData, rowIndex) => { + if (com == 'is_import') { + if ( + rowData.type == 'success' || + rowData.type == 'repeat' + ) { + let checked = rowData.type == 'success' + return ( + { + this.switchChange(e, rowData) + }} + /> + ) + } else { + return
-
+ } + } + }} + /> +
+
+
+ + +
+
+
+
+ ) : null} + + ) + } +} diff --git a/src/pages/exchangecode/add copy/add.less b/src/pages/exchangecode/add copy/add.less new file mode 100644 index 00000000..abc1c59f --- /dev/null +++ b/src/pages/exchangecode/add copy/add.less @@ -0,0 +1,268 @@ + + .addkey-btn-group{ + margin-left: 10px; + margin-top: 15px; + button{ + width: 100px; + height: 36px; + } + } + .btn-add{ + width: 50%; + margin: 0 auto; + height: 36px; + margin-top: 20px; + text-align: center; + line-height: 36px; + background-color: rgb(249, 250, 252); + } + #addkey .zent-radio-button--disabled[data-zv="9.11.0"].zent-radio-button--checked{ + color: #8a96aa; + background: #dfe8fc!important; + border: 1px solid #8a96aa!important; + } + + + .import-excel + { + width: 451px; + height:600px; + background-color: #FFFFFF; + border-radius: 5px; + + position: fixed; + top: 50%; + margin-top: -280px; + left: 50%; + margin-left: -215px; + z-index: 100; + .import-header{ + width: 100%; + height: 48px; + display: flex; + align-items: center; + .import-title{ + width: 70%; + font-size: 18px; + font-weight: bold; + margin-left: 20px; + } + + .closebtn{ + width: 30%; + + } + + .import-close{ + margin-left: 70px; + font-size: 20px; + font-weight: bold; + } + } + .step-bar{ + width: 80%; + height: 60px; + margin: 10px auto; + display: flex; + justify-content: center; + } + .step-code{ + width: 24px; + height: 24px; + border-radius: 50%; + border: 1px solid #e8e8e8; + display: flex; + align-items: center; + justify-content: center; + color: #e8e8e8; + + } + .step-code.active + { + background-color: #1890ff; + } + + .step-group{ + width: 150px; + height: 50px; + display: flex; + align-items: center; + } + .step-center{ + width: 60px; + height: 50px; + display: flex; + align-items: center; + margin-right: 40px; + } + .step-line{ + width: 50px; + height: 1px; + background-color:#e8e8e8; + + } + .step-line.active{ + background-color: #1890ff; + } + + .step-label{ + color: #8d8d8d; + font-size: 14px; + margin-left: 10px; + font-weight: bold; + } + .step-label.active{ + color: #000000; + } + + + .upload-panel1{ + width: 80%; + margin: 10px auto; + margin-bottom: 20px; + .upload-label{ + font-size: 15px; + font-weight: bold; + margin-bottom: 20px; + } + .upload-info{ + color:#626366; + } + } + + .btn-upload{ + margin-top: 10px; + margin-left: 40px; + margin-bottom: 20px; + background-color:#1890ff; + } + .btn-download{ + margin-top: 10px; + margin-left: 40px; + } + .foot-bar + { + width: 100%; + height: 50px; + position: absolute; + bottom: 20px; + .btn-group{ + width: 240px; + margin-left: 160px; + } + button{ + width: 100px; + } + + } + + .upload-msgbar{ + width: 82%; + background-color: #f5f5f5; + margin: 0 auto; + min-height: 40px; + border-radius: 5px; + + display: flex; + .execel-name{ + width: 75%; + display: flex; + min-height: 40px; + + align-items: center; + .excel-txt{ + font-size: 12px; + margin-left: 10px; + } + .doc-flag{ + font-size: 20px; + margin-left: 5px; + } + + + } + + .file-tag{ + width: 25%; + font-size: 12px; + display: flex; + align-items: center; + color: #1890ff; + + .upload-flag{ + font-size: 20px; + margin-left: 5px; + color: #1890ff; + margin-right: 3px; + } + } + + + } + .file-tip{ + margin-left: 45px; + margin-top: 10px; + margin-bottom: 50px; + } + .error{ + color: #e83f2e; + } + .success{ + color: #98d673; + } + + .error-icon{ + color: #e83f2e; + font-size: 18px; + margin-right: 10px; + } + .success-icon{ + color: #98d673; + font-size: 18px; + margin-right: 10px; + } + .file-upload-tip{ + color: #000000; + font-size: 14px; + font-weight: bold; + margin-left: 40px; + margin-top: 20px; + } + .file-errmsg{ + color: #000000; + font-size: 14px; + margin-left: 40px; + margin-top: 40px; + } + + .gridpanel{ + width: 90%; + height: 400px; + margin: 0 auto; + margin-top: 50px; + } + + + } + .audit-obj{ + margin-left: 30px; + margin-bottom: 10px; + } + .upload-input{ + opacity: 0; + width: 300px; + height: 48px; + position: absolute; + z-index: 5; + } + .file-loading{ + font-size: 24px; + + } + .isImport{ + cursor: "pointer"; + } + .goods-boxs{ + display: flex; + justify-content: flex-start; + } \ No newline at end of file diff --git a/src/pages/exchangecode/copyCode/index copy.jsx b/src/pages/exchangecode/copyCode/index copy.jsx new file mode 100644 index 00000000..cd656787 --- /dev/null +++ b/src/pages/exchangecode/copyCode/index copy.jsx @@ -0,0 +1,1169 @@ +import { deWeightThree } from '../../../utils' +import React from 'react' +import { + Card, + Sweetalert, + DateRangePicker, + Drawer, + Button, + Radio, + Notify, + Select, + Input, + Checkbox, + Icon, + RadioGroup, + RadioButton +} from 'zent' +import Ipt from '@/components/input/main' +import Form from '@/components/form/main' +import FormItem from '@/components/form-item/main' +import Grid from '@/components/gird/main.js' +import { Column2, Column, rulesInfo, codeInfo } from './utils' +import { + addPlanStep, + handelResponse, + keyEditApproval, + getKeyBatchDetail, + getReseller, + keyApproval, + getProductInfoSelect +} from '@/assets/api.js' +import Productform from '../product/add' +import KnockGold from '@/components/knockGold' /* 立减金 */ + +import Bus from '@/assets/eventBus.js' +import _ from 'lodash' +import './index.less' +import moment from 'moment' +import { isSameDay } from 'date-fns' + +const initArray = (targetNum) => { + return Array.from({ length: targetNum }, (_, index) => index) +} + +export default class acclist extends React.Component { + constructor(props) { + super(props) + this.state = { + keys: [ + { + style: 1, + quantity: '', + allow_repetition: 0, + allow_loss: 0, + merge_stock: 1, + code_batch: '', + draw_title: '' + } + ], + model: { + //数据模型不可少 + style: 1, + quantity: '', + plan_id: '', + title: '', + allow_repetition: 0, + allow_loss: 0, + merge_stock: 1, + code_batch: '', + draw_title: '', + batch_name: '' + }, + drawerVisible: false, + drawerVisible2: false, + checkedList: [1], + productData: [], + codeInfo: { + //数据模型不可少 + code_name: '', + issued: '', //发放总量 + describe: '', + date_time: '', + range: '' + }, + rank: null, + rankoptions: [], + tempdata: [], + distdata: [], + pagetitle: '新建key', + begintime: '', + endtime: '', + rowIndex: -1, + uploading: false, + audit_visible: false, + phone_list: [], + email_list: [], + paytype: 3, + reseller: null, + payment_direction: ['对私账户', '对公账户', '预付款扣除'], + + white_visible: false, + mobile_excel: '', + mobile_repeat: [], + direct_reseller_id: 0, + newGoodsBtnLoading: false, + newGoldLoading: false, + product_title: '新建商品', + addIsType: '', + copyBatch_id: '' + } + } + + componentDidMount(e) { + let batch_id = sessionStorage.getItem('keybatch_id') + let copy_code_id = ~~sessionStorage.getItem('copy_code_id') + this.setState({ copyBatch_id: batch_id }) + //key样式 + let keystyle = sessionStorage.getItem('keyStyle') + + if (keystyle == 1) { + let model = this.state.model + model.style = 6 + this.setState({ model: model, white_visible: true }) + } + //复制 + getKeyBatchDetail(batch_id).then((res) => { + handelResponse( + res, + (req, msg) => { + this.setState({ pagetitle: '复制key' }) + getReseller(req.reseller_id).then((res) => { + handelResponse(res, (req, msg) => { + this.setState({ + phone_list: req.contact_phone, + direct_reseller_id: req.direct_reseller_id, + email_list: req.contact_email, + reseller: req + }) + getProductInfoSelect({ + reseller_id: req.direct_reseller_id + }).then((res) => { + if (res.code === 200) { + sessionStorage.setItem( + 'productsList', + JSON.stringify(res.data.data) + ) + } + }) + }) + }) + let model = { + title: req.plan_title, + style: req.style, + quantity: req.quantity, + allow_repetition: req.allow_repetition, + allow_loss: req.allow_loss, + merge_stock: req.merge_stock, + code_batch: req.code_batch, + batch_name: req.batch_name, + copy_code_batch_id: copy_code_id + } + let codeInfo = { + //数据模型不可少 + date_time: [req.begin_time, req.end_time] + } + sessionStorage.setItem( + 'plan_item', + JSON.stringify({ + begin_time: req.begin_time, + end_time: req.end_time + }) + ) + this.setState({ + checkedList: req.bind_object, + model: model, + endtime: req.end_time, + begintime: req.begin_time, + codeInfo: codeInfo + }) + + let list = _.map(req.code_batch, (item) => { + item.product = item.product.map((item1) => { + let obj = {} + if (item1.type === 1) { + obj = item1.entity + obj.upstream = '直连天下' + obj.only = item1.entity.product_id + obj.id = item1.entity.product_id + obj.weight = item1.weight + if (copy_code_id === item.id) { + delete obj.id + } + obj.type = item1.type + } else if (item1.type === 2) { + obj.type = item1.type + obj.product_id = item1.entity.goods_id + obj.only = item1.entity.channel_activity_id + obj.id = item1.entity.goods_id + obj.upstream = + String(item1.entity.channel) === '1' ? '支付宝' : '微信' + obj.code_batch_id = item1.code_batch_id + obj.contract_price = item1.entity.price + obj.create_time = item1.create_time + obj.official_price = item1.entity.reduce_amount + obj.channel_activity_id = item1.entity.channel_activity_id + obj.product_name = item1.entity.batch_goods_name + obj.quantity = item1.entity?.stock + item1.entity.weight = item1.weight + item1.entity.code_batch_id = item1.code_batch_id + if (copy_code_id === item.id) { + delete item1.entity.id + delete item1.entity.goods_id + } + obj.effectDate = + item1.entity.time_limit.effect_time.start_time + + ' 至 ' + + item1.entity.time_limit.effect_time.end_time + //有效时间 + obj.origin = item1.entity + } + + return obj + }) + let pr = {} + pr.range = item.range + pr.restrict = item.restrict + pr.begin_time = item.begin_time + pr.end_time = item.end_time + pr.quantity = item.quantity + pr.describe = item.describe + pr.product = item.product + /* 不是复制得兑换码 无法编辑 */ + if (copy_code_id !== item.id) { + pr.checked = true + pr.disabled = true + } else { + pr.checked = true + pr.title = item.title + '_' + ++req.copy_count + } + return pr + }) + this.setState({ distdata: list }) + }, + (err) => {} + ) + }) + } + + onPayTypeChange(e) { + this.setState({ paytype: e.target.value }) + } + + async submit() { + let valide = false + if (this.refs.form1.validator()) { + let data = {} + data.batch_name = this.state.model.batch_name + data.style = this.state.model.style + data.quantity = this.state.model.quantity + data.bind_object = this.state.model.bind_object + data.allow_repetition = this.state.model.allow_repetition + data.allow_loss = this.state.model.allow_loss + data.merge_stock = this.state.model.merge_stock + data.code_batch = this.state.distdata + let formdata = {} + formdata.step = 'key' + formdata.data = data + await addPlanStep('', formdata).then((res) => { + handelResponse( + res, + (req, msg) => { + sessionStorage.setItem('plan_id', req.id) + valide = true + return + }, + (err) => { + Notify.error(err) + } + ) + }) + } + return valide + } + + Cancel() { + Sweetalert.confirm({ + type: 'warning', + closeBtn: true, + title: '确认操作', + content:

是否取消本次操作?

, + onConfirm: () => { + window.history.back() + }, + onCancel: this.onCancel, + className: 'questModal', + parentComponent: this + }) + } + + closeDraw() { + this.setState({ drawerVisible: false }) + } + addProduct(type) { + this.setState({ addIsType: type }) /* 类型 */ + let direct_reseller_ids = this.state.direct_reseller_id + if (direct_reseller_ids <= 0) { + // 老数据不能进行新增商品操作 + Notify.error(`请添加映射分销商`) + return + } + + if (type === 'addProduct') { + this.setState({ product_title: '新建商品', newGoodsBtnLoading: true }) + } else { + this.setState({ product_title: '新增立减金', newGoldLoading: true }) + } + let param = { + reseller_id: direct_reseller_ids + } + try { + getProductInfoSelect(param).then((res) => { + if (res.code === 200) { + sessionStorage.setItem('productsList', JSON.stringify(res.data.data)) + this.setState({ productData: null }) + this.setState({ drawerVisible2: true }) + } + if (type === 'addProduct') { + this.setState({ + newGoodsBtnLoading: false + }) + } else { + this.setState({ + newGoldLoading: false + }) + } + }) + } catch (err) { + if (type === 'addProduct') { + this.setState({ + newGoodsBtnLoading: false + }) + } else { + this.setState({ + newGoldLoading: false + }) + } + } + } + //渲染范围列表数据以及数据转换 + async productSubmit() { + let visible = '' + if (this.state.addIsType === 'addProduct') { + visible = await this.refs.product.submit() + } else { + visible = await this.refs.knockGold.submit() + } + + if (visible) { + Notify.success('保存成功') + this.setState({ drawerVisible2: false }) + setTimeout(() => { + let data = null + let temp = null + let concatData = [] + /* 处理商品 */ + if (this.state.addIsType === 'addProduct') { + data = JSON.parse(sessionStorage.getItem('productData')).filter( + (item) => item.type !== 2 + ) + + concatData = this.state.tempdata.filter((item) => item.type !== 1) + + temp = _.map(data, (item) => { + let index = this.state.tempdata.findIndex((o) => { + return o.product_id == item.product_id + }) + + if (index > -1) { + item.checked = this.state.tempdata[index].checked + } + item.type = 1 + item.only = item.product_id + item.upstream = '直连天下' + return item + }) + } else { + /* 处理立减金 */ + data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter( + (item) => item.type !== 1 + ) + + concatData = this.state.tempdata.filter((item) => item.type !== 2) + + temp = _.map(data, (item) => { + let index = this.state.tempdata.findIndex((o) => { + return o.channel_activity_id === item.channel_activity_id + }) + + if (index > -1) { + item.checked = this.state.tempdata[index].checked + } + + /* 转换商品结构 */ + // temp + const newObj = {} + newObj.product_name = item.batch_goods_name + ? item.batch_goods_name + : item.product_name //名字 + newObj.map_product_name = item.product_name + newObj.channel_activity_id = item.channel_activity_id //批次号 + newObj.only = item.channel_activity_id //批次号 + newObj.type = 2 //类型 + newObj.checked = item?.checked + newObj.upstream = String(item.channel) === '1' ? '支付宝' : '微信' //上游 + newObj.edit = 'edit' + newObj.effectDate = item.effectDate + ? item.effectDate + : item.time_limit?.effect_time.start_time + + ' 至 ' + + item.time_limit?.effect_time.end_time //有效时间 + newObj.contract_price = item.contract_price + ? item.contract_price + : item.price //单价 + newObj.official_price = item.official_price + ? item.official_price + : item.reduce_amount //官方价 + newObj.quantity = item.quantity + ? item.quantity + : Math.trunc(item.all_budget / item.reduce_amount) //总库 + newObj.origin = item?.origin ? item?.origin : item + return newObj + }) + } + let newArray = deWeightThree(temp.concat(concatData), 'only') + + //select数据 + let arr = [] + let rank = [] + _.map(newArray, (res) => { + arr.push({ key: res.only, text: res.product_name }) + if (res.checked) { + rank.push({ key: res.only, text: res.product_name }) + } + }) + + arr = deWeightThree(arr, 'key') + this.setState({ tempdata: newArray, rankoptions: arr, rank }) + }, 500) + } + } + onChangeCombinedDate(e) { + let model2 = this.state.codeInfo + model2.date_time = e + this.setState({ codeInfo: model2 }) + } + + //select + onRankChange(e) { + _.forEach(this.state.tempdata, (item) => { + item.checked = + e.findIndex((checks) => { + return checks.key == item.only + }) > -1 + }) + this.setState({ tempdata: this.state.tempdata }) + this.setState({ rank: e }) + } + codeSubmit() { + if (this.refs.code_info.validator() && this.refs.code_rule.validator()) { + if (this.state.uploading) { + Notify.error('还有图片上传中,不可提交') + return + } + + let productlist = _.filter(this.state.tempdata, (item) => { + return item.checked == true + }) + let sum = 0 + _.forEach(productlist, (o) => { + sum += parseInt(o.quantity) + }) + if (sum < this.state.codeInfo.issued) { + Notify.error('所选商品库存总数小于发放量') + return + } + // let productList = JSON.parse(sessionStorage.getItem("productsList")); + + this.setState({ drawerVisible: false }) + let rank = _.map(this.state.rank, (item) => { + return item.text + }) + + let temp = { + title: this.state.codeInfo.code_name, + describe: this.state.codeInfo.describe, + begin_time: this.state.codeInfo.date_time[0], + end_time: this.state.codeInfo.date_time[1], + quantity: this.state.codeInfo.issued, + range: rank.toString(), + restrict: this.state.codeInfo.restrict + } + + let arr = _.map(productlist, (item) => { + let obj = {} + obj.product_id = item.product_id + obj.product_type = item.product_type + obj.product_name = item.product_name + obj.account_type = item.account_type + obj.contract_price = item.contract_price + obj.cost_price = item.cost_price + obj.official_price = item.official_price + obj.quantity = item.quantity + obj.show_url = item.show_url + obj.describe_url = item.describe_url + obj.detail_url = item.detail_url + obj.map_product_name = item.map_product_name + if (item.type === 2) { + obj.channel_activity_id = item.channel_activity_id //批次号 + obj.effectDate = item.effectDate //有效时间 + obj.origin = item.origin // 原始数据 + } + obj.only = item.only + obj.weight = item.weight + obj.type = item.type + obj.upstream = item.upstream + return obj + }) + temp.product = arr + + if (this.state.rowIndex > -1) { + this.state.distdata[this.state.rowIndex] = temp + this.setState({ distdata: this.state.distdata }) + } else { + let tempdata = this.state.distdata + tempdata.push(temp) + this.setState({ distdata: tempdata }) + } + } + } + + onAudit() { + // if (!this.state.reseller) { + // Notify.error('对应分销商数据不存在') + // return + // } + /* 处理数据 区分立减金和商品 开始 2022-05-30 13:40*/ + const dataCopy = this.refs.bindObj.getSelectData() + if (dataCopy.filter((item) => !item.disabled).length == 0) { + Notify.error('请绑定对象') + return + } + dataCopy.map((item) => { + item.products = item.product + }) + + dataCopy.map((item) => + item.products.map(() => { + item.product = { + legal: item.products.filter((item2) => item2.type === 1), + reduce: item.products + .map((item2) => { + if (item2.type === 2) return item2.origin + }) + .filter((item3) => item3) + } + }) + ) + + dataCopy.map((item) => { + delete item.products + }) + /* 处理数据 区分立减金和商品 完成 2022-05-30 13:40*/ + let data = {} + data.batch_name = this.state.model.batch_name + data.copy_code_batch_id = this.state.model?.copy_code_batch_id + data.style = this.state.model.style + data.quantity = this.state.model.quantity + data.bind_object = this.state.checkedList + data.allow_repetition = this.state.model.allow_repetition + data.allow_loss = this.state.model.allow_loss + data.merge_stock = this.state.model.merge_stock + data.code_batch = dataCopy + + data.reseller_id = this.state.reseller.id + data.reseller_name = this.state.reseller.name + data.company_name = this.state.reseller.company_name + data.receive_email = this.state.reseller.contact_email[0] + data.payment_direction = + this.state.payment_direction[this.state.paytype - 1] + + data.mobile_excel = this.state.mobile_excel + data.mobile_repeat = this.state.mobile_repeat + + this.setState({ audit_visible: false }) + + keyEditApproval(this.state.copyBatch_id, data).then((res) => { + handelResponse( + res, + (req, msg) => { + Notify.success('成功发起审批') + setTimeout(() => { + window.history.back() + }, 2000) + }, + (err) => { + Notify.error(err) + } + ) + }) + } + + onBindNum(e, row, rowIndex) { + this.state.distdata[rowIndex].restrict = e.target.value + this.setState({ distdata: this.state.distdata }) + } + + onDisabledRange = (date, type) => { + let step1 = JSON.parse(sessionStorage.getItem('plan_item')) + let isdisabled = false + let str = moment(date).format('YYYY-MM-DD HH:mm:ss') + if (type == 'start') { + isdisabled = + moment(str).isBefore(step1.begin_time) || + moment(str).isAfter(step1.end_time) + } + + if (type == 'end') { + isdisabled = + moment(str).add(1, 'days').isBefore(step1.begin_time) || + moment(str).isAfter(step1.end_time) + } + return isdisabled + } + + rowItemClick(row, rowIndex) { + let codeInfo = { + //数据模型不可少 + code_name: row.title, + issued: row.quantity, //发放总量 + describe: row.describe, + date_time: [row.begin_time, row.end_time], + range: row.range, + restrict: row.restrict + } + + let arr = _.map(row.product, (res) => { + let obj = {} + obj.key = res.only + obj.text = res.product_name + return obj + }) + this.setState({ + draw_title: '编辑兑换码', + rankoptions: arr, + rank: arr, + codeInfo: codeInfo, + rowIndex: rowIndex + }) + + let temp = _.map(row.product, (o) => { + o.checked = true + return o + }) + + sessionStorage.setItem('productData', JSON.stringify(row.product)) + sessionStorage.setItem('knockGoldData', JSON.stringify(row.product)) + this.setState({ drawerVisible: true, tempdata: temp }) + } + + onDisabledTime = (date, type) => { + const min = new Date() + const hour = min.getHours() + const minute = min.getMinutes() + const second = min.getSeconds() + const isSame = isSameDay(date, min) + + return isSame + ? { + disabledHours: () => initArray(hour), + disabledMinutes: (hourValue) => + hourValue === hour ? initArray(minute) : [], + disabledSeconds: (hourValue, minuteValue) => + hourValue === hour && minuteValue === minute + ? initArray(second) + : [] + } + : {} + } + + submitAudit() { + if (this.refs.form1.validator()) { + this.setState({ audit_visible: true }) + } + } + keyProductClick(row, index) { + console.log('keyProductClick 13==>', row) + if (this.state.direct_reseller_id > 0) { + /* 区分立减金 */ + if (row.type === 2) { + this.setState({ + product_title: '编辑立减金', + productData: row.origin, + addIsType: 'addKnockGold', + drawerVisible2: true + }) + } else { + this.setState({ + product_title: '编辑商品', + productData: row, + addIsType: 'addProduct', + drawerVisible2: true + }) + } + } else { + // 老数据不能进行新增商品操作 + Notify.error(`请添加映射分销商`) + return + } + } + render() { + return ( +
+ + + +
{this.state.model.title}
+
+ +
+ {this.state.model.batch_name} +
+
+ + + + 串码 + 链接 + 二维码 + 白名单 + + + + +
+
+ {this.state.model.quantity} +
+ + {this.state.white_visible ? ( + + ) : null} +
+
+ + + + 兑换码 + + 优惠券 + + + + {this.state.checkedList.length > 0 ? ( + + {this.state.checkedList.indexOf(1) > -1 ? ( + + ) : null} + + ) : null} + + { + this.pageChange(e) + }} + checkChange={(selection) => {}} + ComponentHandler={(com, rowData, rowIndex) => { + if (com == 'restrict') { + return ( + { + this.onBindNum(e, rowData, rowIndex) + }} + disabled={rowData.disabled} + /> + ) + } + if (com == 'edit') { + { + return rowData.disabled ? ( + 编辑 + ) : ( + { + this.rowItemClick(rowData, rowIndex) + }} + style={{ color: '#2B66F2' }}> + 编辑 + + ) + } + } + }} + /> + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + + +
+ } + visible={this.state.drawerVisible} + onClose={(e) => { + this.closeDraw() + }} + maskClosable={false}> +
+ +
+
+ + { + let model = this.state.codeInfo + model.code_name = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.code_name = '' + this.setState({ codeInfo: model }) + }} + value={this.state.codeInfo.code_name} + placeholder={'请输入兑换码名称'} + labelWidth={'0px'} + maxLength={10} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.issued = e + this.setState({ codeInfo: model }) + }} + onClearItem={(e) => { + let model = this.state.codeInfo + model.issued = '' + this.setState({ codeInfo: model }) + }} + unit='条' + countShow={false} + value={this.state.codeInfo.issued} + placeholder={'请输入发放总量'} + labelWidth={'0px'} + maxLength={12} + height={'36px'} + width={'520px'} + alignment={'left'} + /> + + + { + let model = this.state.codeInfo + model.describe = e.target.value + console.log(model.describe) + this.setState({ codeInfo: model }) + }} + /> + +
+
+
+ +
+
+ + { + Bus.emit('change', 'date_time', e) + this.onChangeCombinedDate(e) + }} + disabledTime={this.onDisabledTime} + disabledDate={this.onDisabledRange} + /> + + +
+