Commit f23e97dd9e4f11432db4a6f963f2e3d514d2c5c3

Authored by yvan.ni
1 parent 3780c5ca

活动链接跳转的优化

packageB/pages/zuhegou/index/index.js
@@ -2782,7 +2782,12 @@ Page({ @@ -2782,7 +2782,12 @@ Page({
2782 }, 2782 },
2783 2783
2784 go_cart: function () { 2784 go_cart: function () {
2785 - getApp().goto("/pages/cart/cart/cart"); 2785 + //-- 组合购选中的跳转链接 --
  2786 + getApp().globalData.from_act_link={
  2787 + prom_type:7,
  2788 + prom_id:this.data.act.id
  2789 + }
  2790 + getApp().goto("/pages/cart/cart/cart");
2786 }, 2791 },
2787 2792
2788 //获取购物车中,相应的门店已购买的商品 2793 //获取购物车中,相应的门店已购买的商品
pages/cart/cart/cart.js
@@ -126,6 +126,11 @@ Page({ @@ -126,6 +126,11 @@ Page({
126 }, 126 },
127 onShow: function () { 127 onShow: function () {
128 128
  129 + if(getApp().globalData.from_act_link){
  130 + this.data.from_act_link= ut.deep_cp(getApp().globalData.from_act_link);
  131 + getApp().globalData.from_act_link=null;
  132 + }
  133 +
129 //-- 看一下隐私政策要不要显示 -- 134 //-- 看一下隐私政策要不要显示 --
130 var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id 135 var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
131 if (privacy_pop) { 136 if (privacy_pop) {
@@ -923,7 +928,7 @@ Page({ @@ -923,7 +928,7 @@ Page({
923 }), 928 }),
924 th.doCheckAll(), wx.stopPullDownRefresh(); 929 th.doCheckAll(), wx.stopPullDownRefresh();
925 930
926 - wx.hideLoading(); 931 + wx.hideLoading();
927 932
928 } 933 }
929 }); 934 });
@@ -2445,7 +2450,7 @@ Page({ @@ -2445,7 +2450,7 @@ Page({
2445 if (item[c].prom_type == 7) { 2450 if (item[c].prom_type == 7) {
2446 item[c].act = th.data.zuhe_map[item[c].prom_id]; 2451 item[c].act = th.data.zuhe_map[item[c].prom_id];
2447 if(item[c].zh_b_num===undefined || item[c].zh_b_num===null ){ 2452 if(item[c].zh_b_num===undefined || item[c].zh_b_num===null ){
2448 - var prom_goodsbuynum = 0; 2453 + var prom_goodsbuynum = 0;
2449 //--要获得商品,该用户买了多少件,同步应用,用于限购的计算-- 2454 //--要获得商品,该用户买了多少件,同步应用,用于限购的计算--
2450 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { 2455 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
2451 data: { 2456 data: {
@@ -2460,7 +2465,7 @@ Page({ @@ -2460,7 +2465,7 @@ Page({
2460 if(res.data.code==0 && res.data.data) 2465 if(res.data.code==0 && res.data.data)
2461 2466
2462 if (res.data.data.promgoodsbuynum) { 2467 if (res.data.data.promgoodsbuynum) {
2463 - promgoodsbuynum = res.data.data.promgoodsbuynum; 2468 + prom_goodsbuynum = res.data.data.promgoodsbuynum;
2464 } 2469 }
2465 2470
2466 }) 2471 })
utils/more_cx.js
@@ -718,6 +718,24 @@ module.exports = { @@ -718,6 +718,24 @@ module.exports = {
718 //活动要排序一下 718 //活动要排序一下
719 k_item.act_arr.sort(comp); 719 k_item.act_arr.sort(comp);
720 720
  721 + //-- 看一下是不是组合购 -- 点击 --如果是从活动链接过来的,点亮 --,新增优化2024-1-20
  722 + if(th.data.from_act_link){
  723 + var fd_idx=k_item.act_arr.findIndex(function (eh){
  724 + return eh.prom_type==th.data.from_act_link.prom_type && eh.prom_id==th.data.from_act_link.prom_id;
  725 + })
  726 +
  727 + if(fd_idx>-1) {
  728 + ck_prom_type= k_item.act_arr[fd_idx];
  729 + for (var idf = 0; idf < k_item.act_arr.length; idf++) {
  730 + if(fd_idx==idf){
  731 + k_item.act_arr[idf].sele=1;
  732 + }else{
  733 + k_item.act_arr[idf].sele=0;
  734 + }
  735 + }
  736 + }
  737 + }
  738 +
721 //确定一下活动,先看一下有没有选择的活动 739 //确定一下活动,先看一下有没有选择的活动
722 ck_prom_type=k_item.act_arr.find(function (el){ 740 ck_prom_type=k_item.act_arr.find(function (el){
723 return el.sele; 741 return el.sele;