Commit d097ebb0 authored by 郭志伟's avatar 郭志伟

fix(投保为确认阅读协议弹框,已确认直接下一步;未算价不能提交): 未算价不能提交;投保确认后不用弹框

parent a21bf51d
let protocol = window.location.protocol; let protocol = window.location.protocol;
export default { export default {
basicHost: "http://yapi.quantgroups.com/mock/329/", // basicHost: "http://yapi.quantgroups.com/mock/329/",
// basicHost: "https://hathaway-mg.liangkebang.net/", basicHost: "https://hathaway-mg.liangkebang.net/",
// basicHost: "http://192.168.29.211:8964/", // basicHost: "http://192.168.29.211:8964/",
wxAppId: "wx514de17b23d53a20", wxAppId: "wx514de17b23d53a20",
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, // 神策数据请求地址 shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, // 神策数据请求地址
......
...@@ -141,9 +141,10 @@ export default { ...@@ -141,9 +141,10 @@ export default {
payType: "1", payType: "1",
amountInsured: "1000000", amountInsured: "1000000",
autoRenewPolicy: false, autoRenewPolicy: false,
read: true read: false
}, },
goInsureState: false goInsureState: false,
isCalPrice: false
}; };
}, },
watch: { watch: {
...@@ -222,6 +223,10 @@ export default { ...@@ -222,6 +223,10 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
if (!this.isCalPrice) {
this.$notify({ type: "warn", message: "被保人年龄不在可投保范围,请仔细核对" });
return;
}
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.$refs.insureForm.getFamilyList_I().then(() => { this.$refs.insureForm.getFamilyList_I().then(() => {
this.getIsRead(); this.getIsRead();
...@@ -338,15 +343,20 @@ export default { ...@@ -338,15 +343,20 @@ export default {
} }
} }
}; };
const res = await trail(_param); try {
if (res) { const res = await trail(_param);
price[0] = res.downPayPrice; if (res) {
price[1] = "元/年"; price[0] = res.downPayPrice;
this.goodActionInfo = { price[1] = "元/年";
title: price this.goodActionInfo = {
}; title: price
this.goodBuyModalInfo = [{ title: `每年保费`, value: `${price[0]}元` }]; };
noticeCellInfo[amountInsured][2].value = `${price[0] + price[1]}`; this.goodBuyModalInfo = [{ title: `每年保费`, value: `${price[0]}元` }];
noticeCellInfo[amountInsured][2].value = `${price[0] + price[1]}`;
}
this.isCalPrice = true;
} catch (error) {
this.isCalPrice = false;
} }
} }
} }
......
...@@ -138,9 +138,10 @@ export default { ...@@ -138,9 +138,10 @@ export default {
payType: "1", payType: "1",
amountInsured: "300000", amountInsured: "300000",
autoRenewPolicy: false, autoRenewPolicy: false,
read: true read: false
}, },
goInsureState: false goInsureState: false,
isCalPrice: false
}; };
}, },
watch: { watch: {
...@@ -281,6 +282,10 @@ export default { ...@@ -281,6 +282,10 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
if (!this.isCalPrice) {
this.$notify({ type: "warn", message: "被保人年龄不在可投保范围,请仔细核对" });
return;
}
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.$refs.insureForm.getFamilyList_I().then(() => { this.$refs.insureForm.getFamilyList_I().then(() => {
this.getIsRead(); this.getIsRead();
...@@ -363,27 +368,31 @@ export default { ...@@ -363,27 +368,31 @@ export default {
} }
} }
}; };
try {
const res = await trail(_param); const res = await trail(_param);
if (res) { if (res) {
price[2] = payType === "2" ? "" : "首月"; price[2] = payType === "2" ? "" : "首月";
price[0] = res.downPayPrice; price[0] = res.downPayPrice;
subPrice[1] = "元/月"; subPrice[1] = "元/月";
subPrice[0] = payType === "2" ? "" : res.regularPrice; subPrice[0] = payType === "2" ? "" : res.regularPrice;
this.goodActionInfo = { this.goodActionInfo = {
title: price, title: price,
sub: subPrice[0] ? subPrice : "" sub: subPrice[0] ? subPrice : ""
}; };
this.goodBuyModalInfo = [ this.goodBuyModalInfo = [
{ title: `${price[2]}保费`, value: `${price[0]}${price[1]}` }, { title: `${price[2]}保费`, value: `${price[0]}${price[1]}` },
{ {
title: `${subPrice[2]}保费`, title: `${subPrice[2]}保费`,
value: subPrice[0] ? `${subPrice[0]}${subPrice[1]}${subPrice[3]}` : "" value: subPrice[0] ? `${subPrice[0]}${subPrice[1]}${subPrice[3]}` : ""
} }
]; ];
noticeCellInfo[amountInsured][3].value.tpl = `保费与保额、被保人年龄有关<br />${price[2] + noticeCellInfo[amountInsured][3].value.tpl = `保费与保额、被保人年龄有关<br />${price[2] +
price[0] + price[0] +
price[1]}${subPrice[0] ? subPrice[2] + subPrice[0] + subPrice[1] : ""}`; price[1]}${subPrice[0] ? subPrice[2] + subPrice[0] + subPrice[1] : ""}`;
}
this.isCalPrice = true;
} catch (error) {
this.isCalPrice = false;
} }
} }
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
:options="[]" :options="[]"
:text-bold="true" :text-bold="true"
v-model="read" v-model="read"
:show-radio="false"
:cell-data="noticeCellInfo" :cell-data="noticeCellInfo"
@cell-click="openIframePupop" @cell-click="openIframePupop"
> >
......
...@@ -140,10 +140,11 @@ export default { ...@@ -140,10 +140,11 @@ export default {
payType: "1", payType: "1",
planValue: "3", planValue: "3",
autoRenewPolicy: false, autoRenewPolicy: false,
read: true read: false
}, },
goodActionShow: false, goodActionShow: false,
goInsureState: false goInsureState: false,
isCalPrice: false
}; };
}, },
watch: { watch: {
...@@ -217,6 +218,10 @@ export default { ...@@ -217,6 +218,10 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
if (!this.isCalPrice) {
this.$notify({ type: "warn", message: "被保人年龄不在可投保范围,请仔细核对" });
return;
}
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
socialSecurityCache = this.formData.socialSecurity; socialSecurityCache = this.formData.socialSecurity;
this.$refs.insureForm.getFamilyList_I().then(() => { this.$refs.insureForm.getFamilyList_I().then(() => {
...@@ -347,26 +352,31 @@ export default { ...@@ -347,26 +352,31 @@ export default {
} }
} }
}; };
const res = await trail(_param); try {
if (res) { const res = await trail(_param);
price[2] = payType === "2" ? "" : "首月"; if (res) {
price[0] = res.downPayPrice; price[2] = payType === "2" ? "" : "首月";
subPrice[0] = payType === "2" ? "" : res.regularPrice; price[0] = res.downPayPrice;
subPrice[1] = "元/月"; subPrice[0] = payType === "2" ? "" : res.regularPrice;
this.goodActionInfo = { subPrice[1] = "元/月";
title: price, this.goodActionInfo = {
sub: subPrice[0] ? subPrice : "" title: price,
}; sub: subPrice[0] ? subPrice : ""
this.goodBuyModalInfo = [ };
{ title: `${price[2]}保费`, value: `${price[0]}${price[1]}` }, this.goodBuyModalInfo = [
{ { title: `${price[2]}保费`, value: `${price[0]}${price[1]}` },
title: `${subPrice[2]}保费`, {
value: subPrice[0] ? `${subPrice[0]}${subPrice[1]}${subPrice[3]}` : "" title: `${subPrice[2]}保费`,
} value: subPrice[0] ? `${subPrice[0]}${subPrice[1]}${subPrice[3]}` : ""
]; }
this.noticeCellInfo[3].value.tpl = `保费于被保人年龄、有无社保有关<br />${price[2] + ];
price[0] + this.noticeCellInfo[3].value.tpl = `保费于被保人年龄、有无社保有关<br />${price[2] +
price[1]}${subPrice[0] ? subPrice[2] + subPrice[0] + subPrice[1] : ""}`; price[0] +
price[1]}${subPrice[0] ? subPrice[2] + subPrice[0] + subPrice[1] : ""}`;
}
this.isCalPrice = true;
} catch (error) {
this.isCalPrice = false;
} }
} }
} }
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
<slot></slot> <slot></slot>
<template v-slot:footer> <template v-slot:footer>
<div class="insure-form-pact" slot="footer"> <div class="insure-form-pact" slot="footer">
<cr-field name="pact"> <cr-field name="pact" v-show="showRadio">
<template #input> <template #input>
<cr-checkbox shape="round" icon-size="13px" v-model="pact" checked-color="#FFC842"> <cr-checkbox shape="round" icon-size="13px" v-model="pact" checked-color="#FFC842">
投保前请阅读 投保前请阅读
</cr-checkbox> </cr-checkbox>
</template> </template>
</cr-field> </cr-field>
<div v-show="!showRadio"></div>
<div class="insure-form-pact-link"> <div class="insure-form-pact-link">
<a <a
href="javascript:;" href="javascript:;"
...@@ -50,6 +51,10 @@ export default { ...@@ -50,6 +51,10 @@ export default {
return ["查看完整费率表"]; return ["查看完整费率表"];
} }
}, },
showRadio: {
type: Boolean,
default: true
},
protocolData: { protocolData: {
type: Array, type: Array,
default() { default() {
......
...@@ -586,7 +586,7 @@ export default { ...@@ -586,7 +586,7 @@ export default {
goodBuyModalInfo: [], goodBuyModalInfo: [],
mongoToken: localStorage.get("mongoToken"), mongoToken: localStorage.get("mongoToken"),
policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"), policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
pact: true, pact: false,
formData: { formData: {
insuredUserInfo: { insuredUserInfo: {
relation: "", relation: "",
...@@ -794,13 +794,20 @@ export default { ...@@ -794,13 +794,20 @@ export default {
this.onRelationCancel(); this.onRelationCancel();
}, },
onFormSubmit() { onFormSubmit() {
this.goInsureState = true; this.getIsRead();
}, },
onFormFailed(errorInfo) { onFormFailed(errorInfo) {
console.log(errorInfo); console.log(errorInfo);
const { errors } = errorInfo; const { errors } = errorInfo;
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
getIsRead() {
if (this.pact) {
this.nextStep();
} else {
this.goInsureState = true;
}
},
nextStep() { nextStep() {
this.subFormData = JSON.parse(JSON.stringify(this.formData)); this.subFormData = JSON.parse(JSON.stringify(this.formData));
const { socialSecurity, longTerm, relation } = this.subFormData.insuredUserInfo; const { socialSecurity, longTerm, relation } = this.subFormData.insuredUserInfo;
......
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