From 9f81f7de08a3fcc371fe8d687ee51aece2858cbe Mon Sep 17 00:00:00 2001 From: "pang.lizong" Date: Sun, 22 Sep 2019 15:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E4=BB=A3=E7=A0=81=E5=90=88?= =?UTF-8?q?=E5=B9=B6--=E6=8A=95=E4=BF=9D=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- package-lock.json | 44 ++++-- package.json | 2 +- src/config/index.js | 7 +- src/views/ebiz/product/HomeProduct.vue | 4 +- src/views/ebiz/sale/AccountInformation.vue | 15 +- src/views/ebiz/sale/InsuredInfo.vue | 2 +- src/views/ebiz/sale/InsuredPerson.vue | 6 +- src/views/ebiz/sale/PayMent.vue | 135 +++++++++++++++--- src/views/ebiz/sale/SignatureConfirmation.vue | 32 +++-- 10 files changed, 195 insertions(+), 54 deletions(-) diff --git a/.env.development b/.env.development index 0f3aa8d52..765783424 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # env -NODE_ENV = 'development' +NODE_ENV = 'production' # flag VUE_APP_FLAG='development' diff --git a/package-lock.json b/package-lock.json index 44d9b6fc6..bc73d1468 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6387,7 +6387,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -6408,12 +6409,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6428,17 +6431,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6555,7 +6561,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6567,6 +6574,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6581,6 +6589,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6588,12 +6597,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6612,6 +6623,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6692,7 +6704,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6704,6 +6717,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6789,7 +6803,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -6825,6 +6840,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6844,6 +6860,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6887,12 +6904,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -12770,7 +12789,8 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true + "dev": true, + "optional": true }, "rx-lite-aggregates": { "version": "4.0.8", diff --git a/package.json b/package.json index 2239b89d1..25eb17f44 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ebiz-h5", "version": "1.0.0", - "description": "鼎诚人寿", + "description": "国富人寿", "author": "wangfangbo ", "private": true, "scripts": { diff --git a/src/config/index.js b/src/config/index.js index 74eef69a7..e3da27230 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,10 +10,11 @@ let apiDomain, imgDomain, assetsUrl, mainUrl console.log('环境:', process.env.VUE_APP_FLAG) switch (process.env.VUE_APP_FLAG) { case 'development': - apiDomain = 'http://47.96.143.111:7000/api/v1' - imgDomain = 'http://116.62.236.168:7012/updown' + // apiDomain = 'http://47.96.143.111:7000/api/v1' + apiDomain = 'http://139.199.50.151:7000/api/v1' // 国富api + imgDomain = 'http://10.10.100.98:7012/updown' // 影像件上传 // 静态服务资源 - assetsUrl = 'http://47.96.143.111:8000/app/' + assetsUrl = 'http://139.199.50.151:8000/app/' mainUrl = 'http://47.96.143.111' break case 'staging': diff --git a/src/views/ebiz/product/HomeProduct.vue b/src/views/ebiz/product/HomeProduct.vue index 22da4aa33..f3dff6d7a 100644 --- a/src/views/ebiz/product/HomeProduct.vue +++ b/src/views/ebiz/product/HomeProduct.vue @@ -30,10 +30,10 @@
- +
- +
diff --git a/src/views/ebiz/sale/AccountInformation.vue b/src/views/ebiz/sale/AccountInformation.vue index f05fbb59c..1c2d3800c 100644 --- a/src/views/ebiz/sale/AccountInformation.vue +++ b/src/views/ebiz/sale/AccountInformation.vue @@ -22,7 +22,7 @@ v-validate="'required|bankCard'" data-vv-name="银行卡号" /> - 银行卡扫描 + - 证件扫描 + - 证件扫描 + + + 返回投保单列表 去支付 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -51,7 +87,45 @@ export default { src: this.$assetsUrl + 'images/cardImg.png', // 核保数据 underWriteData: {}, - srcImg: '' + srcImg: '', + payParam: { + TransSource: '', // 对接系统 + TransDate: '', // 请求日期 + TransTime: '', // 请求时间 + TransSeq: '', // 时间戳 + Version: '', // 版本号 + RdSeq: '', // 指令流水号 + PaymentCode: '', // 业务唯一号 + PayType: '', // 交易类型 + SettleMode: '', // 支付方式 + ApplyEntity: '', // 业务发生机构 + Cur: '', // 币种 + OurAmount: '', // 金额 + FixUser: '', // 实名认证标识 + Insurer: '', // 对接系统 + CertType: '', // 证件类型 + CertNum: '', // 证件号码 + OppBank: '', // 交易方银行 + OppAct: '', // 交易方账号 + OppActName: '', // 交易方名称 + CellPhone: '', // 手机号码 + ExpireDate: '', // 订单失效时间 + Purpose: '', // 用途 + Memo: '', // 备注 + Description: '', // 描述 + SourceNotecode: '', // 外部系统业务单据号 + ReturnURL: '', // 页面跳转同步通知地址 + NotifyURL: '', // 后台通知地址 + SaleChannel: '', // 销售渠道 + ReqReserved1: '', // 备用字段1 + ReqReserved2: '', // 备用字段2 + ReqReserved3: '', // 备用字段3 + ReqReserved4: '', // 备用字段4 + ReqReserved5: '', // 备用字段5 + S3Sign: '', // 验签信息 + tradeState: '' // 状态 + }, + gotPayParam: false // 是否已正确获取支付参数 } }, mounted() { @@ -65,37 +139,62 @@ export default { this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData')) this.srcImg = this.$assetsUrl + `images/bank/bank_${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png` } + // 取支付参数 + this.getPayParam() }, methods: { - // 点击支付 - payMent() { + // 取支付参数 + getPayParam() { let that = this let data = { orderNo: window.localStorage.getItem('orderNo') } + console.log('----取支付参数请求:', data) acceptInsurance(data).then(res => { + console.log('----取支付参数结果:', JSON.stringify(res)) + // res = {'result':'0','resultMessage':'','content':null,'prtNo':'8186270000000008','payStatus':'4','amnt':'63700.00','appntName':'投保人','message':null,'brPayReturnData':{'result':'','resultMessage':'','content':null,'businessId':'1569125393518','businessNo':'8186270000000008','tradeSubType':'COMM','businessType':'SALE','systemType':'GF','money':63700,'businessSubType':'XDCB','thirdType':'0002','thirdName':null,'bankCode':'ABC','epayOrderNo':'1909221209536259999900','companyAccount':null,'tradeState':'TRADING','standardCode':'DEALING','standardMsg':null,'thirdOrderNo':null,'respRemark':null,'tradeTime':'2019-09-22T04:09:53.518+0000','description':'','version':'1','sourceNotecode':'8186270000000008','payType':'MIT01','expireDate':'20191010101010','transSeq':'20190922120953782','transSource':'MIT','applyEntity':'11860000','paymentCode':'8186270000000008','transDate':'20190922','rdSeq':'1909221209536259999900','settleMode':null,'cur':'CNY','transTime':'120953','ourAmount':63700,'fixUser':'1','insurer':'投保人','certType':'0','certNum':'110101199009210011','oppBank':'ABC','oppAct':'6228481200290317812','oppActName':'投保人','cellPhone':null,'purpose':null,'memo':null,'returnURL':'http://139.199.50.151/#/sale/payResult','notifyURL':'http://139.199.50.151:7000/api/v1/epay/epay/payResult','s3Sign':'e3f0581ec6b751337e8eca360a0746bc'}} if (res.result == '0') { - // 1成 4支付中 2支付失败 8转批扣 - - window.localStorage.setItem('resMessage', res.resultMessage) - - window.localStorage.setItem('payStatus', res.payStatus) - window.localStorage.setItem('payInfo', JSON.stringify(res)) - that.$jump({ - flag: 'h5', - extra: { - url: location.origin + '/#/sale/payResult', - backToFirst: '1' - }, - routerInfo: { - path: '/sale/payResult' + // // 1成 4支付中 2支付失败 8转批扣 + // if (res.payStatus == '2') { + // window.localStorage.setItem('resMessage', res.resultMessage) + // } + // window.localStorage.setItem('payStatus', res.payStatus) + // window.localStorage.setItem('payInfo', JSON.stringify(res)) + // that.$jump({ + // flag: 'h5', + // extra: { + // url: location.origin + '/#/sale/payResult', + // backToFirst: '1' + // }, + // routerInfo: { + // path: '/sale/payResult' + // } + // }) + let keyMap = {} + for (let key in this.payParam) { + keyMap[key.toLowerCase()] = key + } + let paramKey + for (let rKey in res.brPayReturnData) { + if (keyMap.hasOwnProperty(rKey.toLowerCase())) { + paramKey = keyMap[rKey.toLowerCase()] + this.payParam[paramKey] = res.brPayReturnData[rKey] } - }) + } + console.log('----支付参数:this.payParam:', JSON.stringify(this.payParam)) + this.gotPayParam = true + this.$forceUpdate() } else { that.$toast(res.resultMessage) } }) }, + // 点击支付 + payMent() { + if (this.gotPayParam) { + this.$refs.payForm.submit() + } + }, // 取消支付 cancel() { this.$jump({ diff --git a/src/views/ebiz/sale/SignatureConfirmation.vue b/src/views/ebiz/sale/SignatureConfirmation.vue index 5fd38820d..094e30d80 100644 --- a/src/views/ebiz/sale/SignatureConfirmation.vue +++ b/src/views/ebiz/sale/SignatureConfirmation.vue @@ -302,9 +302,9 @@ export default { this.tipsName = JSON.parse(localStorage.getItem('saleInsuredInfo')).name } weixinShare({ - title: '鼎诚人寿计划书', - imgUrl: 'http://47.96.143.111:8000/app/images/logo.png', - desc: '鼎诚为您量身定制的保险产品,请查收' + title: '国富人寿计划书', + imgUrl: 'http://139.199.50.151:8000/app/images/logo.png', + desc: '国富为您量身定制的保险产品,请查收' }) let params = { orderNo: '' @@ -421,9 +421,14 @@ export default { } }) } else { - EWebBridge.webCallAppInJs('face_auth', { - number: that.saleInsuredInfo.idNo, //身份证号码 - name: that.saleInsuredInfo.name //姓名 + // 跳过人脸识别 + // EWebBridge.webCallAppInJs('face_auth', { + // number: that.saleInsuredInfo.idNo, //身份证号码 + // name: that.saleInsuredInfo.name //姓名 + // }) + new Promise(resolve => { + console.log('--跳过人脸识别--返回识别成功') + resolve(JSON.stringify({ state: '1' })) }).then(data => { if (JSON.parse(data).state == '1') { if (that.appntSign.readStatus == '0') { @@ -476,11 +481,14 @@ export default { } }) } else { - EWebBridge.webCallAppInJs('face_auth', { - //身份证号码 - number: that.saleInsuredPersonInfo.idNo, - //姓名 - name: that.saleInsuredPersonInfo.name + // 跳过人脸识别 + // EWebBridge.webCallAppInJs('face_auth', { + // number: that.saleInsuredInfo.idNo, //身份证号码 + // name: that.saleInsuredInfo.name //姓名 + // }) + new Promise(resolve => { + console.log('--跳过人脸识别--返回识别成功') + resolve(JSON.stringify({ state: '1' })) }).then(data => { if (JSON.parse(data).state == '1') { if (that.insuredSign.readStatus == '0') { @@ -551,7 +559,7 @@ export default { EWebBridge.webCallAppInJs('bridge', { flag: 'share', extra: { - title: `鼎诚人寿电子投保单(${shareName})签字`, + title: `国富人寿电子投保单(${shareName})签字`, content: '签字进行', url: location.origin +