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

style: 产品列表数据调整

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