Commit b59a2af0e07cccba156b19f389d3f97461672cf0
1 parent
cf46c521
oa商品分组分享图片
Showing
1 changed file
with
20 additions
and
0 deletions
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -43,10 +43,16 @@ Page({ |
| 43 | 43 | fil_price_state:0, |
| 44 | 44 | limit_num:0, |
| 45 | 45 | gr_fir:0, //分组第一次 |
| 46 | + share_imgurl:'', //分享图片 | |
| 46 | 47 | }, |
| 47 | 48 | |
| 48 | 49 | onLoad: function(t) { |
| 50 | + //----------商品分组自定义分享图片---------- | |
| 51 | + if (t.gid) { | |
| 52 | + this.get_share_imgurl(t.gid) //获取分享图片 | |
| 53 | + } | |
| 49 | 54 | |
| 55 | + //---------------------end------------ | |
| 50 | 56 | this.data.rq_data=t; |
| 51 | 57 | |
| 52 | 58 | //接受有没有导购的参数 |
| ... | ... | @@ -241,6 +247,18 @@ Page({ |
| 241 | 247 | onShow:function () { |
| 242 | 248 | getApp().check_can_share(); |
| 243 | 249 | }, |
| 250 | + //获取商品分组分享图片 | |
| 251 | + get_share_imgurl(gid){ | |
| 252 | + getApp().request.promiseGet("/api/weshop/goodsGroup/get/" + oo.stoid + "/" + gid, {}).then(res => { | |
| 253 | + if (res.data.code == 0) { | |
| 254 | + let prom = res.data.data; | |
| 255 | + let share_imgurl =prom.share_imgurl | |
| 256 | + this.setData({ | |
| 257 | + share_imgurl | |
| 258 | + }) | |
| 259 | + } | |
| 260 | + }) | |
| 261 | + }, | |
| 244 | 262 | //获取优惠活动 |
| 245 | 263 | async getprom(prom_id){ |
| 246 | 264 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { |
| ... | ... | @@ -487,9 +505,11 @@ Page({ |
| 487 | 505 | } |
| 488 | 506 | } |
| 489 | 507 | console.log("11-11"+pagePath); |
| 508 | + let share_imgurl=this.data.iurl + this.data.share_imgurl | |
| 490 | 509 | return { |
| 491 | 510 | title: "商品列表", |
| 492 | 511 | path:pagePath, |
| 512 | + imageUrl:share_imgurl | |
| 493 | 513 | } |
| 494 | 514 | }, |
| 495 | 515 | //---图片失败,默认图片--- | ... | ... |