diff --git a/src/api/ebiz/proposal/proposal.js b/src/api/ebiz/proposal/proposal.js index 38d75b23a..112e5cc80 100644 --- a/src/api/ebiz/proposal/proposal.js +++ b/src/api/ebiz/proposal/proposal.js @@ -82,3 +82,12 @@ export function share(data = {}) { data }) } + +// 分享建议书获取token +export function getSharingToken(data = {}) { + return request({ + url: getUrl('/customer/account/getShareParam', 1), + method: 'post', + data + }) +} diff --git a/src/views/ebiz/proposal/ProposalInfo.vue b/src/views/ebiz/proposal/ProposalInfo.vue index 108ba5e18..6b2691954 100644 --- a/src/views/ebiz/proposal/ProposalInfo.vue +++ b/src/views/ebiz/proposal/ProposalInfo.vue @@ -291,15 +291,13 @@ import { Button } from 'vant' import SelectRadio from '@/components/ebiz/SelectRadio' -import { getDemo, toInsurance, getDemoByProposalNo, share } from '@/api/ebiz/proposal/proposal.js' +import { getDemo, toInsurance, getDemoByProposalNo, share, getSharingToken } from '@/api/ebiz/proposal/proposal.js' import { haveTap, getTapIndex, relevanceByInsure } from './js/exhibitionMethod.js' import { formatRiskList } from '@/assets/js/utils/formatRiskList.js' import { weixinShare } from '@/assets/js/utils/wxShare.js' import { getAgentInfo } from '@/api/ebiz/my/my.js' import getAge from '@/assets/js/utils/age.js' -import filters from '@/filters' import dataDictionary from '@/assets/js/utils/data-dictionary' -import Layout from '../../app/layout/Layout' //使用数据字典中的险种类型 import riskRules from '../common/risk-rules.js' export default { data() { @@ -507,20 +505,24 @@ export default { } }, //app回调 - appCallBack(data) { + async appCallBack(data) { if (data.trigger == 'right_button_click') { - // eslint-disable-next-line no-undef - EWebBridge.webCallAppInJs('bridge', { - flag: 'share', - extra: { - title: this.wxTitle, - content: '国富为您量身定制的保险产品,请查收', - url: location.origin + '/#/proposal/proposalInfo?proposalNo=' + encodeURI(localStorage.orderNo) + '&token=' + encodeURI(localStorage.token), - // url: 'http://47.96.143.111/#/proposal/proposalInfo?proposalNo=' + localStorage.orderNo + '&token=' + localStorage.token, - img: this.$assetsUrl + 'images/logo.png' - } - }) - share() + let res = await getSharingToken({}) + if (res.result == '0') { + // eslint-disable-next-line no-undef + EWebBridge.webCallAppInJs('bridge', { + flag: 'share', + extra: { + title: this.wxTitle, + content: '国富为您量身定制的保险产品,请查收', + url: location.origin + '/#/proposal/proposalInfo?proposalNo=' + encodeURI(localStorage.orderNo) + '&token=' + encodeURI(res.content), + img: this.$assetsUrl + 'images/logo.png' + } + }) + share() + } else { + return this.$toast(res.resultMessage) + } } if (data.trigger == 'left_button_click') { this.$jump({ @@ -797,7 +799,6 @@ export default { } }, components: { - Layout, [Field.name]: Field, [Popup.name]: Popup, [Picker.name]: Picker,