Commit 8e3d0ff50532a8077eb8c1abb8fbb9203ad35fe8

Authored by yvan.ni
1 parent 05b73c04

分享图片的优化

pages/goods/goodsInfo/goodsInfo.js
@@ -3014,6 +3014,10 @@ Page({ @@ -3014,6 +3014,10 @@ Page({
3014 3014
3015 var title = th.data.sele_g.goods_name; 3015 var title = th.data.sele_g.goods_name;
3016 var img = th.data.sele_g.original_img; 3016 var img = th.data.sele_g.original_img;
  3017 +
  3018 + //用选中的商品来设置分享图
  3019 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl;
  3020 +
3017 if(th.data.new_share_imgurl){ 3021 if(th.data.new_share_imgurl){
3018 img = th.data.iurl + th.data.new_share_imgurl 3022 img = th.data.iurl + th.data.new_share_imgurl
3019 } 3023 }
@@ -3124,11 +3128,13 @@ Page({ @@ -3124,11 +3128,13 @@ Page({
3124 if (e.data.code == 0) arrdata = e.data.data.pageData; 3128 if (e.data.code == 0) arrdata = e.data.data.pageData;
3125 }) 3129 })
3126 if (!arrdata) return false; 3130 if (!arrdata) return false;
3127 - if(arrdata[0]){  
3128 - tt.setData({  
3129 - new_share_imgurl:arrdata[0].share_imgurl  
3130 - })  
3131 - } 3131 +
  3132 + // if(arrdata[0]){
  3133 + // tt.setData({
  3134 + // new_share_imgurl:arrdata[0].share_imgurl
  3135 + // })
  3136 + // }
  3137 +
3132 var arrsku = new Array(); 3138 var arrsku = new Array();
3133 var gitem = null; 3139 var gitem = null;
3134 var gb = 1, 3140 var gb = 1,
@@ -3280,6 +3286,8 @@ Page({ @@ -3280,6 +3286,8 @@ Page({
3280 }) 3286 })
3281 } 3287 }
3282 3288
  3289 + //切换完商品后,海报图片都要跟换
  3290 + this.data.share_goods_img=null;
3283 3291
3284 var gid = e.currentTarget.dataset.gid; 3292 var gid = e.currentTarget.dataset.gid;
3285 var nor = e.currentTarget.dataset.nor; 3293 var nor = e.currentTarget.dataset.nor;
@@ -4229,7 +4237,7 @@ Page({ @@ -4229,7 +4237,7 @@ Page({
4229 } 4237 }
4230 4238
4231 //-- 如果库存为0就要重新赋值 -- 4239 //-- 如果库存为0就要重新赋值 --
4232 - if(n_item.StorageNo ==def_pick_store.pickup_no) { 4240 + if(def_pick_store && n_item.StorageNo ==def_pick_store.pickup_no) {
4233 def_pick_store.CanOutQty= o_plist[kk].CanOutQty; 4241 def_pick_store.CanOutQty= o_plist[kk].CanOutQty;
4234 th.setData({ def_pick_store }) 4242 th.setData({ def_pick_store })
4235 } 4243 }
@@ -6948,10 +6956,14 @@ Page({ @@ -6948,10 +6956,14 @@ Page({
6948 return false; 6956 return false;
6949 } 6957 }
6950 6958
6951 - var img_url = ee.data.data.original_img; 6959 + var img_url = ee.data.sele_g.original_img;
6952 if ((this.data.prom_type == 1 || this.data.prom_type == 6) && this.data.prom_act.share_imgurl) { 6960 if ((this.data.prom_type == 1 || this.data.prom_type == 6) && this.data.prom_act.share_imgurl) {
6953 img_url = this.data.iurl + this.data.prom_act.share_imgurl; 6961 img_url = this.data.iurl + this.data.prom_act.share_imgurl;
6954 } 6962 }
  6963 +
  6964 + //用选中的商品来设置分享图
  6965 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl;
  6966 +
6955 if (this.data.new_share_imgurl) { 6967 if (this.data.new_share_imgurl) {
6956 img_url=this.data.iurl + this.data.new_share_imgurl 6968 img_url=this.data.iurl + this.data.new_share_imgurl
6957 } 6969 }
@@ -8148,9 +8160,14 @@ Page({ @@ -8148,9 +8160,14 @@ Page({
8148 8160
8149 //获取有活动的取活动图片,没有活动的取主图 8161 //获取有活动的取活动图片,没有活动的取主图
8150 var img = th.data.sele_g.original_img; 8162 var img = th.data.sele_g.original_img;
  8163 + //用选中的商品来设置分享图
  8164 + th.data.new_share_imgurl= th.data.sele_g.share_imgurl;
  8165 +
8151 if(th.data.new_share_imgurl){ 8166 if(th.data.new_share_imgurl){
8152 img = th.data.iurl + th.data.new_share_imgurl 8167 img = th.data.iurl + th.data.new_share_imgurl
8153 } 8168 }
  8169 +
  8170 +
8154 if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { 8171 if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) {
8155 // title = th.data.prom_act.share_title; 8172 // title = th.data.prom_act.share_title;
8156 // if (!title) title = th.data.prom_act.title; 8173 // if (!title) title = th.data.prom_act.title;