From b59a2af0e07cccba156b19f389d3f97461672cf0 Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Thu, 10 Aug 2023 16:49:27 +0800 Subject: [PATCH] oa商品分组分享图片 --- pages/goods/goodsList/goodsList.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 0 deletions(-) diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 765e2e7..225beed 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -43,10 +43,16 @@ Page({ fil_price_state:0, limit_num:0, gr_fir:0, //分组第一次 + share_imgurl:'', //分享图片 }, onLoad: function(t) { + //----------商品分组自定义分享图片---------- + if (t.gid) { + this.get_share_imgurl(t.gid) //获取分享图片 + } + //---------------------end------------ this.data.rq_data=t; //接受有没有导购的参数 @@ -241,6 +247,18 @@ Page({ onShow:function () { getApp().check_can_share(); }, + //获取商品分组分享图片 + get_share_imgurl(gid){ + getApp().request.promiseGet("/api/weshop/goodsGroup/get/" + oo.stoid + "/" + gid, {}).then(res => { + if (res.data.code == 0) { + let prom = res.data.data; + let share_imgurl =prom.share_imgurl + this.setData({ + share_imgurl + }) + } + }) + }, //获取优惠活动 async getprom(prom_id){ await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { @@ -487,9 +505,11 @@ Page({ } } console.log("11-11"+pagePath); + let share_imgurl=this.data.iurl + this.data.share_imgurl return { title: "商品列表", path:pagePath, + imageUrl:share_imgurl } }, //---图片失败,默认图片--- -- libgit2 0.21.4