From b5ad6d910ad576d28e437230b0304f08e30f8b6c Mon Sep 17 00:00:00 2001 From: "bai.jinyan" Date: Fri, 17 Sep 2021 14:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=B5=B7=E6=8A=A5=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=97=B6=E6=95=88=E9=97=AE=E9=A2=98=E3=80=91?= =?UTF-8?q?-=E5=A4=84=E7=90=86=E4=BA=8C=E7=BB=B4=E7=A0=81=E4=B8=BA?= =?UTF-8?q?=E9=87=91=E6=8E=8C=E6=A1=82=E9=A1=B5=E9=9D=A2=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=20=20--=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E7=99=BD=E9=87=91?= =?UTF-8?q?=E5=B2=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/ebiz/poster.js | 10 +++ src/views/ebiz/poster/PosterLoading.vue | 84 +++++++++++++++++++++++++ src/views/ebiz/poster/PosterPreview.vue | 49 +++++++++++---- 3 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 src/views/ebiz/poster/PosterLoading.vue diff --git a/src/router/ebiz/poster.js b/src/router/ebiz/poster.js index 2f0e4d953..28febb291 100644 --- a/src/router/ebiz/poster.js +++ b/src/router/ebiz/poster.js @@ -1,6 +1,7 @@ //保全 定义相关组件 const posterList = () => import('@/views/ebiz/poster/PosterList') const posterPreview = () => import('@/views/ebiz/poster/PosterPreview') +const posterLoading = () => import('@/views/ebiz/poster/PosterLoading') export default [ { @@ -20,5 +21,14 @@ export default [ title: '海报预览', index: 2 } + }, + { + path: '/poster/posterLoading', + name: 'posterLoading', + component: posterLoading, + meta: { + title: '跳转链接', + index: 2 + } } ] diff --git a/src/views/ebiz/poster/PosterLoading.vue b/src/views/ebiz/poster/PosterLoading.vue new file mode 100644 index 000000000..13315b21b --- /dev/null +++ b/src/views/ebiz/poster/PosterLoading.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/ebiz/poster/PosterPreview.vue b/src/views/ebiz/poster/PosterPreview.vue index 4b2176c21..e4ee736c8 100644 --- a/src/views/ebiz/poster/PosterPreview.vue +++ b/src/views/ebiz/poster/PosterPreview.vue @@ -29,6 +29,8 @@ import { getPosterInfo, shareUrl, shareUrlWithQR } from '@/api/ebiz/poster/poster' import { getAgentInfo } from '@/api/ebiz/my/my' import config from '@/config' +import { getShareParam } from '@/api/ebiz/cardList/cardList.js' +import { saveShareRecord } from '@/api/ebiz/manpower/manpower' export default { name: 'posterPreview', data() { @@ -51,7 +53,8 @@ export default { schoolName:"", className:"", isShareLimit:'', - shareLimitDesc:'' + shareLimitDesc:'', + redisKey:'' } }, async created() { @@ -65,22 +68,38 @@ export default { await this.getShareImg() }, methods: { - shareFriends() { + async shareFriends() { if(this.isShareLimit=='1'){ this.$toast(this.shareLimitDesc) }else{ - console.log('分享图片url'); - console.log(this.imgUrl); - // eslint-disable-next-line no-undef - EWebBridge.webCallAppInJs('bridge', { - flag: 'share', - extra: { - shareType: '1', - img: this.imgUrl + if (this.posterType == 'product') { + let linkType = 'poster_'+this.id+'_'+this.posterInfo.posterName + await this.saveShareRecord('0',this.redisKey,linkType) } - }) + // eslint-disable-next-line no-undef + EWebBridge.webCallAppInJs('bridge', { + flag: 'share', + extra: { + shareType: '1', + img: this.imgUrl + } + }) } }, + /** + * 保存产品海报分享记录 + * flag 0-分享 1-打开 + * key redisKey + * linkType 'poster_'+海报id+海报名称 + */ + saveShareRecord(flag,key,linkType) { + let data = { + linkType: linkType, + flag: flag, + redisKey: key + } + saveShareRecord(data) + }, async getPosterDetail() { return new Promise((resolve, reject) => { this.$toast.loading({ @@ -133,6 +152,12 @@ export default { }, // 获取分享图片 async getShareImg() { + if (this.posterType == 'product') { + let res = await getShareParam({shareType: 'card_poster'}); + if (res.result == '0') { + this.redisKey = res.content + } + } return new Promise((resolve, reject) => { this.$toast.loading({ duration: 0, // 持续展示 toast @@ -152,6 +177,7 @@ export default { } if (this.posterType == 'product') { + params.redisKey = this.redisKey shareUrlWithQR(params).then(res => { window.localStorage.removeItem('schoolName') window.localStorage.removeItem('className') @@ -242,6 +268,7 @@ export default { className:this.className } + params.redisKey = this.redisKey shareUrlWithQR(params).then(res => { this.$toast.clear() if (res.result == 0) {