diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index 89e5931..9ef022d 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -1,27 +1,35 @@ - - - - - - 建议宽度640 - - - + + + + + + 建议宽度640 + + + + - - + + + + - - - + + + + + + + + + - - - + + + @@ -34,16 +42,24 @@ 建议宽度640 - - - + + + + + + + + + + - - - + + + + + - @@ -62,13 +78,30 @@ 300*300 - + + + + + + + + + + + + + + + + + + @@ -80,8 +113,7 @@ - + @@ -90,8 +122,29 @@ 200*200 - - + + + + + + + + + + + + + + + + + + @@ -100,8 +153,29 @@ 200*200 - - + + + + + + + + + + + + + + + + + + @@ -118,12 +192,21 @@ 300*300 - > - - - - - + + + + + + + + + + + + + + + @@ -133,13 +216,29 @@ 300*150 - - + + + + + + + + + + + + + + + + + @@ -149,12 +248,29 @@ 300*150 - + + + + + + + + + + + + + + + + + + @@ -171,13 +287,28 @@ 200*200 - - + + + + + + + + + + + + + + + + @@ -186,13 +317,28 @@ 400*200 - + + + + + + + + + + + + + + + + @@ -204,13 +350,28 @@ 400*200 - - - + + + + + + + + + + + + + + + + @@ -219,13 +380,28 @@ 200*200 - + + + + + + + + + + + + + + + + @@ -241,13 +417,28 @@ 300*150 - + + + + + + + + + + + + + + + + @@ -257,12 +448,27 @@ 300*300 - + + + + + + + + + + + + + + + + @@ -275,13 +481,28 @@ 300*300 - - + + + + + + + + + + + + + + + + @@ -290,13 +511,28 @@ 300*150 - + + + + + + + + + + + + + + + + @@ -314,13 +550,28 @@ 200*200 - - + + + + + + + + + + + + + + + + @@ -329,13 +580,28 @@ 200*200 - + + + + + + + + + + + + + + + + @@ -347,13 +613,29 @@ 200*200 - + + + + + + + + + + + + + + + + + @@ -363,13 +645,22 @@ 200*200 - - - + + + + + + + + + + + + + + + - - - @@ -382,13 +673,21 @@ 200*420 - - - - - - - + + + + + + + + + + + + + + + @@ -401,34 +700,36 @@ - - - + + - - - - {{item.title}} - - + + + + + {{item.title}} + + + - - - + + + + {{item.title}} - - - + + + + + + + + {{item.title}} + + + + - - - - - + \ No newline at end of file diff --git a/components/diy_nav/diy_nav.wxml b/components/diy_nav/diy_nav.wxml index 47c11d1..4ab5090 100644 --- a/components/diy_nav/diy_nav.wxml +++ b/components/diy_nav/diy_nav.wxml @@ -3,13 +3,21 @@ - - - - - - + + + + + + + + + + + + + + + @@ -18,14 +26,21 @@ - - - - - - + + + + + + + + + + + + + + + - - + \ No newline at end of file diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml index e46b4cc..3dabf3e 100644 --- a/components/diy_picMax/diy_picMax.wxml +++ b/components/diy_picMax/diy_picMax.wxml @@ -35,7 +35,6 @@ - diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index e4d7082..e2e2a41 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -173,7 +173,7 @@ Page({ is_no_by: {}, is_by: {}, send_gf: {}, - send_lb:{}, + send_lb: {}, }) }, @@ -453,7 +453,7 @@ Page({ //要把优惠活动加入,prom_goods_map中,赠品不要运算 if (item1.prom_type == 3 && item1.is_gift != 1) { - th.check_is_youhui(item1.goods_id, item1.pick_id); + // th.check_is_youhui(item1.goods_id, item1.pick_id); await th.add_prom_goods_map(item1); } @@ -916,7 +916,7 @@ Page({ t.data.data.prom_id = gg.prom_id; t.data.data.prom_type = 3; //如果是优惠活动,就要调用活动,计算价格 - th.check_is_youhui(gg.goods_id,gg.pick_id); + // th.check_is_youhui(gg.goods_id, gg.pick_id); th.buy_now_prom_goods(gg.prom_id, t.data.data, function (data) { //判断一下购买商品的数量是不是超过 if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode) == 0)) { @@ -1213,7 +1213,8 @@ Page({ item_map.s_intValue = get_data.intValue; item_map.s_coupon_id = get_data.coupon_id; item_map.s_coupon_num = get_data.coupon_num; - + item_map.lbtitle = get_data.lbtitle; + item_map.zxlbtitle = get_data.zxlbtitle; if (get_data.gift_id && parseInt(get_data.zp_mode) != 1 && get_data.zp_num * item_map.bs <= get_data.limit_num @@ -1364,22 +1365,22 @@ Page({ if (item_map.s_libao) { if (!cart_item.s_libao) { cart_item.s_libao = item_map.s_libao + ""; - cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num }]; + cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num, 'lbtitle': item_map.lbtitle }]; } else { cart_item.s_libao += "," + item_map.s_libao; - cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num }) + cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num, 'lbtitle': item_map.lbtitle }) } } if (item_map.zx_libao) { if (!cart_item.zx_libao) { cart_item.zx_libao = item_map.zx_libao + ""; - cart_item.g_zxlb_num = [{ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num }]; + cart_item.g_zxlb_num = [{ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num, 'zxlbtitle': item_map.zxlbtitle }]; } else { cart_item.zx_libao += "," + item_map.zx_libao; - cart_item.g_zxlb_num.push({ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num }) + cart_item.g_zxlb_num.push({ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num, 'zxlbtitle': item_map.zxlbtitle }) } } } @@ -1390,7 +1391,7 @@ Page({ var arr = Object.keys(send_gf); var arr2 = Object.keys(th.data.send_gf); if (arr2.length > 0) return false; - + th.calclate_lbNum(c_arr); if (arr.length > 0) { th.setData({ send_gf: send_gf }) } else { @@ -1398,6 +1399,60 @@ Page({ } }, + calclate_lbNum(r_data) { + let send_lb = this.data.send_lb; + //g_lb_num我的礼包 g_zxlb_num专享礼包 + r_data.forEach(r_d => { + let arr = []; + if (r_d.g_zxlb_num.length > 0) { + let g_lb = r_d.g_zxlb_num; + for (let i = 0; i < g_lb.length; i++) { + let item = g_lb[i]; + let new_lb = g_lb.filter(lb => { + return item.l_id === lb.l_id; + }); + if (new_lb.length == 1) { + arr.push(item); + } else { + item.num = new_lb.reduce((pre, next) => { + return pre + next.num; + }, 0); + arr.push(item); + g_lb = g_lb.filter(ii => { + return ii.l_id !== item.l_id; + }); + } + send_lb[r_d.pickup_id] = arr; + } + } + if (r_d.g_lb_num.length > 0) { + let zx_lb = r_d.g_lb_num; + for (let i = 0; i < zx_lb.length; i++) { + let item = zx_lb[i]; + item.flag = 1; + let new_lb = zx_lb.filter(lb => { + return item.l_id === lb.l_id; + }); + if (new_lb.length == 1) { + arr.push(item); + } else { + item.num = new_lb.reduce((pre, next) => { + return pre + next.num; + }, 0); + arr.push(item); + zx_lb = zx_lb.filter(ii => { + return ii.l_id !== item.l_id; + }); + } + send_lb[r_d.pickup_id] = arr; + } + } + }) + this.setData({ + send_lb, + }) + + }, //-------------------计算订单价格------------------- calculatePrice: function (t, s) { @@ -4099,7 +4154,8 @@ Page({ } arr.s_libao = get_data.libao; arr.s_lb_num = get_data.lb_num; - + arr.lbtitle = get_data.lbtitle; + arr.zxlbtitle = get_data.zxlbtitle; arr.zx_libao = get_data.zxlibao; arr.zx_lb_num = get_data.zxlb_num; @@ -4195,7 +4251,6 @@ Page({ ob.is_xz_yh = prom.is_xz_yh; ob.goods = new Array(); ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num }); - var obj = {}; obj[item.prom_id] = ob; map[pickid] = obj; @@ -4203,87 +4258,78 @@ Page({ } }, //---检查有没有优惠活动--- - check_is_youhui: function (gid, pick_id) { - let th = this; - let user_id = getApp().globalData.user_id; - let send_lb = th.data.send_lb; - if (!user_id) user_id = 0; - //调用接口判断订单优惠, - getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + gid + "/0" + "/" + user_id, { - success: function (res) { - if (res.data.code == 0 && res.data.data) { - let r_data = res.data.data.promGoodsLists.filter(lb => { - return lb.lb_id ?? lb.zxlb_id; - }); - r_data.forEach(item => { - if (send_lb[pick_id]) { - for (let i = 0; i < send_lb[pick_id].length; i++) { - let sends = send_lb[pick_id][i]; + check_is_youhui: function (r_data, pick_id) { + let send_lb = this.data.send_lb; + let lodash = null; + r_data.forEach(item => { + if (send_lb[pick_id]) { + for (let i = 0; i < send_lb[pick_id].length; i++) { + let sends = send_lb[pick_id][i]; + if (item.lb_id) { + if (sends.id === item.lb_id) { + sends['num']++; + } else { + let send_arr1 = send_lb[pick_id].filter(ii => ii.id === item.lb_id); + if (send_arr1.length == 0) { if (item.lb_id) { - if (sends.id === item.lb_id) { - sends['num']++; - } else { - let send_arr1 = send_lb[pick_id].filter(ii=>ii.id === item.lb_id); - if (send_arr1.length == 0) { - if (item.lb_id) { - let ob = {}; - ob.num = 1; - ob.title = item.lbtitle; - ob.id = item.lb_id; - send_lb[pick_id].push(ob); - break; - } - } - - } - } - if (item.zxlb_id) { - if (sends.id === item.zxlb_id) { - sends['num']++; - } else { - let send_arr = send_lb[pick_id].filter(ii=>ii.id === item.zxlb_id); - if (send_arr.length == 0) { - if (item.zxlb_id) { - let ob = {}; - ob.num = 1; - ob.flag = 1; - ob.title = item.zxlbtitle; - ob.id = item.zxlb_id; - send_lb[pick_id].push(ob); - break; - } - } - } + let ob = {}; + ob.num = 1; + ob.title = item.lbtitle; + ob.id = item.lb_id; + lodash.push(ob); + // break; } } + } + } + if (item.zxlb_id) { + if (sends.id === item.zxlb_id) { + sends['num']++; } else { - let arr = new Array(); - if (item.lb_id) { - let ob = {}; - ob.num = 1; - ob.title = item.lbtitle; - ob.id = item.lb_id; - arr.push(ob); - } - if (item.zxlb_id) { - let ob = {}; - ob.num = 1; - ob.flag = 1; - ob.title = item.zxlbtitle; - ob.id = item.zxlb_id; - arr.push(ob); + let send_arr = send_lb[pick_id].filter(ii => ii.id === item.zxlb_id); + if (send_arr.length == 0) { + if (item.zxlb_id) { + let ob = {}; + ob.num = 1; + ob.flag = 1; + ob.title = item.zxlbtitle; + ob.id = item.zxlb_id; + lodash.push(ob); + // break; + } } - send_lb[pick_id] = arr; } - }) - th.setData({ - send_lb, - }) + } + } + } else { + let arr = new Array(); + if (item.lb_id) { + let ob = {}; + ob.num = 1; + ob.title = item.lbtitle; + ob.id = item.lb_id; + arr.push(ob); + } + if (item.zxlb_id) { + let ob = {}; + ob.num = 1; + ob.flag = 1; + ob.title = item.zxlbtitle; + ob.id = item.zxlb_id; + arr.push(ob); } + send_lb[pick_id] = arr; + lodash = JSON.parse(JSON.stringify(send_lb[pick_id])); } }) + send_lb[pick_id] = lodash; + th.setData({ + send_lb, + }) + + }, //计算立即购买赠品的物流费用 diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml index 9526ed4..d80a6ae 100644 --- a/pages/cart/cart2/cart2.wxml +++ b/pages/cart/cart2/cart2.wxml @@ -182,7 +182,7 @@ - {{send.title}} + {{send.zxlbtitle?send.zxlbtitle:send.lbtitle}} @@ -359,18 +359,28 @@ - - - + + - {{send.title}} + {{bn_goods.lbtitle}} - x{{send.num}} + x{{bn_goods.s_lb_num}} + + + + + + + + {{bn_goods.zxlbtitle}} + + + + x{{bn_goods.zx_lb_num}} - diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml index 6c467ff..57948bd 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxml +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml @@ -1,3 +1,4 @@ + @@ -20,7 +21,7 @@ 我的礼包 - + @@ -48,8 +49,11 @@ {{"零售价:¥"+items.giftPosPrice}} - - {{"活动结束时间:"+items.endTime}} + + {{"活动开始时间:"+items.starTime}} + + + {{"活动结束时间:"+items.endTime}} @@ -57,7 +61,7 @@ {{"已售:"+items.giftQty+"件"}} - + @@ -91,8 +95,8 @@ - - 活动还未开始 + + diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs index 99a224d..855ef50 100644 --- a/pages/user/index/filter.wxs +++ b/pages/user/index/filter.wxs @@ -8,7 +8,7 @@ var is_close = function (name,c_list) { map['我的权益']="5"; map['联系客服']="6"; map['收藏夹']="7"; - map['附近门店']="8"; + map['我的地址']="8"; map['收入卡包']="9"; map['专享礼包']="10"; map['我的服务']="12"; @@ -19,6 +19,7 @@ var is_close = function (name,c_list) { map['幸运大转盘']="17"; map['幸运购']="18"; map['AI测肤']="20"; + map['附近门店']="21"; var index=map[name]; //我的权益要判断5,和11