From d18113ee6edffd21734db166f5817d7613a62fe2 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Wed, 2 Oct 2019 12:35:28 +0800 Subject: [PATCH] 商品详情分享功能 --- pages/goods/goodsInfo/goodsInfo.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index cad449e..ff845c4 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -220,7 +220,6 @@ Page({ ee.setData({ gid: gid }); -t getApp().getConfig2(function (e) { if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); } @@ -447,6 +446,7 @@ t t.data.data.original_img = o.imghost + t.data.data.original_img; if(t.data.data.goods_content==null) t.data.data.goods_content=""; + //-----商品详情--- a.wxParse("content", "html", t.data.data.goods_content, ee, 6); e.wxParseAddFullImageUrl(ee, "content"); @@ -997,8 +997,28 @@ t openPromModal: !0 }); }, + + //--点击分享事件--- onShareAppMessage: function(t) { - return o.share; + var th = this; + var price = th.data.data.shop_price; + if (th.data.prom_act) { + price = th.data.prom_act.price; + + } + var title= th.data.data.goods_name; + var img=th.data.data.original_img; + if(th.data.prom_type==6){ + title=th.data.prom_act.share_title; + img=th.data.iurl+th.data.prom_act.share_imgurl; + } + + return { + title: price + "元 " +title, + path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, + imageUrl: img, + } + }, //-----图片失败,默认图片----- -- libgit2 0.21.4