Commit dd8b87f6 authored by beisir's avatar beisir

feat:修改分享出去的地址链接

parent 2544574c
...@@ -84,7 +84,7 @@ import localStorage from '@/service/localStorage.service'; ...@@ -84,7 +84,7 @@ import localStorage from '@/service/localStorage.service';
import goodsCheckMixin from '@/mixins/goodsCheck.mixin'; import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import { setAppTitleColor } from '@/service/utils.service'; import { setAppTitleColor } from '@/service/utils.service';
import { registeredEvents } from '@/service/sa.service'; import { registeredEvents } from '@/service/sa.service';
import { isNull } from '@/service/validation.service'; import { isNull, isWxMp } from '@/service/validation.service';
import config from '@/config'; import config from '@/config';
let topicIndex; let topicIndex;
export default { export default {
...@@ -195,7 +195,6 @@ export default { ...@@ -195,7 +195,6 @@ export default {
async openShareEvent() { async openShareEvent() {
const activity_id = this.activityId; const activity_id = this.activityId;
const shareInfo = await this.getShareData(); const shareInfo = await this.getShareData();
console.log(shareInfo);
this.$store.dispatch('goods_share_open', shareInfo); this.$store.dispatch('goods_share_open', shareInfo);
registeredEvents('H5_GroupZeroYuanPurchaseActivityPageSharePopupBtnClick', { registeredEvents('H5_GroupZeroYuanPurchaseActivityPageSharePopupBtnClick', {
activity_id activity_id
...@@ -230,11 +229,14 @@ export default { ...@@ -230,11 +229,14 @@ export default {
shareIconUrl, shareIconUrl,
img img
} = this.goodsTemp; } = this.goodsTemp;
const link = `${config.localHost}/groupBuy/list?h=0&activityId=${this.activityId}`; let link = `${config.localHost}/groupBuy/list?h=0&activityId=${this.activityId}`;
if (isWxMp) {
link = `/pages/webview/webview?url=${encodeURIComponent(JSON.stringify(link))}`;
}
return Promise.resolve({ return Promise.resolve({
title: shareTitle, title: shareTitle,
desc: shareSubTitle, desc: shareSubTitle,
link: `pages/webview/webview?url=${encodeURIComponent(JSON.stringify(link))}`, // 页面地址 link, // 页面地址
imgUrl: shareIconUrl || img, // 图片地 imgUrl: shareIconUrl || img, // 图片地
posterUrl: sharePosterTemplateUrl posterUrl: sharePosterTemplateUrl
}); });
...@@ -292,6 +294,8 @@ export default { ...@@ -292,6 +294,8 @@ export default {
} }
}; };
async function computedTemplate(info) { async function computedTemplate(info) {
info.endTime = info.endTime.replace(/-|\./g, '/');
info.startTime = info.startTime.replace(/-|\./g, '/');
const { endTime, startTime } = info; const { endTime, startTime } = info;
info.remainTime = handleRemainTime('', endTime)[0]; info.remainTime = handleRemainTime('', endTime)[0];
info.hasStop = info.remainTime < 1; info.hasStop = info.remainTime < 1;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<span class="Ol__head-count" <span class="Ol__head-count"
>拼团中,差<b class="Ol__head-red">{{ item.needGuys }}</b>成团</span >拼团中,差<b class="Ol__head-red">{{ item.needGuys }}</b>成团</span
> >
<count-down :end-time="+new Date(item.endTime)" /> <count-down :end-time="+new Date(item.endTime.replace(/-|\./g, '/'))" />
</template> </template>
<template v-else> <template v-else>
<span :class="cardInfoMation[item.openGroupStatus].class">{{ <span :class="cardInfoMation[item.openGroupStatus].class">{{
...@@ -109,7 +109,6 @@ export default { ...@@ -109,7 +109,6 @@ export default {
shareInfo: null, shareInfo: null,
nativeBridge: null, nativeBridge: null,
gpCountDown: new Date('2021-09-12 00:00:00').getTime(),
listLoading: false, listLoading: false,
listFinished: false, listFinished: false,
......
...@@ -118,11 +118,14 @@ export default { ...@@ -118,11 +118,14 @@ export default {
templateId: shareInfo.templateId, templateId: shareInfo.templateId,
templateDetailId: shareInfo.templateId templateDetailId: shareInfo.templateId
}); });
const detailUrl = `${config.localHost}/groupBuy/skuInfoSmallPic?h=0&${linkPath}`; let detailUrl = `${config.localHost}/groupBuy/skuInfoSmallPic?h=0&${linkPath}`;
if (isWxMp) {
detailUrl = `/pages/webview/webview?url=${encodeURIComponent(JSON.stringify(detailUrl))}`;
}
return Promise.resolve({ return Promise.resolve({
title: shareInfo.skuName, title: shareInfo.skuName,
desc: '', desc: '',
link: `pages/webview/webview?url=${encodeURIComponent(JSON.stringify(detailUrl))}`, // 页面地址 link: detailUrl, // 页面地址
imgUrl: shareInfo.skuImg, // 图片地 imgUrl: shareInfo.skuImg, // 图片地
posterUrl: shareInfo.posterUrl posterUrl: shareInfo.posterUrl
}); });
......
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