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) {