From 875fc99b39d1b17574a7812ebb0948386f4a15be Mon Sep 17 00:00:00 2001 From: "li.yuetong" Date: Fri, 4 Nov 2022 11:30:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E3=80=8A=E4=BF=9D=E9=99=A9=E6=9D=A1=E6=AC=BE=E3=80=8B=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=EF=BC=8C=E5=85=B3=E4=BA=8E=E9=87=91=E6=8E=8C=E6=A1=82?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E7=A1=AE=E8=AE=A4=E9=A1=B5=E9=9D=A2=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=98=85=E8=AF=BB=E7=AD=BE=E5=AD=97=E6=9D=90=E6=96=99?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=92=8C=E6=96=B0=E5=A2=9E=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E3=80=91=E4=BF=9D=E9=99=A9=E6=9D=A1=E6=AC=BE=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E9=98=85=E8=AF=BB=E5=90=8E=EF=BC=8Cradio=EF=BC=8CisOv?= =?UTF-8?q?er=E6=81=A2=E5=A4=8D=E5=88=9D=E5=A7=8B=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/index.js | 68 ++++++++++++------------ src/views/ebiz/sale/insuranceClauses.vue | 50 ++++++++++------- 2 files changed, 65 insertions(+), 53 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index b8a584946..38105733a 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -14,40 +14,40 @@ */ let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl, zssqUrl, REQ_PWD, CACHE_ENCRYP, API_VERSION, assetsUpUrl, YB_APP // 保融支付的收银台服务地址 -function getSearchString (key) { - var str = window.location.href.split('?')[1] - str = str.substring(1, str.length) // 获取URL中?之后的字符(去掉第一位的问号) - // 以&分隔字符串,获得类似name=xiaoli这样的元素数组 - var arr = str.split("&") - var obj = new Object() - // 将每一个数组元素以=分隔并赋给obj对象 - for (var i = 0; i < arr.length; i++) { - var tmp_arr = arr[i].split("=") - obj[decodeURIComponent(tmp_arr[0])] = decodeURIComponent(tmp_arr[1]) - } - return obj[key] -} -let apiVersion = 'v2' -var ua = window.navigator.userAgent.toLowerCase() -//通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信 -if (localStorage.getItem('apiVersion')) { - apiVersion = localStorage.getItem('apiVersion') -} else { - if (ua.match(/MicroMessenger/i) == 'micromessenger') { - //report/reportList数据报表页面在浏览器可以打开了,但在微信或企业微信中打开不了,接口请求不需要token - if (window.location.href.indexOf('apiVersion') > 0) { - apiVersion = getSearchString('apiVersion') == 'V3' ? 'v3' : 'v2';//url中apiVersion没有时,为v2 - } else { - apiVersion = 'v3' - } - } else { - // 在app - if (navigator.userAgent.indexOf('JZG_') > 0) { - apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3' ? 'v3' : 'v2' - } - } - window.localStorage.setItem('apiVersion', apiVersion) -} +// function getSearchString(key) { +// var str = window.location.href.split('?')[1] +// str = str.substring(1, str.length) // 获取URL中?之后的字符(去掉第一位的问号) +// // 以&分隔字符串,获得类似name=xiaoli这样的元素数组 +// var arr = str.split("&") +// var obj = new Object() +// // 将每一个数组元素以=分隔并赋给obj对象 +// for (var i = 0; i < arr.length; i++) { +// var tmp_arr = arr[i].split("=") +// obj[decodeURIComponent(tmp_arr[0])] = decodeURIComponent(tmp_arr[1]) +// } +// return obj[key] +// } +let apiVersion = 'v1' +// var ua = window.navigator.userAgent.toLowerCase() +// //通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信 +// if(localStorage.getItem('apiVersion')){ +// apiVersion = localStorage.getItem('apiVersion') +// }else{ +// if(ua.match(/MicroMessenger/i) == 'micromessenger'){ +// //report/reportList数据报表页面在浏览器可以打开了,但在微信或企业微信中打开不了,接口请求不需要token +// if(window.location.href.indexOf('apiVersion') > 0){ +// apiVersion = getSearchString('apiVersion')== 'V3'?'v3':'v2';//url中apiVersion没有时,为v2 +// }else{ +// apiVersion = 'v3' +// } +// }else{ +// // 在app +// if(navigator.userAgent.indexOf('JZG_') > 0){ +// apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3'?'v3':'v2' +// } +// } +// window.localStorage.setItem('apiVersion', apiVersion) +// } // 可以多个接口域名,按需添加 console.log('环境:', process.env.VUE_APP_FLAG) switch (process.env.VUE_APP_FLAG) { diff --git a/src/views/ebiz/sale/insuranceClauses.vue b/src/views/ebiz/sale/insuranceClauses.vue index e4092324f..48580357c 100644 --- a/src/views/ebiz/sale/insuranceClauses.vue +++ b/src/views/ebiz/sale/insuranceClauses.vue @@ -107,6 +107,8 @@ export default { document.body.style.backgroundColor = '#fff' that.signVal = window.localStorage.getItem('sign-val') + that.radio = '' + this.isOver = false // if (JSON.parse(window.localStorage.getItem('sign-insured'))) { // that.insuredSign = JSON.parse(window.localStorage.getItem('sign-insured')) // } @@ -157,26 +159,36 @@ export default { that.insuredSign = insuredSignList for (let i = 0; i < list.length; i++){ let item = list[i] - if (that.signVal == '0' || that.signVal == '2') { - if (item.documentCode == '13' && (item.documentStatus == '0' || item.documentStatus == '2') && (item.signType == '0' || item.signType == '2')) { - console.log('000000000', item) - // that.appntSign = item - that.tipsPolicyUrl = item.policyUrl - this.title = document.title = item.documentName - console.log('that.appntSign', item.policyUrl) - break - } - }else{ - if (item.documentCode == '13' && (item.documentStatus == '0' || item.documentStatus == '2') && item.signType == '1') { - console.log('000000000', item) - // that.appntSign = item - that.tipsPolicyUrl = item.policyUrl - originalUrl = item.originalUrl - this.title = document.title = item.documentName - console.log('that.appntSign', item.policyUrl) - break - } + if (item.documentCode == '13' && (item.documentStatus == '0' || item.documentStatus == '2') && item.signType == that.signVal ) { + console.log('000000000', item) + // that.appntSign = item + that.tipsPolicyUrl = item.policyUrl + originalUrl = item.originalUrl + this.title = document.title = item.documentName + console.log('that.appntSign', item.policyUrl) + break } + // if (that.signVal == '0' || that.signVal == '2') { + // if (item.documentCode == '13' && (item.documentStatus == '0' || item.documentStatus == '2') && (item.signType == '0' || item.signType == '2')) { + // console.log('000000000', item) + // // that.appntSign = item + // that.tipsPolicyUrl = item.policyUrl + // originalUrl = item.originalUrl + // this.title = document.title = item.documentName + // console.log('that.appntSign', item.policyUrl) + // break + // } + // }else{ + // if (item.documentCode == '13' && (item.documentStatus == '0' || item.documentStatus == '2') && item.signType == '1') { + // console.log('000000000', item) + // // that.appntSign = item + // that.tipsPolicyUrl = item.policyUrl + // originalUrl = item.originalUrl + // this.title = document.title = item.documentName + // console.log('that.appntSign', item.policyUrl) + // break + // } + // } } that.pdfUrl = originalUrl // that.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${that.tipsPolicyUrl}`)