Commit e1e61b183b9b98c7c6571b6b1fc34610d70e3bfa

Authored by yvan.ni
1 parent bb42c4e8

~~组合购,再购物车选中去凑单的时候,跳转活动页面的时候,商品要自动选中

packageB/pages/zuhegou/index/index.js
... ... @@ -2868,19 +2868,30 @@ Page({
2868 2868 store_id: os.stoid,
2869 2869 pageSize: 600,
2870 2870 state: 0,
2871   - prom_type: 7,
2872   - prom_id: this.data.act.id
2873 2871 };
2874 2872 //获取购物车列表
2875 2873 getApp().request.get("/api/weshop/cart/list", {
2876 2874 data: req,
2877 2875 success: async function (e) {
2878 2876 if (ut.ajax_ok(e)) {
  2877 + var mlist=e.data.data.pageData.filter(function (e){
  2878 + return e.zh_prom_id==th.data.act.id || (e.prom_type==7 && e.prom_id==th.data.act.id)
  2879 + })
  2880 +
  2881 + if(!mlist || mlist.length==0){
  2882 + return false;
  2883 + }
2879 2884 var map = {};
2880   - var mlist = e.data.data.pageData;
  2885 + //var mlist = e.data.data.pageData;
2881 2886 th.data.cart_list = mlist;
2882 2887 for (let i in mlist) {
2883 2888 let item = mlist[i];
  2889 +
  2890 + if(item.zh_prom_id && item.prom_type==0 ){
  2891 + item.prom_type=7;
  2892 + item.prom_id=th.data.act.id
  2893 + }
  2894 +
2884 2895 if (item.prom_type != 7) continue;
2885 2896 if (item.prom_id != th.data.act.id) continue;
2886 2897 if (th.data.def_pick_store && th.data.def_pick_store.pickup_id) {
... ...