Commit 744d589a authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

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

See merge request !106
parents 96a17d8c 2226924f
......@@ -4,7 +4,7 @@
* @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37
* @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 title from "@/assets/images/goods/detail/yiwaixian/title.png";
......@@ -297,8 +297,8 @@ export default {
title: "一次交清",
list: [
["18-45周岁", "564元", "264元", "53元"],
["18-45周岁", "818元", "390元", "77元"],
["18-45周岁", "1185元", "551元", "111元"]
["46-55周岁", "818元", "390元", "77元"],
["56-65周岁", "1185元", "551元", "111元"]
]
}
],
......
<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-title">
<svg-icon icon-class="mongo" />
......@@ -22,7 +28,7 @@
</div>
<div class="auth-foot">
<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>
</cr-popup>
......@@ -31,7 +37,6 @@
<script>
import { mapState, mapActions } from "vuex";
import localStorage from "@/service/localStorage";
const xyqbUserInfo = localStorage.get("xyqbUserInfo") || {};
export default {
name: "AuthFromXyqb",
......@@ -46,7 +51,7 @@ export default {
immediate: true,
handler(val) {
this.setUserInfo();
this.showAuth = !!this.userInfo.length && this.hasUserId && val === 2;
this.showAuth = !!this.userInfo.length && val === 2;
if (this.showAuth) {
this.$nextTick(() => {
const activeElement = document.activeElement;
......@@ -64,14 +69,16 @@ export default {
}
},
computed: {
...mapState(["showAuthXyqb"]),
hasUserId() {
return !!this.userInfo.userInfoSecId;
}
...mapState(["showAuthXyqb"])
},
methods: {
...mapActions(["setAuthXyqb"]),
confirm() {
localStorage.set("mongoToken", localStorage.get("mongoTokenFromxyqb"));
this.setAuthXyqb(4);
},
setUserInfo() {
const xyqbUserInfo = localStorage.get("xyqbUserInfo") || {};
Object.keys(xyqbUserInfo).forEach(key => {
if (key === "phoneNoMask") {
this.userInfo[0] = {
......
......@@ -158,10 +158,11 @@ export default {
&-icon {
font-style: normal;
font-weight: @font-weight-bold;
width: 18px;
width: 20px;
}
&-txt {
margin-left: 8px;
margin-left: 0;
flex: 1;
}
}
&.show {
......
......@@ -50,7 +50,7 @@ async function getAuthInfo(xyqbToken) {
if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return;
const res = await authByxyqb({ xyqbToken });
if (res) {
// localStorage.set("mongoToken", res.token);
localStorage.set("mongoTokenFromxyqb", res.token);
localStorage.set("xyqbUserInfo", res);
localStorage.set("xyqbToken", xyqbToken);
}
......
......@@ -177,58 +177,6 @@ export default {
} = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
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();
if (
!this.isCalPrice ||
......@@ -333,7 +281,55 @@ export default {
}
},
nextStep() {
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() {
const { relation, userInfoSecId: userId, idNo: idNoMask } = this.formData;
......@@ -349,11 +345,12 @@ export default {
return currentIdNo;
},
checkAgeInRange() {
const maxAge = this.formData.amountInsured === "300000" ? 50 : 60;
const currentIdNo = this.getRealIdNo();
if (!currentIdNo) return;
const birthday = getBirthDate(currentIdNo);
const isOverMonth = birthday && parseInt(fromNow(new Date(birthday), { unit: "day" })) >= 30;
return isOverMonth && getRealAge(birthday) <= 50;
return isOverMonth && getRealAge(birthday) <= maxAge;
},
async getDetail() {
this.goodId = this.$route.query.id;
......
......@@ -176,6 +176,18 @@ export default {
.rate-table {
margin: 0;
width: 100%;
thead {
th {
&:first-child {
padding-left: 10px;
}
}
}
tbody {
th {
padding-left: 10px;
}
}
&-padding {
thead {
th {
......
......@@ -274,6 +274,7 @@ export default {
}
this.xyqbAuthState = localStorage.get("xyqbAuthState");
this.selfInfoReadonly = nameMask && idNoMask && phoneNoMask;
this.getFamilyList();
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