Commit 8535910a authored by beisir's avatar beisir

feat:update share

parent f67492df
......@@ -211,13 +211,13 @@ export default {
},
async getShareData() {
const { title, sharePosterTemplateUrl, img } = this.goodsTemp;
const { sharePosterTemplateUrl, shareTitle, shareSubTitle, shareIconUrl } = this.goodsTemp;
const link = window.location.href;
return Promise.resolve({
title,
desc: '我正在免费拿商品,请你帮帮我',
title: shareTitle,
desc: shareSubTitle,
link: `pages/webview/webview?url=${link}/`, // 页面地址
imgUrl: img, // 图片地
imgUrl: shareIconUrl, // 图片地
posterUrl: sharePosterTemplateUrl
});
},
......
......@@ -81,7 +81,6 @@ export default {
this.getstatusQuery();
this.getList();
this.onShareEventChange();
// this.$track.registeredEvents('H5_2B_MyOrderPageExposure');
},
methods: {
async getShareData(shareInfo) {
......@@ -96,7 +95,7 @@ export default {
});
return Promise.resolve({
title: shareInfo.skuName,
link: `pages/webview/webview?url=${window.location.origin}?url=${encodeURIComponent(
link: `pages/webview/webview?url=${window.location.origin}/${encodeURIComponent(
JSON.stringify(linkPath)
)}`, // 页面地址
imgUrl: shareInfo.skuImg // 图片地
......@@ -106,7 +105,8 @@ export default {
const vm = this;
console.log('update');
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
console.log(ev);
const [res] = await groupBuyApi.getGroupShareInfo('1440884214932389888');
const shareDic = await vm.getShareData(res);
if (ev === 'pic') {
// 分享海报跳转小程序海报分享页面
// nativeBridge.openNewUrl({
......@@ -116,10 +116,7 @@ export default {
// });
}
if (ev === 'weixin') {
console.log('监听事件');
// const res = await groupBuyApi.getGroupShareInfo(this.shareInfo.order);
const [res] = await groupBuyApi.getGroupShareInfo('1440884214932389888');
const shareDic = await vm.getShareData(res);
// 分享朋友派发微信postMessage事件
nativeBridge.run({
event: 'showShareView',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment