+
{{ demoLabel.contentLabel }}
{{ demoLabel.value }}
@@ -215,24 +172,12 @@
- 公司介绍
- 生成PDF
+ 公司介绍
+ 生成PDF
+
+
+ 【温馨提示】本资料仅供客户理解产品条款所用,有关产品的说明、解释、承若、或保证,如与产品条款不一致,均以产品条款为准。
-
【温馨提示】本资料仅供客户理解产品条款所用,有关产品的说明、解释、承若、或保证,如与产品条款不一致,均以产品条款为准。
转投保
@@ -530,36 +475,49 @@ export default {
},
//跳转到pdf 进入建议书后 根据建议书编码来查找相应的pdf
async goPDF() {
- let params = {
- proposalInfoDTO: {
- proposalNo: localStorage.orderNo
+ this.$jump({
+ flag: 'h5',
+ extra: {
+ url: location.origin + '/#/proposal/pdf'
+ },
+ routerInfo: {
+ path: '/proposal/pdf'
}
- }
- //在微信端 直接跳转
- if (this.isWeixin) {
- return this.$jump({
- flag: 'h5',
- extra: {
- url: location.origin + '/#/proposal/pdf'
- },
- routerInfo: {
- path: '/proposal/pdf'
- }
- })
- }
- let make = await makePdf(params)
- if (make.result == '0') {
- let pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + make.content)
- this.$jump({
- flag: 'h5',
- extra: {
- url: location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl,
- title: 'PDF预览'
- }
- })
- } else {
- Toast.fail(make.resultMessage)
- }
+ })
+
+ // let params = {
+ // proposalInfoDTO: {
+ // proposalNo: localStorage.orderNo
+ // }
+ // }
+ // //在微信端 直接跳转
+ // if (this.isWeixin) {
+ // return this.$jump({
+ // flag: 'h5',
+ // extra: {
+ // url: location.origin + '/#/proposal/pdf'
+ // },
+ // routerInfo: {
+ // path: '/proposal/pdf'
+ // }
+ // })
+ // }
+ // let make = await makePdf(params)
+ // if (make.result == '0') {
+ // let pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + make.content)
+ // this.$jump({
+ // flag: 'h5',
+ // extra: {
+ // url: location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl,
+ // title: 'PDF预览'
+ // },
+ // routerInfo: {
+ // path: '/proposal/pdf'
+ // }
+ // })
+ // } else {
+ // Toast.fail(make.resultMessage)
+ // }
}
},
components: {
diff --git a/src/views/ebiz/proposal/PDF.vue b/src/views/ebiz/proposal/PDF.vue
index 94718f1b2..9b32da784 100644
--- a/src/views/ebiz/proposal/PDF.vue
+++ b/src/views/ebiz/proposal/PDF.vue
@@ -7,33 +7,96 @@
import { makePdf } from '@/api/ebiz/proposal/proposal.js'
import { Toast } from 'vant'
import config from '@/config'
+import dataDictionary from '@/assets/js/utils/data-dictionary' //使用数据字典中的险种类型
+import { weixinShare } from '@/assets/js/utils/wxShare.js'
export default {
data() {
+ let isWeixin = this.$utils.device().isWeixin //判断环境
return {
- pdfUrl: ''
+ pdfUrl: '',
+ isWeixin,
+ title: ''
}
},
components: {
[Toast.name]: Toast
},
-
+ created() {
+ if (this.$route.query.checkRule == '1') {
+ document.title = '体检规则'
+ console.log(this.$assetsUrl + `images/underWritingRule.pdf`)
+ this.pdfUrl = location.origin + '/pdfjs/web/viewer.html?file=' + this.$assetsUrl + `images/underWritingRule.pdf`
+ } else {
+ this.init()
+ }
+ },
mounted() {
- this.init()
+ let riskCode = localStorage.pdfShareCode
+ dataDictionary.riskType.some(item => {
+ if (item.code == riskCode) {
+ this.title = item.shortName + '计划书pdf'
+ return true
+ }
+ })
+ // weixinShare({
+ // title: this.title,
+ // imgUrl: this.$assetsUrl + 'images/logo.png',
+ // desc: '国富为您量身定制的保险产品,请查收'
+ // })
},
methods: {
async init() {
- let params = {
- proposalInfoDTO: {
- proposalNo: localStorage.orderNo
- }
- }
- let pdfUrl = ''
- let make = await makePdf(params)
- if (make.result == '0') {
- pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + make.content)
+ if (this.$route.query.url) {
+ document.title = this.$route.query.name
+ let pdfUrl = this.$route.query.url
this.pdfUrl = location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl
} else {
- Toast.fail(make.resultMessage)
+ this.$route.query.orderNo && (localStorage.orderNo = this.$route.query.orderNo)
+ this.$route.query.token && (localStorage.token = this.$route.query.token)
+ let params = {
+ proposalInfoDTO: {
+ // proposalNo: localStorage.orderNo
+ proposalNo: localStorage.orderNo || '19122416281210179267'
+ }
+ }
+ let pdfUrl = ''
+ let make = await makePdf(params)
+ if (make.result == '0') {
+ pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + make.content)
+ this.pdfUrl = location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl
+ if (!this.isWeixin) {
+ setTimeout(() => {
+ this.filterBtn() // 初始化分享按钮
+ window.appCallBack = this.appCallBack //app回调
+ }, 1000)
+ }
+ } else {
+ Toast.fail(make.resultMessage)
+ }
+ }
+ },
+ // 分享按钮
+ filterBtn() {
+ window.EWebBridge.webCallAppInJs('webview_right_button', {
+ btns: [
+ {
+ img: this.$assetsUrl + 'images/share@3x.png'
+ }
+ ]
+ })
+ },
+ appCallBack(data) {
+ if (data.trigger == 'right_button_click') {
+ // eslint-disable-next-line no-undef
+ EWebBridge.webCallAppInJs('bridge', {
+ flag: 'share',
+ extra: {
+ title: this.title,
+ content: '国富为您量身定制的保险产品,请查收',
+ url: location.origin + '/#/proposal/pdf?orderNo=' + localStorage.orderNo + '&token=' + localStorage.token,
+ img: this.$assetsUrl + 'images/logo.png'
+ }
+ })
}
}
}