diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index fbcf318..1404c9c 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3014,6 +3014,10 @@ Page({ var title = th.data.sele_g.goods_name; var img = th.data.sele_g.original_img; + + //用选中的商品来设置分享图 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl; + if(th.data.new_share_imgurl){ img = th.data.iurl + th.data.new_share_imgurl } @@ -3124,11 +3128,13 @@ Page({ if (e.data.code == 0) arrdata = e.data.data.pageData; }) if (!arrdata) return false; - if(arrdata[0]){ - tt.setData({ - new_share_imgurl:arrdata[0].share_imgurl - }) - } + + // if(arrdata[0]){ + // tt.setData({ + // new_share_imgurl:arrdata[0].share_imgurl + // }) + // } + var arrsku = new Array(); var gitem = null; var gb = 1, @@ -3280,6 +3286,8 @@ Page({ }) } + //切换完商品后,海报图片都要跟换 + this.data.share_goods_img=null; var gid = e.currentTarget.dataset.gid; var nor = e.currentTarget.dataset.nor; @@ -4229,7 +4237,7 @@ Page({ } //-- 如果库存为0就要重新赋值 -- - if(n_item.StorageNo ==def_pick_store.pickup_no) { + if(def_pick_store && n_item.StorageNo ==def_pick_store.pickup_no) { def_pick_store.CanOutQty= o_plist[kk].CanOutQty; th.setData({ def_pick_store }) } @@ -6948,10 +6956,14 @@ Page({ return false; } - var img_url = ee.data.data.original_img; + var img_url = ee.data.sele_g.original_img; if ((this.data.prom_type == 1 || this.data.prom_type == 6) && this.data.prom_act.share_imgurl) { img_url = this.data.iurl + this.data.prom_act.share_imgurl; } + + //用选中的商品来设置分享图 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl; + if (this.data.new_share_imgurl) { img_url=this.data.iurl + this.data.new_share_imgurl } @@ -8148,9 +8160,14 @@ Page({ //获取有活动的取活动图片,没有活动的取主图 var img = th.data.sele_g.original_img; + //用选中的商品来设置分享图 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl; + if(th.data.new_share_imgurl){ img = th.data.iurl + th.data.new_share_imgurl } + + if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { // title = th.data.prom_act.share_title; // if (!title) title = th.data.prom_act.title;