diff --git a/src/assets/js/utils/request.js b/src/assets/js/utils/request.js index 1f5a54ec5..9bbe2d956 100644 --- a/src/assets/js/utils/request.js +++ b/src/assets/js/utils/request.js @@ -188,19 +188,32 @@ service.interceptors.response.use( res = JSON.parse(AESTools.AESDecrypt(res.response, configApp.REQ_PWD)) } } - + Toast.clear() if (res.code != 0) { if (res.code == 10001 || res.code == 10002) { - Dialog.confirm({ - confirmButtonText: '重新登录', - message: '你已被登出,可以取消继续留在该页面,或者重新登录' - }).then(() => { - //eslint-disable-next-line - EWebBridge.webCallAppInJs('bridge', { - flag: 'login' + var ua = window.navigator.userAgent.toLowerCase(); + //通过正则表达式匹配ua中是否含有MicroMessenger字符串 + if(ua.match(/MicroMessenger/i) == 'micromessenger'){ + Dialog.alert({ + title: '提示', + confirmButtonText: '退出', + message: '当前链接已失效,请您联系业务员获取(重新分享)。', + }).then(() => { + window.close(); + WeixinJSBridge.call('closeWindow'); + }); + } else { + Dialog.confirm({ + confirmButtonText: '重新登录', + message: '你已被登出,可以取消继续留在该页面,或者重新登录' + }).then(() => { + //eslint-disable-next-line + EWebBridge.webCallAppInJs('bridge', { + flag: 'login' + }) }) - }) + } } else { //Toast.fail(res.msg) } diff --git a/src/components/ebiz/occipation/OccupationForLoop.vue b/src/components/ebiz/occipation/OccupationForLoop.vue new file mode 100644 index 000000000..7d8ca8ddb --- /dev/null +++ b/src/components/ebiz/occipation/OccupationForLoop.vue @@ -0,0 +1,295 @@ + + + diff --git a/src/views/ebiz/cardList/Pay.vue b/src/views/ebiz/cardList/Pay.vue index 9f47d98ef..caf331ccf 100644 --- a/src/views/ebiz/cardList/Pay.vue +++ b/src/views/ebiz/cardList/Pay.vue @@ -750,31 +750,35 @@ export default { }) } }, - async share() { + async share() { let valid = await this.$validator.validate() console.log(valid) if (true !== valid) { console.log(this.$validator) return this.$toast(this.$validator.errors.all()[0]) } - let shareName = this.underWriteData.appntName - localStorage.appntName = this.underWriteData.appntName + let shareName = this.underWriteData.name + localStorage.name = this.underWriteData.name localStorage.bankName = this.underWriteData.bankName localStorage.bankCode = this.underWriteData.bankCode localStorage.bankListName = this.bankListName - console.log(this.underWriteData.bankName, this.underWriteData.bankCode, this.bankListName, this.underWriteData.name) - let url = location.origin + '/#/cardList/phoneCode?orderNo=' + localStorage.orderNo + '&token=' + localStorage.token - console.log(url) - EWebBridge.webCallAppInJs('bridge', { - flag: 'share', - extra: { - title: `国富人寿卡单投保(${shareName})付款`, - content: '付款进行', - url: url, - img: this.$assetsUrl + 'images/logo.png', - }, - }) - }, + console.log(this.underWriteData.bankName, this.underWriteData.bankCode, this.bankListName, this.underWriteData.name) + let res = await getShareParam({ shareType: 'card_pay' }) + let url = location.origin + '/#/cardList/pay?orderNo=' + localStorage.orderNo + '&token=' + res.content + if (res.result == '0') { + EWebBridge.webCallAppInJs('bridge', { + flag: 'share', + extra: { + title: `国富人寿卡单投保(${shareName})付款`, + content: '付款进行', + url: url, + img: this.$assetsUrl + 'images/logo.png' + } + }) + } else { + return this.$toast(res.resultMessage) + } + } }, } diff --git a/src/views/ebiz/cardList/information.vue b/src/views/ebiz/cardList/information.vue index e0b74bea0..96eafd248 100644 --- a/src/views/ebiz/cardList/information.vue +++ b/src/views/ebiz/cardList/information.vue @@ -37,7 +37,7 @@ clearable @blur="getRelatedData(userInfo.idNo, '1')" > - 证件扫描 + 证件扫描 - - + @@ -165,7 +150,7 @@ clearable @blur="getRelatedData(insuredInfo.idNo, '2')" > - 证件扫描 + 证件扫描 - - + + @@ -296,21 +267,7 @@ maxlength="11" /> - + - + @@ -361,7 +315,7 @@ v-validate="'required'" right-icon="arrow" placeholder="请选择" - @click="toSelect('12')" + @click="toSelect('10')" /> + + + + - + - + - + @@ -439,7 +397,9 @@ import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan' import idNoCheck from '@/assets/js/utils/idNoCheck' import beforeDate from '@/assets/js/utils/getBeforeDate.js' import afterDate from '@/assets/js/utils/getAfterDate.js' +import CacheUtils from '@/assets/js/utils/cacheUtils' import { idToData } from './js/verification' +import OccupationForLoop from '@/components/ebiz/occipation/OccupationForLoop' import { selectComp, getIdentityInfo } from './js/methods' import Vue from 'vue' import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant' @@ -462,6 +422,7 @@ export default { [RadioGroup.name]: RadioGroup, [Radio.name]: Radio, [IdentityCardScan.name]: IdentityCardScan, + OccupationForLoop, }, data() { return { @@ -562,8 +523,11 @@ export default { occupationShowPicker: false, timeId: null, chooseProducts: JSON.parse(localStorage.chooseProducts), - trialList: JSON.parse(localStorage.trialList), + trialList: JSON.parse(CacheUtils.getLocItem('trialList')), pdf: ['', '', ''], + insureType: '', + pickerIndex: 0, + areaCode: '110101', } }, created() { @@ -595,6 +559,53 @@ export default { this.allPrice = this.trialList[0].prem }, methods: { + /** + * @description: + * @param {*} data + * @return {*} + */ + chooseOccupation(data) { + let { code, name, healthGrade, lifeGrade } = data + this.$jump({ + flag: 'navigation', + extra: { + title: '职业类别', + hiddenRight: '1' + } + }) + this.occupationShowPicker = false + if (this.insureType === '1') { + this.userInfo.occupationName = name + this.userInfo.occupationCode = code + } else if (this.insureType === '2') { + this.insuredInfo.occupationName = name + this.insuredInfo.occupationCode = code + } + }, + /** + * @description: + * @param {*} + * @return {*} + */ + openOccupation(insureType) { + this.occupationShowPicker = !this.occupationShowPicker + this.insureType = insureType + if (this.insureType === '1') { + this.occupationName = this.userInfo.occupationName + this.occupationCode = this.userInfo.occupationCode + } else if (this.insureType === '2') { + this.occupationName = this.insuredInfo.occupationName + this.occupationCode = this.insuredInfo.occupationCode + } + }, + areaSelect(insureType) { + ;[this.homeShow, this.insureType] = [true, insureType] + if (insureType === '1') { + this.areaCode = this.userInfo.homeArea + } else if (insureType === '2') { + this.areaCode = this.insuredInfo.homeArea + } + }, underWrite(orderNo) { let data = { platform: 'app', @@ -659,13 +670,22 @@ export default { // console.log('name',name) this.insuredInfo.name = name }, - selectClick(index, value) { + /** + * @description: + * @param {*} index + * @param {*} value + * @param {*} insureType '1'为投保人 '2'为被投保人 + * @return {*} + */ + selectClick(index, value, insureType) { if (value !== undefined) { - this.selectUser = value + this.selectUser = value } + this.insureType = insureType + selectComp(this, index, insureType) // console.log(index, value) // localStorage.setItem('value', value) - selectComp(this, index, '1') + }, // closeBtn() { // // 筛选按钮的显示 @@ -702,24 +722,14 @@ export default { this.isScan = false } }, - chooseOccupation() { - this.$jump({ - flag: 'navigation', - extra: { - title: '投被保人信息', - hiddenRight: '1', - }, - }) - this.occupationShowPicker = false - }, //弹框选择 - toSelect(pickerType, valueKey) { - console.log(valueKey) + toSelect(pickerType, valueKey) { //pickerType 1、国家地区 2、证件类型 3、文化程度 4、有无社保(弃用) 5、税收居民身份 6、婚姻状况 7、在职情况 8、收入来源, 9 关系 ;[this.popupShow, this.pickerType] = [true, pickerType] if (valueKey) this.valueKey = valueKey if (pickerType == '1') { - this.columns = DataDictionary.nativeplace + this.columns = DataDictionary.nativeplace + this.pickerIndex = (this.userInfo.nativeplace-1) > 0 ? (this.userInfo.nativeplace-1) : 0 } else if (pickerType == '2') { this.columns = DataDictionary.insuredIdType } else if (pickerType == '3') { @@ -733,20 +743,84 @@ export default { this.columns = DataDictionary.taxIdentity } else if (pickerType == '6') { this.columns = DataDictionary.marriage + this.pickerIndex = (this.userInfo.marriage-1) > 0 ? (this.userInfo.marriage-1) : 0 } else if (pickerType == '7') { this.columns = DataDictionary.workCondition } else if (pickerType == '8') { this.columns = DataDictionary.salarySource } else if (pickerType == '9') { this.columns = DataDictionary.relationToAppnt - } else if (pickerType == '10') { + } else if (pickerType == '66') { this.columns = DataDictionary.marriage + this.pickerIndex = (this.insuredInfo.marriage-1) > 0 ? (this.insuredInfo.marriage-1) : 0 } else if (pickerType == '11') { - this.columns = DataDictionary.insuredIdType - } else if (pickerType == '12') { + this.columns = DataDictionary.nativeplace + this.pickerIndex = (this.insuredInfo.nativeplace-1) > 0 ? (this.insuredInfo.nativeplace-1) : 0 + } else if (pickerType == '10') { + + this.trialList = `{ + "code": 0, + "message": "成功", + "content": { + "result": "0", + "resultMessage": "", + "content": null, + "trialList": [ + { + "productCode": "GFRS_M0041", + "amt": null, + "standPrem": null, + "prem": 100, + "isMainRisk": null, + "isRemit": null, + "remitType": null, + "duty": null, + "showPrem": 100, + "trialType": null, + "schemeName": "国富无忧卡A", + "schemeCode": "M0041A", + "timeliness": 3 + }, + { + "productCode": "GFRS_M0041", + "amt": null, + "standPrem": null, + "prem": 200, + "isMainRisk": null, + "isRemit": null, + "remitType": null, + "duty": null, + "showPrem": 200, + "trialType": null, + "schemeName": "国富无忧卡B", + "schemeCode": "M0041B", + "timeliness": 3 + }, + { + "productCode": "GFRS_M0041", + "amt": null, + "standPrem": null, + "prem": 300, + "isMainRisk": null, + "isRemit": null, + "remitType": null, + "duty": null, + "showPrem": 300, + "trialType": null, + "schemeName": "国富无忧卡C", + "schemeCode": "M0041C", + "timeliness": 3 + } + ], + "flag": "0" + } +}` + this.columns = [] + this.trialList = JSON.parse(this.trialList).content.trialList; + console.log(this.trialList, '================this.trialList================') this.trialList.forEach((item)=>{ this.columns.push({ - id:schemeCode, + id:item.schemeCode, text:item.schemeName }) }) @@ -780,15 +854,21 @@ export default { } else if (this.pickerType == '8') { this.userInfo.salarySource = value.id } else if (this.pickerType == '9') { - this.userInfo.relationToInsured = value.id - } else if (this.pickerType == '10') { - this.insuredInfo.marriage = value.text + this.userInfo.relationToInsured = value.id + } else if (this.pickerType == '66') { + this.insuredInfo.marriage = value.id this.insuredInfo.marriageStatus = value.text - } else if (this.pickerType == '11') { - this.insuredInfo.idType = value.id - } else if (this.pickerType == '12') { + } else if (this.pickerType == '11') { + this.insuredInfo.nativeplace = value.id + } else if (this.pickerType == '10') { this.schemeName = value.text - this.schemeCode = value.id + this.schemeCode = value.id + for (let item of this.trialList) { + if (item.schemeCode === this.schemeCode) { + this.allPrice = item.prem + break; + } + } } }, //证件起始截止日期 @@ -889,20 +969,20 @@ export default { { //指定生效日期 //如果录入日期晚于当前日期 - // if (Date.parse(val) < Date.parse(new Date())) { - // this.userInfo.birthday = '' - // this.$refs.birthday.date = '' - // return this.$toast('当前日期早于当日') - // } - // console.log(val) - // console.log(Date.parse(val)) - // console.log(new Date()) - // let str = '',flag='',date='',valArr=val.split('-'); - // switch (flag){ - // case 'd': - // str = valArr[2]+date - // break; - // } + if (Date.parse(val) < Date.parse(new Date())) { + return this.$toast('当前日期早于当日') + } + let currentDataArr = val.split('-') + let currentData = currentDataArr[0] + '年' + currentDataArr[1] + '月' + currentDataArr[2] + '日' + let insuYear = JSON.parse(localStorage.insuYear) + switch (insuYear.insuYearFlag){ + case 'D': + var hoDate = Date.parse(val)/1000 + insuYear['insuYear']*24*3600 + break; + } + var productDate = new Date(parseInt(hoDate) * 1000); + var productDateTime = productDate.getFullYear() + '年' + (productDate.getMonth() + 1) + '月' + productDate.getDate() + '日'; + this.productDate = currentData + '至' + productDateTime + '时止' } break } @@ -967,6 +1047,22 @@ export default { this.insuredInfo.idType = data.customerIdType //证件类型 this.insuredInfo.idNo = data.customerIdNumber //证件类别 } + + this.insuredInfo.email = data.email //邮箱 + this.insuredInfo.mobile = data.customerPhone //移动电话 + this.insuredInfo.homeProvince = data.homeProvince //家庭省 + this.insuredInfo.homeCity = data.homeCity //家庭市 + this.insuredInfo.homeArea = data.homeArea //家庭区 + if (data.homeProvince && data.homeCity && data.homeArea) { + this.insuredInfo.homeName = getAreaName([{ code: data.homeProvince }, { code: data.homeCity }, { code: data.homeArea }]) //家庭地址 + } + this.insuredInfo.homeAddress = data.homeAddress //家庭详细地址 + this.insuredInfo.occupationCode = data.occupationCode + this.insuredInfo.occupationName = data.occupationName + this.insuredInfo.lifeGrade = data.lifeGrade + this.insuredInfo.healthGrade = data.healthGrade + this.insuredInfo.nativeplace = data.country + this.insuredInfo.marriage = data.marryStatus // 计算年龄 // let age = utilsAge.getAge(this.userInfo.birthday, new Date()) @@ -1202,19 +1298,14 @@ export default { let params = { orderDTO: { orderInfoDTO: { - bnfFlag: '0', - // cvaliDate: this.cvaliDate + bnfFlag: '0', + supportBank: '0' }, - appntDTO: {}, - insuredDTOs: [ - { - riskDTOLst: this.riskDTOLst, - }, - ], + appntDTO: this.userInfo, + insuredDTOs: [this.insuredInfo] }, } - params.orderDTO.appntDTO = this.userInfo - params.orderDTO.insuredDTOs = [this.insuredInfo] + //组装险种提交数据 let [mainRiskCode, riskDTOLst] = ['', []] let rollInResult = '' //校验预计转入保费结果 @@ -1261,7 +1352,10 @@ export default { // this.trialInfos[index].amt = this.trialList[0].prem // } // console.log() - // riskItem = Object.assign(riskItem, this.trialInfos[index]) + // riskItem = Object.assign(riskItem, this.trialInfos[index]) + //todo + riskItem['proScheme'] = this.schemeName + riskItem['proSchemeCode'] = this.schemeCode riskDTOLst.push(riskItem) }) if (!rollInResult) { @@ -1301,10 +1395,16 @@ export default { ;[this.userInfo.companyProvince, this.userInfo.companyCity, this.userInfo.companyArea] = [area[0].code, area[1].code, area[2].code] this.areaShow = false break - case '2': //家庭地址 - this.userInfo.homeName = getAreaName(area) - ;[this.userInfo.homeProvince, this.userInfo.homeCity, this.userInfo.homeArea] = [area[0].code, area[1].code, area[2].code] - this.homeShow = false + case '2': //家庭地址 + if (this.insureType === '1') { + this.userInfo.homeName = getAreaName(area) + ;[this.userInfo.homeProvince, this.userInfo.homeCity, this.userInfo.homeArea] = [area[0].code, area[1].code, area[2].code] + this.homeShow = false + } else if (this.insureType === '2') { + this.insuredInfo.homeName = getAreaName(area) + ;[this.insuredInfo.homeProvince, this.insuredInfo.homeCity, this.insuredInfo.homeArea] = [area[0].code, area[1].code, area[2].code] + this.homeShow = false + } break case '3': //户籍 this.census = getAreaName(area) @@ -1315,7 +1415,7 @@ export default { }, //获取身份证扫描信息 getIdentityInfo(data) { - getIdentityInfo(this, data, '1') + getIdentityInfo(this, data, this.insureType) }, // getIdentityInfo(data) { // console.log(data) diff --git a/src/views/ebiz/cardList/js/methods.js b/src/views/ebiz/cardList/js/methods.js index 5660096f3..29afd6275 100644 --- a/src/views/ebiz/cardList/js/methods.js +++ b/src/views/ebiz/cardList/js/methods.js @@ -88,7 +88,7 @@ export function getIdentityInfo(that, data, type) { // 正面 if (data.name && data.name != '待识别') { that.userInfo.insuredName = data.name - that.userInfo.insuredidNo = data.idNo + that.insuredInfo.idNo = that.userInfo.insuredidNo = data.idNo that.userInfo.insuredBirthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}` that.userInfo.insuredSex = data.gender == '男' ? '0' : '1' } diff --git a/src/views/ebiz/cardList/productDetails.vue b/src/views/ebiz/cardList/productDetails.vue index 09ec4cade..23f4eea9d 100644 --- a/src/views/ebiz/cardList/productDetails.vue +++ b/src/views/ebiz/cardList/productDetails.vue @@ -24,6 +24,7 @@ import { Cell, Toast, Dialog } from 'vant' import { getProductDetails, getProductInfo, insureTrial } from '@/api/ebiz/cardList/cardList.js' import { getAgentInfo } from '@/api/ebiz/my/my.js' +import CacheUtils from '@/assets/js/utils/cacheUtils' export default { name: 'Chanpingxiangqing.vue', components: { @@ -174,6 +175,7 @@ export default { } }) } + localStorage.insuYear = JSON.stringify(this.trialInfos.insuYear[0]) //保存附加险 localStorage.addtionRiskLst = JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst) // console.log('resultData', resultData) @@ -227,8 +229,8 @@ export default { insureTrial(data) .then((res) => { console.log('resrrrrrr', res) - if (res.result == 0) { - localStorage.trialList = JSON.stringify(res.trialList) + if (res.result == 0) { + CacheUtils.setLocItem('trialList', JSON.stringify(res.trialList)) } else { Toast.fail(res.resultMessage) }