Commit 2226924f authored by 郭志伟's avatar 郭志伟

fix: 信用钱包授权;华泰试算

parent 96a17d8c
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Description:众安50万意外险 * @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37 * @Date: 2020-07-27 15:46:37
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2020-08-26 18:43:54 * @LastEditTime: 2020-08-28 10:48:31
*/ */
import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png"; import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png";
import title from "@/assets/images/goods/detail/yiwaixian/title.png"; import title from "@/assets/images/goods/detail/yiwaixian/title.png";
...@@ -297,8 +297,8 @@ export default { ...@@ -297,8 +297,8 @@ export default {
title: "一次交清", title: "一次交清",
list: [ list: [
["18-45周岁", "564元", "264元", "53元"], ["18-45周岁", "564元", "264元", "53元"],
["18-45周岁", "818元", "390元", "77元"], ["46-55周岁", "818元", "390元", "77元"],
["18-45周岁", "1185元", "551元", "111元"] ["56-65周岁", "1185元", "551元", "111元"]
] ]
} }
], ],
......
<template> <template>
<cr-popup v-model="showAuth" get-container="body" position="bottom" class="auth-popup"> <cr-popup
v-model="showAuth"
get-container="body"
position="bottom"
class="auth-popup"
:close-on-click-overlay="false"
>
<div class="auth"> <div class="auth">
<div class="auth-title"> <div class="auth-title">
<svg-icon icon-class="mongo" /> <svg-icon icon-class="mongo" />
...@@ -22,7 +28,7 @@ ...@@ -22,7 +28,7 @@
</div> </div>
<div class="auth-foot"> <div class="auth-foot">
<cr-button class="wx-default" @click="setAuthXyqb(3)">拒绝</cr-button> <cr-button class="wx-default" @click="setAuthXyqb(3)">拒绝</cr-button>
<cr-button class="wx-primary" @click="setAuthXyqb(4)">允许</cr-button> <cr-button class="wx-primary" @click="confirm">允许</cr-button>
</div> </div>
</div> </div>
</cr-popup> </cr-popup>
...@@ -31,7 +37,6 @@ ...@@ -31,7 +37,6 @@
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
const xyqbUserInfo = localStorage.get("xyqbUserInfo") || {};
export default { export default {
name: "AuthFromXyqb", name: "AuthFromXyqb",
...@@ -46,7 +51,7 @@ export default { ...@@ -46,7 +51,7 @@ export default {
immediate: true, immediate: true,
handler(val) { handler(val) {
this.setUserInfo(); this.setUserInfo();
this.showAuth = !!this.userInfo.length && this.hasUserId && val === 2; this.showAuth = !!this.userInfo.length && val === 2;
if (this.showAuth) { if (this.showAuth) {
this.$nextTick(() => { this.$nextTick(() => {
const activeElement = document.activeElement; const activeElement = document.activeElement;
...@@ -64,14 +69,16 @@ export default { ...@@ -64,14 +69,16 @@ export default {
} }
}, },
computed: { computed: {
...mapState(["showAuthXyqb"]), ...mapState(["showAuthXyqb"])
hasUserId() {
return !!this.userInfo.userInfoSecId;
}
}, },
methods: { methods: {
...mapActions(["setAuthXyqb"]), ...mapActions(["setAuthXyqb"]),
confirm() {
localStorage.set("mongoToken", localStorage.get("mongoTokenFromxyqb"));
this.setAuthXyqb(4);
},
setUserInfo() { setUserInfo() {
const xyqbUserInfo = localStorage.get("xyqbUserInfo") || {};
Object.keys(xyqbUserInfo).forEach(key => { Object.keys(xyqbUserInfo).forEach(key => {
if (key === "phoneNoMask") { if (key === "phoneNoMask") {
this.userInfo[0] = { this.userInfo[0] = {
......
...@@ -158,10 +158,11 @@ export default { ...@@ -158,10 +158,11 @@ export default {
&-icon { &-icon {
font-style: normal; font-style: normal;
font-weight: @font-weight-bold; font-weight: @font-weight-bold;
width: 18px; width: 20px;
} }
&-txt { &-txt {
margin-left: 8px; margin-left: 0;
flex: 1;
} }
} }
&.show { &.show {
......
...@@ -50,7 +50,7 @@ async function getAuthInfo(xyqbToken) { ...@@ -50,7 +50,7 @@ async function getAuthInfo(xyqbToken) {
if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return; if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return;
const res = await authByxyqb({ xyqbToken }); const res = await authByxyqb({ xyqbToken });
if (res) { if (res) {
// localStorage.set("mongoToken", res.token); localStorage.set("mongoTokenFromxyqb", res.token);
localStorage.set("xyqbUserInfo", res); localStorage.set("xyqbUserInfo", res);
localStorage.set("xyqbToken", xyqbToken); localStorage.set("xyqbToken", xyqbToken);
} }
......
...@@ -177,58 +177,6 @@ export default { ...@@ -177,58 +177,6 @@ export default {
} = oldVal; } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo; let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo; let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!relation && relation === "1") {
idNoWho = selfIdNo;
oldidNoWho = oldselfIdNo;
} else {
idNoWho = idNo;
oldidNoWho = oldidNo;
}
if (this.goInsureState) {
const subFormData = JSON.parse(JSON.stringify(this.formData));
const {
userInfoSecId,
name,
idNo,
relation,
socialSecurity,
selfSocialSecurity,
selfName,
selfIdNo,
selfPhone,
selfSecId,
payType,
amountInsured,
autoRenewPolicy
} = subFormData;
const subFormDataCache = {
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
userInfoSecId: selfSecId ? selfSecId : null,
name: selfName,
idNo: selfIdNo
},
productItem: {
payType,
amountInsured
},
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
subFormDataCache.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
subFormDataCache.holderUserInfo.relation = relation;
} else {
subFormDataCache.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
}
sessionStorage.setItem("policyFormData", JSON.stringify(subFormDataCache));
}
this.isCalPrice = this.checkAgeInRange(); this.isCalPrice = this.checkAgeInRange();
if ( if (
!this.isCalPrice || !this.isCalPrice ||
...@@ -333,7 +281,55 @@ export default { ...@@ -333,7 +281,55 @@ export default {
} }
}, },
nextStep() { nextStep() {
this.$router.push({ path: "/goods/inform" }); this.generateFormData();
setTimeout(() => {
this.$router.push({ path: "/goods/inform" });
}, 500);
},
generateFormData() {
const subFormData = JSON.parse(JSON.stringify(this.formData));
const {
userInfoSecId,
name,
idNo,
relation,
socialSecurity,
selfSocialSecurity,
selfName,
selfIdNo,
selfPhone,
selfSecId,
payType,
amountInsured,
autoRenewPolicy
} = subFormData;
const subFormDataCache = {
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
userInfoSecId: selfSecId ? selfSecId : null,
name: selfName,
idNo: selfIdNo
},
productItem: {
payType,
amountInsured
},
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
subFormDataCache.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
subFormDataCache.holderUserInfo.relation = relation;
} else {
subFormDataCache.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
}
sessionStorage.setItem("policyFormData", JSON.stringify(subFormDataCache));
}, },
getRealIdNo() { getRealIdNo() {
const { relation, userInfoSecId: userId, idNo: idNoMask } = this.formData; const { relation, userInfoSecId: userId, idNo: idNoMask } = this.formData;
...@@ -349,11 +345,12 @@ export default { ...@@ -349,11 +345,12 @@ export default {
return currentIdNo; return currentIdNo;
}, },
checkAgeInRange() { checkAgeInRange() {
const maxAge = this.formData.amountInsured === "300000" ? 50 : 60;
const currentIdNo = this.getRealIdNo(); const currentIdNo = this.getRealIdNo();
if (!currentIdNo) return; if (!currentIdNo) return;
const birthday = getBirthDate(currentIdNo); const birthday = getBirthDate(currentIdNo);
const isOverMonth = birthday && parseInt(fromNow(new Date(birthday), { unit: "day" })) >= 30; const isOverMonth = birthday && parseInt(fromNow(new Date(birthday), { unit: "day" })) >= 30;
return isOverMonth && getRealAge(birthday) <= 50; return isOverMonth && getRealAge(birthday) <= maxAge;
}, },
async getDetail() { async getDetail() {
this.goodId = this.$route.query.id; this.goodId = this.$route.query.id;
......
...@@ -176,6 +176,18 @@ export default { ...@@ -176,6 +176,18 @@ export default {
.rate-table { .rate-table {
margin: 0; margin: 0;
width: 100%; width: 100%;
thead {
th {
&:first-child {
padding-left: 10px;
}
}
}
tbody {
th {
padding-left: 10px;
}
}
&-padding { &-padding {
thead { thead {
th { th {
......
...@@ -274,6 +274,7 @@ export default { ...@@ -274,6 +274,7 @@ export default {
} }
this.xyqbAuthState = localStorage.get("xyqbAuthState"); this.xyqbAuthState = localStorage.get("xyqbAuthState");
this.selfInfoReadonly = nameMask && idNoMask && phoneNoMask; this.selfInfoReadonly = nameMask && idNoMask && phoneNoMask;
this.getFamilyList();
this.$forceUpdate(); this.$forceUpdate();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment