Commit 90023f66 authored by 郭志伟's avatar 郭志伟 Committed by 郝聪敏

feat: 详情基础数据更新

parent 04344062
......@@ -4,7 +4,7 @@
* @Description: 华贵大麦2020定期寿险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-06 16:09:06
* @LastEditTime: 2020-08-07 15:20:28
*/
import goodsBg from "@/assets/images/goods/detail/shouxian/bg.png";
......@@ -66,14 +66,14 @@ export default {
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
],
medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
{ label: "", value: "2" }
{ label: "", value: "0" }
],
paywayOptions: [
{ label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" },
......
......@@ -4,7 +4,7 @@
* @Description:华太30万轻重疾险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-05 16:36:29
* @LastEditTime: 2020-08-07 16:06:43
*/
import goodsBg from "@/assets/images/goods/detail/zhongjixian/bg.png";
......@@ -55,19 +55,19 @@ export default {
}
],
planCellInfo: {
"3": [
"300000": [
{ title: "100种重大疾病医疗保险金", value: "30万" },
{ title: "40种轻症保险金", value: "6万" },
{ title: "投保年龄", value: "30天~50周岁" },
{ title: "保险期限", value: "1年" }
],
"2": [
"200000": [
{ title: "100种重大疾病医疗保险金", value: "20万" },
{ title: "40种轻症保险金", value: "4万" },
{ title: "投保年龄", value: "30天~60周岁" },
{ title: "保险期限", value: "1年" }
],
"1": [
"100000": [
{ title: "100种重大疾病医疗保险金", value: "10万" },
{ title: "40种轻症保险金", value: "2万" },
{ title: "投保年龄", value: "30天~60周岁" },
......@@ -76,22 +76,22 @@ export default {
},
planTipOptions: ["轻症赔付后,重疾保障继续有效", "可逐年续保至99岁"],
planOptions: [
{ label: "30万", value: "3" },
{ label: "20万", value: "2" },
{ label: "10万", value: "1" }
{ label: "30万", value: "300000" },
{ label: "20万", value: "200000" },
{ label: "10万", value: "100000" }
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
],
paywayOptions: [
{ label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" },
{ label: "一次交清", value: "2" }
],
noticeCellInfo: {
"3": [
"300000": [
{ title: "投保年龄", value: `30天~50周岁` },
{ title: "保障期限", value: "1年(可续保至99周岁)" },
{ title: "等待期", value: "90天" },
......@@ -104,7 +104,7 @@ export default {
}
}
],
"2": [
"200000": [
{ title: "投保年龄", value: `30天~60周岁` },
{ title: "保障期限", value: "1年(可续保至99周岁)" },
{ title: "等待期", value: "90天" },
......@@ -117,7 +117,7 @@ export default {
}
}
],
"1": [
"100000": [
{ title: "投保年龄", value: `30天~60周岁` },
{ title: "保障期限", value: "1年(可续保至99周岁)" },
{ title: "等待期", value: "90天" },
......
......@@ -4,7 +4,7 @@
* @Description: 泰康600万医疗保障
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-06 11:46:46
* @LastEditTime: 2020-08-07 15:20:37
*/
import goodsBg from "@/assets/images/goods/detail/yiliaoxian/bg.png";
......@@ -66,14 +66,14 @@ export default {
],
planTipOptions: ["不限社保", "报销自费药", "额外400万特定赔付"],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
],
medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
{ label: "", value: "2" }
{ label: "", value: "0" }
],
paywayOptions: [
{ label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" },
......
......@@ -4,7 +4,7 @@
* @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-06 14:22:44
* @LastEditTime: 2020-08-07 16:25:27
*/
import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png";
......@@ -55,7 +55,7 @@ export default {
}
],
planCellInfo: {
"10": [
"1000000": [
{ title: "意外身故", value: "100万" },
{ title: "意外伤残", value: "100万" },
{ title: "意外医疗", value: "10万" },
......@@ -67,7 +67,7 @@ export default {
{ title: "火车意外", value: "100万" },
{ title: "轮船意外", value: "100万" }
],
"5": [
"500000": [
{ title: "意外身故", value: "50万" },
{ title: "意外伤残", value: "50万" },
{ title: "意外医疗", value: "5万" },
......@@ -79,7 +79,7 @@ export default {
{ title: "火车意外", value: "50万" },
{ title: "轮船意外", value: "50万" }
],
"1": [
"100000": [
{ title: "意外身故", value: "10万" },
{ title: "意外伤残", value: "10万" },
{ title: "意外医疗", value: "5000" },
......@@ -94,28 +94,28 @@ export default {
},
planTipOptions: ["10天内全额退保", "在线理赔", "最高可赔400万"],
planOptions: [
{ label: "100万", value: "10" },
{ label: "50万", value: "5" },
{ label: "10万", value: "1" }
{ label: "100万", value: "1000000" },
{ label: "50万", value: "500000" },
{ label: "10万", value: "100000" }
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
],
noticeCellInfo: {
"10": [
"1000000": [
{ title: "投保年龄", value: `18周岁~65周岁` },
{ title: "保障期限", value: "1年" },
{ title: "保费", value: "53元/年起" }
],
"5": [
"500000": [
{ title: "投保年龄", value: `18周岁~65周岁` },
{ title: "保障期限", value: "1年" },
{ title: "保费", value: "53元/年起" }
],
"1": [
"100000": [
{ title: "投保年龄", value: `18周岁~65周岁` },
{ title: "保障期限", value: "1年" },
{ title: "保费", value: "53元/年起" }
......
......@@ -13,7 +13,7 @@ import life from "@/assets/images/user/life@2x.png";
export default [
{
id: 1,
id: "TKYLX001",
itype: "mi", // 保险类型,英文收字母缩写,详情需要传
scope: [1, 2, 3], // 范围,列表中区分类型用,1成人 2老年 3少儿
img: good01,
......@@ -30,7 +30,7 @@ export default [
guarantee_sub: "看病报销医药费,最高600万"
},
{
id: 2,
id: "HTDQZJX001",
itype: "cii",
scope: [1, 2, 3],
img: good02,
......@@ -47,10 +47,11 @@ export default [
guarantee_sub: "100种重症+40种轻症"
},
{
id: 3,
id: "BNZJX001",
itype: "cii",
scope: [1, 3],
img: good02,
url: "http://www.baidu.com",
title: "百年康惠保(2.0)重大疾病险",
sub: "终身保障155种重疾,最多赔付6次",
glory: "",
......@@ -64,7 +65,7 @@ export default [
guarantee_sub: "100种重症+40种轻症"
},
{
id: 4,
id: "ZAYWX001",
itype: "ai",
scope: [1, 2, 3],
img: good03,
......@@ -81,7 +82,7 @@ export default [
guarantee_sub: "意外风险覆盖全,最高100万保额"
},
{
id: 5,
id: "HGSX001",
itype: "li",
scope: [1, 2],
img: good04,
......
......@@ -93,7 +93,15 @@ export default {
if (!item.allow) {
return;
}
this.$router.push({ path: "/goods/detail", query: { id: item.id, type: item.itype } });
if (item.url) {
window.location.href = item.url;
} else {
const { id, itype } = item;
this.$router.push({
path: "/goods/detail",
query: { id, type: itype }
});
}
}
}
};
......
import GOODS_LIST from "@/api/goodsList.mock";
import { getUserInfo, getFamilyList } from "@/api/user";
import { getPolicyList } from "@/api/policy";
import _ from "lodash";
const CONSTANT = {
avatar: {
......@@ -45,32 +46,32 @@ export default {
}
},
actions: {
async setFamilyList({ commit }) {
async setFamilyList({ commit }, policyList) {
let familyList = await getFamilyList();
const policyList = await getPolicyList();
familyList = familyList.concat(familyList);
if (!policyList) {
policyList = await getPolicyList();
}
let goodsMap = _.groupBy(GOODS_LIST, "itype");
// todo 家人保单列表筛选
const result = familyList.map(family => ({
...family,
avatar: +family.gender === 0 ? CONSTANT.avatar.man : CONSTANT.avatar.woman,
relation: getReletion(family.relation, family.gender),
policyList: GOODS_LIST.map(goods => {
// todo 家人保单列表推荐
const filterPolicyList = policyList
.map(policy => {
const goodsChild = goods.children.find(child => child.id === +policy.productNo) || {};
return {
...policy,
...goodsChild
};
})
.filter(policy => policy.insuredUserSecId === family.userInfoSecId && policy.id)
appellation: getReletion(family.relation, family.gender),
policyList: _.values(
_.mapValues(goodsMap, goodsList => {
const policyListFilted = policyList
.filter(
policy =>
_.some(goodsList, { id: +policy.productNo }) &&
+family.userInfoSecId === +policy.insuredUserSecId
)
.map(policy => ({ ...policy, ..._.find(goodsList, { id: +policy.productNo }) }))
.sort((a, b) => a.termType > b.termType);
return filterPolicyList?.[0] || goods.children[0];
return policyListFilted?.[0] || goodsList[0];
})
)
}));
commit("setFamilyList", result);
},
......
......@@ -88,7 +88,7 @@ import NavTab from "./modules/NavTab";
import detailPayMixin from "./modules/detailPay.mixin";
import Detail from "@/api/detail.zhongan.yiwai";
import { detail, trail } from "@/api/product";
import { trail, list } from "@/api/product";
export default {
name: "GoodsDetail-AI",
......@@ -129,7 +129,7 @@ export default {
name: "",
idNo: "",
socialSecurity: "1",
insured: "1",
relation: "0",
type: "1",
planValue: "10",
auto: false,
......@@ -141,6 +141,7 @@ export default {
watch: {
headerInfo: {
deep: true,
immediate: true,
handler(val) {
const { price } = val;
this.goodActionInfo = { title: price };
......@@ -217,10 +218,14 @@ export default {
},
async getDetail() {
this.goodId = this.$route.query.id;
const res = await detail({ productNo: this.goodId });
const res = await list();
if (res) {
this.headerInfo.price[0] = res.price;
this.headerInfo.company = res.companyName;
res.forEach(item => {
if (item.id === this.goodId) {
this.headerInfo.price[0] = item.downPayPrice;
this.headerInfo.insuredNum = item.sellCount;
}
});
}
},
async calFee({ name, idNo }) {
......
......@@ -4,7 +4,7 @@
<detail-header :det="headerInfo" />
<div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
<cr-radio-btn v-model="formData.planValue" :radio-data="planOptions" />
<cr-radio-btn v-model="formData.amountInsured" :radio-data="planOptions" />
<compactCellGroup :cell-data="planCellData" :text-bold="true" />
<plan-tip :tip-list="planTipOptions" />
</card>
......@@ -85,7 +85,7 @@ import ProtocolRead from "./modules/ProtocolRead";
import NavTab from "./modules/NavTab";
import Detail from "@/api/detail.huatai.zhongjixian";
import { detail, trail } from "@/api/product";
import { trail, list } from "@/api/product";
export default {
name: "GoodsDetail-CII",
......@@ -125,9 +125,9 @@ export default {
name: "",
idNo: "",
socialSecurity: "1",
insured: "1",
type: "1",
planValue: "3",
relation: "0",
payType: "1",
amountInsured: "300000",
auto: false,
autoRenewPolicy: true
},
......@@ -137,6 +137,7 @@ export default {
watch: {
headerInfo: {
deep: true,
immediate: true,
handler(val) {
const { price, subPrice } = val;
this.goodActionInfo = {
......@@ -155,11 +156,11 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { name, idNo, type } = val;
const { name: oldName, idNo: oldNo, type: oldType } = oldVal;
if (name === oldName && idNo === oldNo && type === oldType) return;
const { idNo, payType } = val;
const { idNo: oldNo, payType: oldType } = oldVal;
if (idNo === oldNo && payType === oldType) return;
this.calTimer = setTimeout(() => {
this.calFee({ name, idNo, type });
this.calFee();
}, 600);
}
}
......@@ -171,13 +172,13 @@ export default {
},
planCellData() {
const { planCellInfo } = this;
const { planValue } = this.formData;
return planCellInfo[planValue];
const { amountInsured } = this.formData;
return planCellInfo[amountInsured];
},
noticeCellData() {
const { noticeCellInfo } = this;
const { planValue } = this.formData;
return noticeCellInfo[planValue];
const { amountInsured } = this.formData;
return noticeCellInfo[amountInsured];
},
personFormOptions() {
const { insuredOptions, paywayOptions } = this;
......@@ -215,18 +216,34 @@ export default {
},
async getDetail() {
this.goodId = this.$route.query.id;
const res = await detail({ productNo: this.goodId });
const res = await list();
if (res) {
this.headerInfo.price[0] = res.firstMonthPrice;
this.headerInfo.subPrice[0] = res.price;
this.headerInfo.company = res.companyName;
res.forEach(item => {
if (item.id === this.goodId) {
this.headerInfo.price[0] = res.downPayPrice;
this.headerInfo.subPrice[0] = res.regularPrice;
this.headerInfo.insuredNum = item.sellCount;
}
});
}
},
async calFee({ name, idNo, type }) {
async calFee() {
let { price, subPrice } = this.headerInfo;
const res = await trail({ name, idNo, type, productNo: this.goodId });
const { idNo, socialSecurity, payType, amountInsured } = this.formData;
const _param = {
productNo: this.goodId,
productUserInfo: {
idNo,
socialSecurity,
payType
},
productItem: {
amountInsured
}
};
const res = await trail(_param);
if (res) {
price[0] = res.firstPrice;
price[0] = res.downPayPrice;
subPrice[0] = res.regularPrice;
this.goodActionInfo = {
title: price,
......
......@@ -106,7 +106,7 @@ import ProtocolRead from "./modules/ProtocolRead";
import NavTab from "./modules/NavTab";
import Detail from "@/api/detail.huagui.shouxian";
import { detail, trail } from "@/api/product";
import { trail, list } from "@/api/product";
export default {
name: "GoodsDetail-LI",
......@@ -150,6 +150,7 @@ export default {
},
headerInfo: {
deep: true,
immediate: true,
handler(val) {
const { price } = val;
this.goodActionInfo = { title: price };
......@@ -180,7 +181,7 @@ export default {
}
},
mounted() {
this.getDetail();
// this.getDetail();
},
methods: {
openIframePupop(index) {
......@@ -204,10 +205,14 @@ export default {
},
async getDetail() {
this.goodId = this.$route.query.id;
const res = await detail({ productNo: this.goodId });
const res = await list();
if (res) {
this.headerInfo.price[0] = res.price;
this.headerInfo.company = res.companyName;
res.forEach(item => {
if (item.id === this.goodId) {
this.headerInfo.price[0] = res.downPayPrice;
this.headerInfo.insuredNum = item.sellCount;
}
});
}
},
async calFee() {
......
......@@ -45,7 +45,7 @@
:url="pupopData.url"
>
<cps-process-detail v-if="currentPupopIndex === 5" :process-data="processDetail" />
<cps-rate v-if="currentPupopIndex === 6" />
<cps-rate v-if="currentPupopIndex === 6" :rate-data="rateInfo" />
</popup-with-iframe>
<go-insure-dialog
v-model="goInsureState"
......@@ -84,7 +84,7 @@ import ProtocolRead from "./modules/ProtocolRead";
import NavTab from "./modules/NavTab";
import detailPayMixin from "./modules/detailPay.mixin";
import { detail, trail } from "@/api/product";
import { trail, list } from "@/api/product";
import Detail from "@/api/detail.taikang.yiliaobaozhang";
export default {
......@@ -127,7 +127,7 @@ export default {
name: "",
idNo: "",
socialSecurity: "1",
insured: "1",
relation: "0",
type: "1",
planValue: "3",
auto: false,
......@@ -139,6 +139,7 @@ export default {
watch: {
headerInfo: {
deep: true,
immediate: true,
handler(val) {
const { price, subPrice } = val;
this.goodActionInfo = {
......@@ -195,7 +196,7 @@ export default {
}
},
mounted() {
this.getDetail();
// this.getDetail();
},
methods: {
openIframePupop(index) {
......@@ -223,11 +224,15 @@ export default {
},
async getDetail() {
this.goodId = this.$route.query.id;
const res = await detail({ productNo: this.goodId });
const res = await list();
if (res) {
this.headerInfo.price[0] = res.firstMonthPrice;
this.headerInfo.subPrice[0] = res.price;
this.headerInfo.company = res.companyName;
res.forEach(item => {
if (item.id === this.goodId) {
this.headerInfo.price[0] = res.downPayPrice;
this.headerInfo.subPrice[0] = res.regularPrice;
this.headerInfo.insuredNum = item.sellCount;
}
});
}
},
async calFee({ name, idNo, socialSecurity, type }) {
......
......@@ -39,14 +39,15 @@
</cr-cell-group>
<h6 class="insure-form-title">为谁投保</h6>
<cr-radio-btn
v-model="formData.insured"
v-model="formData.relation"
@input="relationChange"
:radio-data="radioOptions.insuredOptions"
class="insured"
/>
<cr-cell-group class="insure-form">
<cr-field
name="relativeName"
v-if="formData.insured !== '1'"
v-if="formData.relation !== '0'"
v-model="formData.name"
placeholder="请输入被保人姓名"
label="姓名"
......@@ -54,7 +55,7 @@
/>
<cr-field
name="relativeIdNo"
v-if="formData.insured !== '1'"
v-if="formData.relation !== '0'"
v-model="formData.idNo"
placeholder="信息保密,仅用于投保"
label="身份证号"
......@@ -74,7 +75,7 @@
<cr-cell title="缴费方式" class="insure-form-item_nobg" v-if="radioOptions.paywayOptions">
<cr-radio-btn
name="type"
v-model="formData.type"
v-model="formData.payType"
:radio-data="radioOptions.paywayOptions"
/>
</cr-cell>
......@@ -124,9 +125,11 @@ export default {
}
},
formData: {
immediate: true,
deep: true,
handler(val) {
this.$emit(DATA_CHANGE_EVENT, val);
this.$forceUpdate();
}
},
showAuthXyqb: {
......@@ -141,17 +144,41 @@ export default {
this.$forceUpdate();
}
}
},
familyList() {
this.relationChange();
}
},
computed: {
...mapState(["showAuthXyqb"])
...mapState(["showAuthXyqb"]),
...mapState("user", ["familyList"])
},
mounted() {
this.setFamilyList();
},
methods: {
...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setFamilyList"]),
inputClick() {
if (this.showAuthXyqb === 1) {
this.setAuthXyqb(2);
}
},
relationChange(relation = this.formData.relation) {
const userArray = this.familyList.filter(item => item.relation === +relation);
if (userArray.length > 0) {
this.formData.name = userArray[0].nameMask;
this.formData.idNo = userArray[0].idNoMask;
this.formData.socialSecurity = userArray[0].socialSecurity ? "1" : "0";
if (relation === "0") {
this.formData.selfName = userArray[0].nameMask;
this.formData.selfIdNo = userArray[0].idNoMask;
}
} else {
this.formData.name = "";
this.formData.idNo = "";
this.formData.socialSecurity = "0";
}
}
}
};
......
......@@ -96,11 +96,11 @@ export default {
if (res) {
goodsList.forEach(item => {
res.forEach(it => {
item.id = "AKFSFA1421523151";
if (it.title === item.title) {
item.id = it.productNo ?? item.id;
item.price = it.priceDesc ?? item.price;
if (it.productNo === item.id) {
item.price = it.downPayPrice ?? item.price;
item.regularPrice = it.regularPrice ?? 0;
item.sellCount = it.sellCount ?? 0;
// item.title = it.title ?? item.title;
}
});
});
......
......@@ -156,7 +156,7 @@
>
<div class="form-unit" slot="button">公斤</div>
</cr-field>
<template v-if="formData.insuredUserInfo.relation !== '1'">
<template v-if="formData.insuredUserInfo.relation !== '0'">
<cr-field
v-model="formData.insuredUserInfo.name"
name="insuredUserInfo.name"
......@@ -386,13 +386,13 @@ export default {
],
socialSecOptions: [
{ label: "有社保", value: "1" },
{ label: "无社保", value: "2" }
{ label: "无社保", value: "0" }
],
insuredOptions: [
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
],
termOptions: [
{ label: "10年", value: "1" },
......@@ -410,18 +410,18 @@ export default {
{ label: "交5年", value: "1" },
{ label: "交10年", value: "2" },
{ label: "交20年", value: "3" },
{ label: "交30年", value: "4" },
{ label: "一次付清", value: "5" }
{ label: "交30年", value: "4" }
// { label: "一次付清", value: "5" }
],
insuredAmountOptions: [
{ label: "30万", value: "30" },
{ label: "50万", value: "50" },
{ label: "100万", value: "100" },
{ label: "150万", value: "150" },
{ label: "200万", value: "200" },
{ label: "250万", value: "250" },
{ label: "300万", value: "300" },
{ label: "350万", value: "350" }
{ label: "30万", value: "300000" },
{ label: "50万", value: "500000" },
{ label: "100万", value: "1000000" },
{ label: "150万", value: "15000000" },
{ label: "200万", value: "2000000" },
{ label: "250万", value: "2500000" },
{ label: "300万", value: "3000000" },
{ label: "350万", value: "3500000" }
]
};
},
......
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