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

feat: 详情基础数据更新

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