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

style: 产品列表数据调整

parent d0100803
...@@ -12,13 +12,10 @@ import illness from "@/assets/images/user/illness@2x.png"; ...@@ -12,13 +12,10 @@ import illness from "@/assets/images/user/illness@2x.png";
import life from "@/assets/images/user/life@2x.png"; import life from "@/assets/images/user/life@2x.png";
export default [ export default [
{
title: "住院医疗险",
sub: "报销医药费,有无社保均可保",
children: [
{ {
id: 1, id: 1,
itype: "mi", itype: "mi",
scope: [1, 2, 3], // 范围,列表中区分类型用,1成人 2老年 3少儿
img: good01, img: good01,
title: "万家保·百万医疗险", title: "万家保·百万医疗险",
sub: "产品优势", sub: "产品优势",
...@@ -31,16 +28,11 @@ export default [ ...@@ -31,16 +28,11 @@ export default [
icon: medical, icon: medical,
guarantee_title: "医疗保障", guarantee_title: "医疗保障",
guarantee_sub: "看病报销医药费,最高600万" guarantee_sub: "看病报销医药费,最高600万"
}
]
}, },
{
title: "重大疾病险",
sub: "责任内疾病确诊即赔",
children: [
{ {
id: 2, id: 2,
itype: "cii", itype: "cii",
scope: [1, 2, 3],
img: good02, img: good02,
title: "万家保·重疾轻症险", title: "万家保·重疾轻症险",
sub: "100种重疾+40种轻症", sub: "100种重疾+40种轻症",
...@@ -57,6 +49,7 @@ export default [ ...@@ -57,6 +49,7 @@ export default [
{ {
id: 3, id: 3,
itype: "cii", itype: "cii",
scope: [1, 2],
img: good02, img: good02,
title: "康惠保2020终身重疾险", title: "康惠保2020终身重疾险",
sub: "100种重疾+40种轻症", sub: "100种重疾+40种轻症",
...@@ -69,16 +62,11 @@ export default [ ...@@ -69,16 +62,11 @@ export default [
icon: illness, icon: illness,
guarantee_title: "重疾保障", guarantee_title: "重疾保障",
guarantee_sub: "100种重症+40种轻症" guarantee_sub: "100种重症+40种轻症"
}
]
}, },
{
title: "意外伤害险",
sub: "意外保障无等待期",
children: [
{ {
id: 4, id: 4,
itype: "ai", itype: "ai",
scope: [1, 2, 3],
img: good03, img: good03,
title: "万家保·综合意外险", title: "万家保·综合意外险",
sub: "产品优势", sub: "产品优势",
...@@ -91,16 +79,11 @@ export default [ ...@@ -91,16 +79,11 @@ export default [
icon: casualty, icon: casualty,
guarantee_title: "意外保障", guarantee_title: "意外保障",
guarantee_sub: "意外风险覆盖全,最高100万保额" guarantee_sub: "意外风险覆盖全,最高100万保额"
}
]
}, },
{
title: "人寿保险",
sub: "家庭顶梁柱必备",
children: [
{ {
id: 5, id: 5,
itype: "li", itype: "li",
scope: [1, 3],
img: good04, img: good04,
title: "华贵大麦2020定期寿险", title: "华贵大麦2020定期寿险",
sub: "产品优势", sub: "产品优势",
...@@ -114,6 +97,4 @@ export default [ ...@@ -114,6 +97,4 @@ export default [
guarantee_title: "人寿保障", guarantee_title: "人寿保障",
guarantee_sub: "最高350万保额,顶梁柱必备" 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