Commit 312d71e6 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/policy_fix' into 'master'

Fix:

See merge request !58
parents 2f4d9ed6 f3cbcd3f
......@@ -40,6 +40,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
.loading {
padding: 6px;
border-radius: 6px;
......
......@@ -4,7 +4,7 @@
* @Description: 华贵大麦2020定期寿险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-19 14:07:08
* @LastEditTime: 2020-08-20 14:51:17
*/
import goodsBg from "@/assets/images/goods/detail/shouxian/bg.png";
......
......@@ -4,7 +4,7 @@
* @Description:华太30万轻重疾险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-12 15:58:44
* @LastEditTime: 2020-08-20 10:34:05
*/
import goodsBg from "@/assets/images/goods/detail/zhongjixian/bg.png";
......@@ -83,8 +83,8 @@ export default {
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "父母", value: "2" },
{ label: "配偶", value: "3" },
{ label: "子女", value: "4" }
],
paywayOptions: [
......
......@@ -4,7 +4,7 @@
* @Description: 泰康600万医疗保障
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-12 16:40:46
* @LastEditTime: 2020-08-20 10:33:55
*/
import goodsBg from "@/assets/images/goods/detail/yiliaoxian/bg.png";
......@@ -72,8 +72,8 @@ export default {
planTipOptions: ["不限社保", "报销自费药", "额外400万特定赔付"],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "父母", value: "2" },
{ label: "配偶", value: "3" },
{ label: "子女", value: "4" }
],
medicalOptions: [
......
......@@ -4,7 +4,7 @@
* @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-18 16:24:31
* @LastEditTime: 2020-08-20 10:33:46
*/
import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png";
......@@ -101,8 +101,8 @@ export default {
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "父母", value: "2" },
{ label: "配偶", value: "3" },
{ label: "子女", value: "4" }
],
noticeCellInfo: {
......
export default {
basicHost: "http://yapi.quantgroups.com/mock/329/",
// basicHost: "http://yapi.quantgroups.com/mock/329/",
basicHost: "https://hathaway-mg.liangkebang.net/",
// basicHost: "http://192.168.29.211:8964/",
wxAppId: "wx514de17b23d53a20"
};
......@@ -2,7 +2,7 @@
* @Description: autoSaveForm mixins
* @LastEditors: gzw
* @Date: 2019-08-14 15:53:37
* @LastEditTime: 2020-08-14 16:16:58
* @LastEditTime: 2020-08-20 13:49:26
*/
import localStorage from "@/service/localStorage";
......@@ -28,6 +28,9 @@ export default {
hasAutoSaveData(key) {
return !!localStorage.get(key);
},
getSaveParams(key) {
return localStorage.get(key);
},
getSaveInfoHandler(key, target) {
this[target] = localStorage.get(key);
this.$forceUpdate();
......
......@@ -69,6 +69,15 @@ export function isIdNo(str) {
return false;
}
// 判断输入的字符是否为中文姓名最少两个中文字符
export function isChineseName(str) {
if (!isNull(str)) {
const reg = /^[\u0391-\uFFE5]{2,}$/;
return reg.test(str);
}
return false;
}
// 判断输入的字符是否以数字开头
export function isStartWithInteger(str) {
if (!isNull(str)) {
......@@ -258,6 +267,16 @@ export function isBankNumber(str) {
return false;
}
// 判断中文地址不能少于5个汉字,且必须有一位数字
export function isChnAddress(str) {
const isNum = /[0-9]\d*/;
const isChinese_var = /[\u0391-\uFFE5]{5,}/g;
if (!isNull(str)) {
return isNum.test(str) && isChinese_var.test(str);
}
return false;
}
// 判断微信环境
export const isWeixinBrower = window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger";
// 判断信用钱包环境
......
......@@ -109,60 +109,6 @@ export default {
{ title: "重疾险", price: "50万" },
{ title: "意外险", price: "60万" },
{ title: "寿险", price: "350万" }
],
overviewList: [
{
id: 1,
goods: "国民保·百万医疗险",
type: "mi",
title: "医疗险",
amount: "600万",
range: "1年",
way: "趸交",
price: "350元",
goodsPirce: "3000",
goodsUnit: "元/每年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
},
{
id: 2,
goods: "康惠保2020终身重疾险",
type: "cii",
title: "重疾险",
amount: "50万",
range: "终身",
way: "20年",
price: "6000元",
goodsPirce: "6000",
goodsUnit: "元/每年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
},
{
id: 3,
goods: "国民保·百万意外险",
type: "ai",
title: "意外险",
amount: "50万",
range: "1年",
way: "趸交",
price: "350元",
goodsPirce: "3000",
goodsUnit: "元/每年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
},
{
id: 4,
goods: "国民保·百万寿险",
type: "li",
title: "寿险",
amount: "350万",
range: "保至70岁",
way: "20年",
price: "3725元",
goodsPirce: "3000",
goodsUnit: "元/每年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
}
]
};
},
......
......@@ -170,7 +170,13 @@ export default {
const { idNo: oldidNo, amountInsured: oldamountInsured, selfIdNo: oldselfIdNo } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!isIdNo(idNoWho) && idNoWho === oldidNoWho && amountInsured === oldamountInsured) {
if (
idNoWho &&
idNoWho.indexOf("************") === -1 &&
!isIdNo(idNoWho) &&
idNoWho === oldidNoWho &&
amountInsured === oldamountInsured
) {
return;
}
this.calTimer = setTimeout(() => {
......@@ -268,7 +274,7 @@ export default {
payType,
autoRenewPolicy
} = this.formData;
this.subFromData = {
this.subFormData = {
insuredUserInfo: {
userInfoSecId: userInfoSecId ?? null,
name,
......
......@@ -139,7 +139,7 @@ export default {
name: "",
idNo: "",
relation: "",
payType: "2",
payType: "1",
amountInsured: "300000",
autoRenewPolicy: false,
read: true
......@@ -186,12 +186,52 @@ export default {
oldidNoWho = oldidNo;
}
if (this.goInsureState) {
sessionStorage.setItem(
"policyFormData",
JSON.stringify(Object.assign(this.formData, { productNo: this.goodId }))
);
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);
} else {
subFormDataCache.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
}
sessionStorage.setItem("policyFormData", JSON.stringify(subFormDataCache));
}
if (
idNoWho &&
idNoWho.indexOf("************") === -1 &&
!isIdNo(idNoWho) &&
idNoWho === oldidNoWho &&
payType === oldpayType &&
......
......@@ -117,7 +117,6 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import Detail from "@/api/detail.huagui.shouxian";
import { trail, list } from "@/api/product";
export default {
name: "GoodsDetail-LI",
components: {
......@@ -143,7 +142,7 @@ export default {
mixins: [detailLoginMixin],
data() {
return {
...Detail,
...JSON.parse(JSON.stringify(Detail)),
goodId: "",
calTimer: null,
goodActionInfo: {},
......
......@@ -140,7 +140,7 @@ export default {
idNo: "",
socialSecurity: "",
relation: "",
payType: "2",
payType: "1",
planValue: "3",
autoRenewPolicy: false,
read: true
......@@ -161,7 +161,10 @@ export default {
};
this.goodBuyModalInfo = [
{ title: `${price[2]}保费`, value: `${price[0]}${price[1]}` },
{ title: `${subPrice[2]}保费`, value: `${subPrice[0]}${subPrice[1]}${subPrice[3]}` }
{
title: `${subPrice[2]}保费`,
value: `${subPrice[0]}${subPrice[1]}${subPrice[3]}`
}
];
}
},
......@@ -175,7 +178,13 @@ export default {
const { idNo: oldidNo, selfIdNo: oldselfIdNo } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!isIdNo(idNoWho) && idNoWho === oldidNoWho) return;
if (
idNoWho &&
idNoWho.indexOf("************") === -1 &&
!isIdNo(idNoWho) &&
idNoWho === oldidNoWho
)
return;
this.calTimer = setTimeout(() => {
this.calFee();
}, 1000);
......@@ -246,7 +255,7 @@ export default {
this.generateOrder();
},
generateFormData() {
const subFromData = JSON.parse(JSON.stringify(this.formData));
const subFormData = JSON.parse(JSON.stringify(this.formData));
const {
userInfoSecId,
name,
......@@ -260,8 +269,8 @@ export default {
selfSecId,
payType,
autoRenewPolicy
} = subFromData;
this.subFromData = {
} = subFormData;
this.subFormData = {
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
......@@ -275,17 +284,17 @@ export default {
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
this.subFromData.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
this.subFromData.productItem.socialSecurity = !!Number(selfSocialSecurity);
this.subFormData.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
this.subFormData.productItem.socialSecurity = !!Number(selfSocialSecurity);
} else {
this.subFromData.insuredUserInfo = {
this.subFormData.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
this.subFromData.productItem.socialSecurity = !!Number(socialSecurity);
this.subFormData.productItem.socialSecurity = !!Number(socialSecurity);
}
},
async getDetail() {
......
......@@ -7,7 +7,7 @@ import { mapActions } from "vuex";
export default {
data() {
return {
subFromData: {}, // 组装好的数据
subFormData: {}, // 组装好的数据
orderInfo: {},
openId: localStorage.get("openId"),
tradeType: "",
......@@ -22,7 +22,7 @@ export default {
...mapActions(["setIsLoading"]),
async generateOrder() {
const res = await placeOrder.create({
...this.subFromData
...this.subFormData
});
if (res) {
this.orderInfo = res;
......
......@@ -11,7 +11,13 @@
请如实告知
<strong>被保人</strong> 是否有以下情形之一
</span>
<iframe class="inform-frame" :src="url" frameborder="0" height="100%"></iframe>
<iframe
class="inform-frame"
:src="url"
frameborder="0"
height="100%"
v-if="refreshIframe"
></iframe>
</card>
<div class="inform-btns">
<cr-button @click="$router.back()">不符合</cr-button>
......@@ -31,58 +37,25 @@ export default {
},
data() {
return {
formData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
subFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
orderInfo: {},
refreshIframe: true,
tradeType: "JSAPI",
url: "http://mangguo-contract.qthbx.com/huatai-jian-kang-gao-zhi-v1/"
};
},
mounted() {
this.url = this.$route.query.url || this.url;
this.refreshIframe = false;
setTimeout(() => {
this.refreshIframe = true;
}, 1000);
},
methods: {
conform() {
// this.$router.push(`/policy/detail/123`);
this.generateFormData();
// this.generateFormData();
this.generateOrder();
},
generateFormData() {
const subFromData = JSON.parse(JSON.stringify(this.formData));
const {
userInfoSecId,
name,
idNo,
relation,
socialSecurity,
selfSocialSecurity,
selfName,
selfIdNo,
selfPhone,
selfSecId,
payType,
autoRenewPolicy
} = subFromData;
this.subFromData = {
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
userInfoSecId: selfSecId ? selfSecId : null,
name: selfName,
idNo: selfIdNo
},
productItem: {
payType
},
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
this.subFromData.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
} else {
this.subFromData.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
}
}
}
};
......
This diff is collapsed.
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