Commit b59a2af0e07cccba156b19f389d3f97461672cf0

Authored by 前端开发-罗建龙
1 parent cf46c521

oa商品分组分享图片

pages/goods/goodsList/goodsList.js
@@ -43,10 +43,16 @@ Page({ @@ -43,10 +43,16 @@ Page({
43 fil_price_state:0, 43 fil_price_state:0,
44 limit_num:0, 44 limit_num:0,
45 gr_fir:0, //分组第一次 45 gr_fir:0, //分组第一次
  46 + share_imgurl:'', //分享图片
46 }, 47 },
47 48
48 onLoad: function(t) { 49 onLoad: function(t) {
  50 + //----------商品分组自定义分享图片----------
  51 + if (t.gid) {
  52 + this.get_share_imgurl(t.gid) //获取分享图片
  53 + }
49 54
  55 + //---------------------end------------
50 this.data.rq_data=t; 56 this.data.rq_data=t;
51 57
52 //接受有没有导购的参数 58 //接受有没有导购的参数
@@ -241,6 +247,18 @@ Page({ @@ -241,6 +247,18 @@ Page({
241 onShow:function () { 247 onShow:function () {
242 getApp().check_can_share(); 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 async getprom(prom_id){ 263 async getprom(prom_id){
246 await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { 264 await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => {
@@ -487,9 +505,11 @@ Page({ @@ -487,9 +505,11 @@ Page({
487 } 505 }
488 } 506 }
489 console.log("11-11"+pagePath); 507 console.log("11-11"+pagePath);
  508 + let share_imgurl=this.data.iurl + this.data.share_imgurl
490 return { 509 return {
491 title: "商品列表", 510 title: "商品列表",
492 path:pagePath, 511 path:pagePath,
  512 + imageUrl:share_imgurl
493 } 513 }
494 }, 514 },
495 //---图片失败,默认图片--- 515 //---图片失败,默认图片---