Commit 8535910a authored by beisir's avatar beisir

feat:update share

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