Commit d4e822bc authored by 郭志伟's avatar 郭志伟 Committed by 郭志伟

fix: 追加顾问剩余份数接口

parent 3e668e0a
import req from "@/service/http";
// 获取顾问剩余份数
export const getRemainNum = () => {
return req.get("consultant/surplusNum");
};
// 创建顾问订单
export const create = param => {
return req.post("consultant/order/create", param);
......
......@@ -175,6 +175,9 @@
}
}
&-list {
background-color: @gray-1;
border-radius: @border-radius-md;
padding: 0 14px;
&-item {
margin-bottom: 5px;
}
......@@ -207,14 +210,13 @@
&-content {
color: @gray-5;
font-size: @font-size-12;
background-color: @gray-1;
background-color: #FBFCFF;
border-radius: @border-radius-md;
padding: 16px;
padding: 16px 9px;
line-height: @line-height-sm + 2;
.svg-icon {
height: 13px;
width: 13px;
margin-right: 2px;
height: 12px;
width: 12px;
}
&-item {
display: flex;
......@@ -226,10 +228,11 @@
}
&-title {
font-weight: @font-weight-bold;
color: @orange-dark;
}
&-txt {
margin-left: 8px;
width: 216px;
color: @black;
}
}
}
......
......@@ -27,7 +27,7 @@
stroke-width="6"
color="#FFC842"
track-color="#F9F3F3"
:percentage="25"
:percentage="remainPercentage"
/>
</div>
</div>
......@@ -48,7 +48,7 @@
<card title="想买保险,你是不是也有这些疑问?">
<cr-image src="@/assets/images/consultant/intro.png" width="100%" height="auto" />
</card>
<card title="芒果保险·1对1保险顾问来帮您?">
<card title="芒果保险·1对1保险顾问来帮您">
<div class="cul-odds-sign">
<div class="cul-odds-sign-item" v-for="(item, index) in oddsList" :key="index">
<svg-icon :icon-class="item.icon" />
......@@ -84,11 +84,11 @@ import localStorage from "@/service/localStorage";
import { payByWay } from "@/service/pay";
import { isXyqb } from "@/service/validation";
import { mapActions, mapState } from "vuex";
import { create, goPay } from "@/api/consultant";
import { create, goPay, getRemainNum } from "@/api/consultant";
import Card from "@/components/Card";
import Collapse from "@/components/Collapse";
import CpsQa from "../../Goods/Detail/modules/CpsQA";
const SUM = 300;
export default {
name: "ConsultantBuy",
components: {
......@@ -144,7 +144,7 @@ export default {
]
},
{
title: "省钱",
title: "投保后",
children: [["协助理赔:", "申请理赔时,理赔专家全程协助"]]
}
],
......@@ -202,7 +202,10 @@ export default {
};
},
computed: {
...mapState(["isShowLogin"])
...mapState(["isShowLogin"]),
remainPercentage() {
return Math.floor((this.remain / SUM) * 100);
}
},
watch: {
isShowLogin(val) {
......@@ -230,15 +233,11 @@ export default {
this.generateOrder();
}
},
updateRemain() {
let historyRemain = localStorage.get("historyRemain");
if (historyRemain && +historyRemain > 100) {
historyRemain--;
} else {
historyRemain = Math.floor(Math.random() * (200 - 100) + 100);
async updateRemain() {
const res = await getRemainNum();
if (res) {
this.remain = res;
}
this.remain = historyRemain;
localStorage.set("historyRemain", historyRemain);
},
async generateOrder() {
const res = await create();
......
......@@ -57,7 +57,7 @@
</div>
<cr-divider :style="{ marginBottom: 0 }" />
</card>
<card title="芒果保险·1对1保险顾问来帮您?">
<card title="芒果保险·1对1保险顾问来帮您">
<div class="cul-odds-list">
<div class="cul-odds-list-item" v-for="(item, index) in oddsInsureList" :key="index">
<div class="cul-odds-list-title">
......@@ -126,7 +126,7 @@ export default {
]
},
{
title: "省钱",
title: "投保后",
children: [["协助理赔:", "申请理赔时,理赔专家全程协助"]]
}
]
......
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