Commit 2b8eed7a authored by 郭志伟's avatar 郭志伟 Committed by 郝聪敏

style: 产品列表数据调整

parent d0100803
......@@ -13,107 +13,88 @@ import life from "@/assets/images/user/life@2x.png";
export default [
{
title: "住院医疗险",
sub: "报销医药费,有无社保均可保",
children: [
{
id: 1,
itype: "mi",
img: good01,
title: "万家保·百万医疗险",
sub: "产品优势",
glory: "好评榜第1名",
price: "0",
unit: "",
allow: true,
termType: "short",
icon_closed: medical_closed,
icon: medical,
guarantee_title: "医疗保障",
guarantee_sub: "看病报销医药费,最高600万"
}
]
id: 1,
itype: "mi",
scope: [1, 2, 3], // 范围,列表中区分类型用,1成人 2老年 3少儿
img: good01,
title: "万家保·百万医疗险",
sub: "产品优势",
glory: "好评榜第1名",
price: "0",
unit: "",
allow: true,
termType: "short",
icon_closed: medical_closed,
icon: medical,
guarantee_title: "医疗保障",
guarantee_sub: "看病报销医药费,最高600万"
},
{
title: "重大疾病险",
sub: "责任内疾病确诊即赔",
children: [
{
id: 2,
itype: "cii",
img: good02,
title: "万家保·重疾轻症险",
sub: "100种重疾+40种轻症",
glory: "",
price: "3",
unit: "首月",
allow: true,
termType: "short",
icon_closed: illness_closed,
icon: illness,
guarantee_title: "重疾保障",
guarantee_sub: "100种重症+40种轻症"
},
{
id: 3,
itype: "cii",
img: good02,
title: "康惠保2020终身重疾险",
sub: "100种重疾+40种轻症",
glory: "",
price: "3",
unit: "首月",
allow: true,
termType: "long",
icon_closed: illness_closed,
icon: illness,
guarantee_title: "重疾保障",
guarantee_sub: "100种重症+40种轻症"
}
]
id: 2,
itype: "cii",
scope: [1, 2, 3],
img: good02,
title: "万家保·重疾轻症险",
sub: "100种重疾+40种轻症",
glory: "",
price: "3",
unit: "首月",
allow: true,
termType: "short",
icon_closed: illness_closed,
icon: illness,
guarantee_title: "重疾保障",
guarantee_sub: "100种重症+40种轻症"
},
{
title: "意外伤害险",
sub: "意外保障无等待期",
children: [
{
id: 4,
itype: "ai",
img: good03,
title: "万家保·综合意外险",
sub: "产品优势",
glory: "开车必备",
price: "0",
unit: "",
allow: true,
termType: "short",
icon_closed: casualty_closed,
icon: casualty,
guarantee_title: "意外保障",
guarantee_sub: "意外风险覆盖全,最高100万保额"
}
]
id: 3,
itype: "cii",
scope: [1, 2],
img: good02,
title: "康惠保2020终身重疾险",
sub: "100种重疾+40种轻症",
glory: "",
price: "3",
unit: "首月",
allow: true,
termType: "long",
icon_closed: illness_closed,
icon: illness,
guarantee_title: "重疾保障",
guarantee_sub: "100种重症+40种轻症"
},
{
title: "人寿保险",
sub: "家庭顶梁柱必备",
children: [
{
id: 5,
itype: "li",
img: good04,
title: "华贵大麦2020定期寿险",
sub: "产品优势",
glory: "",
price: "0",
unit: "",
allow: true,
termType: "long",
icon_closed: life_closed,
icon: life,
guarantee_title: "人寿保障",
guarantee_sub: "最高350万保额,顶梁柱必备"
}
]
id: 4,
itype: "ai",
scope: [1, 2, 3],
img: good03,
title: "万家保·综合意外险",
sub: "产品优势",
glory: "开车必备",
price: "0",
unit: "",
allow: true,
termType: "short",
icon_closed: casualty_closed,
icon: casualty,
guarantee_title: "意外保障",
guarantee_sub: "意外风险覆盖全,最高100万保额"
},
{
id: 5,
itype: "li",
scope: [1, 3],
img: good04,
title: "华贵大麦2020定期寿险",
sub: "产品优势",
glory: "",
price: "0",
unit: "",
allow: true,
termType: "long",
icon_closed: life_closed,
icon: life,
guarantee_title: "人寿保障",
guarantee_sub: "最高350万保额,顶梁柱必备"
}
];
import req from "@/service/http";
// 产品列表
export const list = param => {
return req.get("product/list", param);
};
// 产品详情
export const addPolicyDetail = param => {
return req.get("product/detail", param);
};
// 产品算价
export const trail = param => {
return req.post("product/price/trail", param);
};
// 下单流程
export const placeOrder = {
// 创建保单订单
......
<template>
<div class="goods-list">
<div v-if="hasChildren">
<template v-for="(item, index) in list">
<template v-for="(item, index) in goodsList">
<div class="goods-list-head" :key="'head' + index">
<slot :data="item">
<h5>{{ item.title || "-" }}</h5>
......@@ -44,7 +44,7 @@
type="flex"
class="goods-list-item"
:class="{ 'not-allow': !it.allow }"
v-for="(it, idx) in list"
v-for="(it, idx) in goodsList"
:key="idx"
@click.native="clickItem(it)"
>
......@@ -80,12 +80,28 @@ export default {
default() {
return [];
}
},
sort: {
type: Number,
default: 0
}
},
computed: {
// TODO
hasChildren: function() {
return this.list[0] && this.list[0].children && this.list[0].children.length > 0;
},
goodsList() {
const { sort, list, hasChildren } = this;
if (sort === 0) {
return list;
} else {
if (hasChildren) {
return list;
} else {
return list.filter(item => item.scope.includes(sort));
}
}
}
},
methods: {
......
......@@ -36,7 +36,29 @@ export default {
return {
active: 0,
showLayer: false,
goodsList: []
goodsList: [],
goodsLists: [
{
title: "住院医疗险",
sub: "报销医药费,有无社保均可保",
children: []
},
{
title: "重大疾病险",
sub: "责任内疾病确诊即赔",
children: []
},
{
title: "意外伤害险",
sub: "意外保障无等待期",
children: []
},
{
title: "人寿保险",
sub: "家庭顶梁柱必备",
children: []
}
]
};
},
mounted() {
......
......@@ -42,7 +42,7 @@
* @return:
*/
import { loginByPhone, getwxOpenId } from "@/api/user";
import { placeOrder } from "@/api/order";
import { placeOrder } from "@/api/product";
import cfg from "@/config";
import { payByWay } from "@/service/pay";
let pollTimer = null;
......
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