Commit 4cf6b028 authored by beisir's avatar beisir

fix:优化fitstShare

parent be0602e7
...@@ -376,9 +376,7 @@ export function paramsParentheses(pointer) { ...@@ -376,9 +376,7 @@ export function paramsParentheses(pointer) {
} }
export function firstGroupShare(shareInfo, type) { export function firstGroupShare(shareInfo, type) {
if (!isWxMp) { if (!isWxMp) return;
return;
}
const nativeBridge = new MpBridge(); const nativeBridge = new MpBridge();
if (!shareInfo) { if (!shareInfo) {
nativeBridge.run({ nativeBridge.run({
...@@ -394,6 +392,7 @@ export function firstGroupShare(shareInfo, type) { ...@@ -394,6 +392,7 @@ export function firstGroupShare(shareInfo, type) {
return; return;
} }
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const vccTokenString = `vccToken=${encodeURIComponent('{token}')}`;
let linkPath = ''; let linkPath = '';
let detailData = { let detailData = {
skuNo: shareInfo.skuNo, skuNo: shareInfo.skuNo,
...@@ -405,18 +404,14 @@ export function firstGroupShare(shareInfo, type) { ...@@ -405,18 +404,14 @@ export function firstGroupShare(shareInfo, type) {
}; };
switch (type) { switch (type) {
case 0: case 0:
linkPath = `${config.localHost}/groupBuy/list?activityId=${ linkPath = `${config.localHost}/groupBuy/list?activityId=${shareInfo.activityId}&${vccTokenString}`;
shareInfo.activityId
}&vccToken=${encodeURIComponent('{token}')}`;
break; break;
case 1: case 1:
linkPath = `${config.localHost}/orderList/0?&vccToken=${encodeURIComponent('{token}')}`; linkPath = `${config.localHost}/orderList/0?${vccTokenString}`;
break; break;
case 2: case 2:
case 3: case 3:
if (shareInfo.groupBuyGroupId) { shareInfo.groupBuyGroupId && (detailData.groupBuyGroupId = shareInfo.groupBuyGroupId);
detailData.groupBuyGroupId = shareInfo.groupBuyGroupId;
}
linkPath = qs.stringify(detailData); linkPath = qs.stringify(detailData);
linkPath = `${config.localHost}/groupBuy/skuInfo?${linkPath}`; linkPath = `${config.localHost}/groupBuy/skuInfo?${linkPath}`;
break; break;
...@@ -425,15 +420,14 @@ export function firstGroupShare(shareInfo, type) { ...@@ -425,15 +420,14 @@ export function firstGroupShare(shareInfo, type) {
JSON.stringify(linkPath) JSON.stringify(linkPath)
)}`; )}`;
const tagName = type ? '[0元购] ' : ''; const tagName = type ? '[0元购] ' : '';
let shareDic = {
title: `${tagName}${shareInfo.skuName}`,
link: shareInfo.linkPath, // 页面地址
imgUrl: shareInfo.skuImg // 图片地
};
nativeBridge.run({ nativeBridge.run({
event: 'showShareView', event: 'showShareView',
data: { data: {
shareDic shareDic: {
title: `${tagName}${shareInfo.skuName}`,
link: shareInfo.linkPath, // 页面地址
imgUrl: shareInfo.skuImg // 图片地
}
} }
}); });
} }
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