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

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

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