Commit cf3a2b25 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/consultant' into 'master'

Feature/consultant

See merge request !29
parents e576e898 2b8eed7a
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve --open",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"report": "vue-cli-service build --report",
"release": "vue-cli-service build", "release": "vue-cli-service build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
......
...@@ -5,17 +5,20 @@ ...@@ -5,17 +5,20 @@
<cr-loading class="loading" size="24px">加载中...</cr-loading> <cr-loading class="loading" size="24px">加载中...</cr-loading>
</div> </div>
<login-modal /> <login-modal />
<auth-from-xyqb v-if="showAuthXyqb !== -1" />
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import LoginModal from "@/components/LoginModal"; import LoginModal from "@/components/LoginModal";
import AuthFromXyqb from "@/components/AuthFromXyqb";
export default { export default {
components: { components: {
LoginModal LoginModal,
AuthFromXyqb
}, },
computed: { computed: {
...mapState(["isLoading"]) ...mapState(["isLoading", "showAuthXyqb"])
}, },
methods: { methods: {
...mapActions(["setIsLoading"]) ...mapActions(["setIsLoading"])
......
import req from "@/service/http";
// 创建顾问订单
export const create = param => {
return req.post("consultant/order/create", param);
};
// 创建顾问订单-发起支付
export const goPay = param => {
return req.post("consultant/order/gopay", param);
};
// 创建顾问订单-提交咨询问卷
export const subCulQus = param => {
return req.post("consultant/questionnaire/submit", param);
};
// 创建顾问订单-顾问建议
export const getCulsuggestion = param => {
return req.get("consultant/suggestion/detail", param);
};
// 查询顾问订单信息
export const getCulOrder = param => {
return req.get("consultant/order/query", param);
};
// 查询顾问订单支付状态
export const getPayState = param => {
return req.post("/consultant/order/pay-state", param);
};
// 获取顾问
export const getCulState = param => {
return req.post("user/consultant", param);
};
...@@ -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 = {
// 创建保单订单 // 创建保单订单
......
...@@ -6,7 +6,7 @@ export const loginByPhone = param => { ...@@ -6,7 +6,7 @@ export const loginByPhone = param => {
}; };
// 信用钱包用户自动登录 // 信用钱包用户自动登录
export const loginByxyqb = param => { export const authByxyqb = param => {
return req.get("xyqb_user_info", param); return req.get("xyqb_user_info", param);
}; };
......
<?xml version="1.0" encoding="utf-8"?>
<svg width="19px" height="24px" viewBox="0 0 19 24" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<desc>Created with Lunacy</desc>
<g id="编组-16">
<g id="Group-4">
<g id="编组-6备份-2" transform="translate(0 5.49753)">
<path d="M14.7907 8.12161C14.928 7.5971 15.0011 7.04668 15.0011 6.47923C15.0011 2.90085 12.0944 0 8.5087 0C5.37816 0 2.76513 2.21116 2.1522 5.15389C1.94346 6.06961 1.97458 6.74032 2.00379 7.37005C2.05333 8.43799 2.09741 9.38809 0.956865 11.2155C-1.04322 14.4201 -0.0668537 17.7948 5.40055 17.3018C9.34282 16.9463 14.0045 12.609 14.7907 8.12161Z" transform="translate(0.01797025 0)" id="形状结合备份" fill="#FFC842" fill-rule="evenodd" stroke="none" />
</g>
<g id="编组-9" transform="matrix(0.9063078 -0.4226183 0.4226183 0.9063078 10.52739 1.996085)">
<path d="M2.55122 2.85733C3.31589 1.52494 3.1481 1.37214e-13 3.1481 1.37214e-13C3.1481 1.37214e-13 -0.22388 1.52175 0.0159214 4.82779C0.0159214 4.82779 1.78654 4.18971 2.55122 2.85733Z" transform="translate(0.1109306 0.04346367)" id="路径-10" fill="#6EA372" stroke="none" />
<path d="M1.69558 1.90091C2.27613 0.973579 2.17791 1.51344e-14 2.17791 1.51344e-14C2.17791 1.51344e-14 -0.0543487 0.926454 0.00135625 3.22707C0.00135625 3.22707 1.11504 2.82824 1.69558 1.90091Z" transform="matrix(0.6427876 0.7660444 -0.7660444 0.6427876 3.112117 3.625421)" id="路径-10备份" fill="#6EA372" stroke="none" />
</g>
</g>
<path d="M4.41006 0.364952C4.44825 0.128299 4.67106 -0.0325839 4.90771 0.00560971C5.14436 0.0438034 5.30525 0.26661 5.26705 0.503263C4.86031 3.02353 3.29455 4.90914 0.614453 6.13307C0.396399 6.23265 0.138907 6.13661 0.0393278 5.91856C-0.0602516 5.7005 0.0357906 5.44301 0.253844 5.34343C2.68135 4.23485 4.05186 2.58437 4.41006 0.364952Z" transform="matrix(0.8746197 -0.4848096 0.4848096 0.8746197 7.804443 11.72031)" id="路径-12" fill="#FFFFFF" stroke="none" />
</g>
</svg>
\ No newline at end of file
<template>
<cr-popup v-model="showAuth" get-container="body" position="bottom" class="auth-popup">
<div class="auth">
<div class="auth-title">
<svg-icon icon-class="mongo" />
<strong>芒果保险</strong>申请获取
</div>
<div class="auth-list">
<div class="auth-item" v-for="(item, index) in userInfo" :key="index">
<div class="auth-item-title">你的{{ item.label }}</div>
<div class="auth-item-info">
<strong>{{ item.value }}</strong>
信用钱包绑定{{ item.label }}
</div>
<cr-divider />
</div>
</div>
<div class="auth-protocol">
允许即表示同意
<a href>《用户协议》</a>
<a href>《隐私政策》</a>
</div>
<div class="auth-foot">
<cr-button class="wx-default" @click="setAuthXyqb(3)">拒绝</cr-button>
<cr-button class="wx-primary" @click="setAuthXyqb(4)">允许</cr-button>
</div>
</div>
</cr-popup>
</template>
<script>
import { mapState, mapActions } from "vuex";
import localStorage from "@/service/localStorage";
const xyqbUserInfo = localStorage.get("xyqbUserInfo") || {};
export default {
name: "AuthFromXyqb",
data() {
return {
showAuth: true,
userInfo: [
{
label: "手机号码",
value: xyqbUserInfo.phoneNoMask
},
{
label: "姓名",
value: xyqbUserInfo.nameMask
},
{
label: "身份证号码",
value: xyqbUserInfo.idNoMask
}
]
};
},
watch: {
showAuthXyqb: {
immediate: true,
handler(val) {
this.showAuth = val === 2;
}
}
},
computed: {
...mapState(["showAuthXyqb"])
},
methods: {
...mapActions(["setAuthXyqb"])
}
};
</script>
<style lang="less" scoped>
@import "../style/var.less";
@import "../style/mixins.less";
.auth {
padding: 30px 20px;
&-popup {
border-top-left-radius: @border-radius-sm;
border-top-right-radius: @border-radius-sm;
}
&-title {
color: @black;
font-size: @font-size-16;
padding: 2px 0 26px;
.svg-icon {
width: 18px;
height: 18px;
}
strong {
font-weight: @font-weight-bold;
margin: 0 10px 0 12px;
}
}
&-list {
margin-bottom: -8px;
}
&-item {
&-title {
font-size: 24px;
font-weight: @font-weight-bold;
color: @black;
line-height: @line-height-lg;
margin: 20px 0;
}
&-info {
.sub-text-mixins();
font-size: 14px;
strong {
font-size: 16px;
font-weight: @font-weight-bold;
color: @black;
}
}
}
&-protocol {
.sub-text-mixins();
margin: 20px 0;
}
&-foot {
display: flex;
justify-content: space-between;
.cr-button {
width: 160px;
height: 40px;
line-height: 40px;
font-size: 18px;
border-radius: 4px !important;
}
.wx-default {
color: #00be57 !important;
}
.wx-primary {
background-color: #09c060 !important;
color: #fff !important;
}
}
}
</style>
<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: {
......
...@@ -82,10 +82,12 @@ export default { ...@@ -82,10 +82,12 @@ export default {
this.formData.loginChannel = isWeixinBrower ? 1 : 2; this.formData.loginChannel = isWeixinBrower ? 1 : 2;
this.formData.openId = localStorage.getItem("openId") || null; this.formData.openId = localStorage.getItem("openId") || null;
const res = await loginByPhone(this.formData); const res = await loginByPhone(this.formData);
if (res.code === "0") { if (res) {
this.$notify("登录成功"); this.$notify("登录成功");
this.setIsShowLogin(false); this.setIsShowLogin(false);
localStorage.setItem("mongoToken", res.data.token); // localStorage.setItem("mongoToken", res.token);
// TODO 开发目前使用这个token
localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
} }
}, },
async getCode() { async getCode() {
...@@ -97,7 +99,7 @@ export default { ...@@ -97,7 +99,7 @@ export default {
return; return;
} }
const res = await getCaptchaSms({ phoneNo }); const res = await getCaptchaSms({ phoneNo });
if (res.code === "0" && !this.timer) { if (res && !this.timer) {
this.count = TIME_COUNT; this.count = TIME_COUNT;
this.showCount = true; this.showCount = true;
this.timer = setInterval(() => { this.timer = setInterval(() => {
......
export default { export default {
basicHost: "http://yapi.quantgroups.com/mock/329/", basicHost: "http://yapi.quantgroups.com/mock/329/",
// basicHost: "http://192.168.29.211:80/",
wxAppId: "wx514de17b23d53a20" wxAppId: "wx514de17b23d53a20"
}; };
export default { export default {
basicHost: "http://127.0.0.1:8964/", basicHost: "http://192.168.29.211:80/",
// basicHost: "http://127.0.0.1:8964/",
// basicHost: "https://hathaway-mg.liangkebang.net/", // basicHost: "https://hathaway-mg.liangkebang.net/",
wxAppId: "wx514de17b23d53a20" wxAppId: "wx514de17b23d53a20"
}; };
...@@ -17,5 +17,6 @@ new Vue({ ...@@ -17,5 +17,6 @@ new Vue({
}).$mount("#app"); }).$mount("#app");
// if (process.env.NODE_ENV !== "development") { // if (process.env.NODE_ENV !== "development") {
// new vConsole(); // ! 上线后务必取掉
// new vConsole();
// } // }
...@@ -4,7 +4,7 @@ const { Notify } = cherry; ...@@ -4,7 +4,7 @@ const { Notify } = cherry;
export default { export default {
methods: { methods: {
onFailed(errorInfo) { onFailed(errorInfo) {
Notify(errorInfo?.errors?.[0]?.message || '校验失败') Notify(errorInfo?.errors?.[0]?.message || "校验失败");
} }
} }
}; };
\ No newline at end of file
import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import routes from "./routes";
import { parseSearch } from "@/service/utils";
import { isXyqb, isWeixinBrower } from "@/service/validation";
import cfg from "@/config";
import { authByxyqb, getwxOpenId } from "@/api/user";
import localStorage from "@/service/localStorage";
Vue.use(VueRouter); Vue.use(VueRouter);
const routes = [
{
path: "/",
name: "Default",
redirect: "/goods"
},
{
path: "/home",
name: "Home",
component: () => import("../views/Home/index.vue")
},
{
path: "/home/smart-measure",
name: "SmartMeasure",
component: () => import("../views/Home/SmartMeasure/index.vue")
},
{
path: "/goods",
name: "Goods",
component: () => import("../views/Goods/index.vue")
},
{
path: "/goods/detail",
name: "GoodsDetail",
component: () => import("../views/Goods/Detail/index.vue")
},
{
path: "/goods/plan",
name: "GoodsPlan",
component: () => import("../views/Goods/Plan/index.vue")
},
{
path: "/goods/inform",
name: "GoodsInform",
component: () => import("../views/Goods/Inform/index.vue")
},
{
path: "/consultant",
name: "Consultant",
component: () => import("../views/Consultant/index.vue")
},
{
path: "/consultant/success",
name: "ConsultantSuccess",
component: () => import("../views/Consultant/Success/index.vue")
},
{
path: "/consultant/question",
name: "ConsultantQuestion",
component: () => import("../views/Consultant/Question/index.vue")
},
{
path: "/consultant/exclusive",
name: "ConsultantExclusive",
component: () => import("../views/Consultant/Exclusive/index.vue")
},
{
path: "/consultant/plan",
name: "ConsultantPlan",
component: () => import("../views/Consultant/Plan/index.vue")
},
{
path: "/user",
name: "User",
component: () => import("../views/User/index.vue")
},
{
path: "/user/family",
name: "Family",
component: () => import("../views/User/Family/index.vue")
},
{
path: "/user/family/detail/:id",
name: "Family",
component: () => import("../views/User/Family/Detail/index.vue")
},
{
path: "/user/help-center",
name: "Family",
component: () => import("../views/User/HelpCenter/index.vue")
},
{
path: "/policy",
name: "Policy",
component: () => import("../views/Policy/index.vue")
},
{
path: "/policy/detail",
name: "Detail",
component: () => import("../views/Policy/Detail/index.vue")
},
{
path: "/policy/add",
name: "AddPolicy",
component: () => import("../views/Policy/Add/index.vue")
},
{
path: "/policy/payment-record",
name: "PaymentRecord",
component: () => import("../views/Policy/PaymentRecord/index.vue")
},
{
path: "/policy/renewal",
name: "Renewal",
component: () => import("../views/Policy/Renewal/index.vue")
},
{
path: "/introduction",
name: "Introduction",
component: () => import("../views/Introduction/index.vue")
},
{
path: "/paytest",
name: "Introduction",
component: () => import("../views/paytest")
},
{
path: "*",
redirect: "/goods"
}
];
const originalPush = VueRouter.prototype.push; const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err); return originalPush.call(this, location).catch(err => err);
}; };
...@@ -140,4 +22,29 @@ const router = new VueRouter({ ...@@ -140,4 +22,29 @@ const router = new VueRouter({
} }
}); });
router.beforeEach((to, from, next) => {
const urlParams = parseSearch(window.location.href);
if (isXyqb) getAuthInfo(urlParams.token);
if (isWeixinBrower) getWxOpenId(urlParams.code);
next();
});
async function getAuthInfo(xyqbToken) {
if (localStorage.get("xyqbToken")) return;
const res = await authByxyqb({ xyqbToken });
if (res) {
localStorage.set("mongoToken", res.token);
localStorage.set("xyqbUserInfo", res);
localStorage.set("xyqbToken", xyqbToken);
}
}
async function getWxOpenId(code) {
if (localStorage.get("openId")) return;
const res = await getwxOpenId({ code, appId: cfg.wxAppId });
this.openId = res.openId;
localStorage.set("openId", res.openId);
}
// router.afterEach(() => {});
export default router; export default router;
export default [
{
path: "/",
name: "Default",
redirect: "/goods"
},
{
path: "/home",
name: "Home",
component: () => import("../views/Home/index.vue")
},
{
path: "/home/smart-measure",
name: "SmartMeasure",
component: () => import("../views/Home/SmartMeasure/index.vue")
},
{
path: "/goods",
name: "Goods",
component: () => import("../views/Goods/index.vue")
},
{
path: "/goods/detail",
name: "GoodsDetail",
component: () => import("../views/Goods/Detail/index.vue")
},
{
path: "/goods/plan",
name: "GoodsPlan",
component: () => import("../views/Goods/Plan/index.vue")
},
{
path: "/goods/inform",
name: "GoodsInform",
component: () => import("../views/Goods/Inform/index.vue")
},
{
path: "/consultant",
name: "Consultant",
component: () => import("../views/Consultant/index.vue")
},
{
path: "/consultant/plan",
name: "ConsultantPlan",
component: () => import("../views/Consultant/Plan/index.vue")
},
{
path: "/user",
name: "User",
component: () => import("../views/User/index.vue")
},
{
path: "/user/family",
name: "Family",
component: () => import("../views/User/Family/index.vue")
},
{
path: "/user/family/detail/:id",
name: "Family",
component: () => import("../views/User/Family/Detail/index.vue")
},
{
path: "/user/help-center",
name: "Family",
component: () => import("../views/User/HelpCenter/index.vue")
},
{
path: "/policy",
name: "Policy",
component: () => import("../views/Policy/index.vue")
},
{
path: "/policy/detail",
name: "Detail",
component: () => import("../views/Policy/Detail/index.vue")
},
{
path: "/policy/add",
name: "AddPolicy",
component: () => import("../views/Policy/Add/index.vue")
},
{
path: "/policy/payment-record",
name: "PaymentRecord",
component: () => import("../views/Policy/PaymentRecord/index.vue")
},
{
path: "/policy/renewal",
name: "Renewal",
component: () => import("../views/Policy/Renewal/index.vue")
},
{
path: "/introduction",
name: "Introduction",
component: () => import("../views/Introduction/index.vue")
},
{
path: "/paytest",
name: "Introduction",
component: () => import("../views/paytest")
},
{
path: "*",
redirect: "/goods"
}
];
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
* @Description: 支付微信h5, jsapi, 第三方收银台,跳转) * @Description: 支付微信h5, jsapi, 第三方收银台,跳转)
* @Date: 2020-07-28 15:03:52 * @Date: 2020-07-28 15:03:52
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2020-07-31 10:46:33 * @LastEditTime: 2020-08-04 18:51:12
*/ */
import { Notify } from "@qg/cherry-ui"; import cherry from "@qg/cherry-ui";
import qs from "qs"; import qs from "qs";
const { Notify } = cherry;
/** /**
* payByWeixinJsapi * payByWeixinJsapi
...@@ -15,33 +16,24 @@ import qs from "qs"; ...@@ -15,33 +16,24 @@ import qs from "qs";
* @param {type} * @param {type}
* @return: * @return:
*/ */
function payByWeixinJsapi(info, callback) { function payByWeixinJsapi(info = {}, callback) {
console.log(info);
function onBridgeReady() { function onBridgeReady() {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
WeixinJSBridge.invoke( WeixinJSBridge.invoke("getBrandWCPayRequest", info, function(res) {
"getBrandWCPayRequest", console.log(res);
{ if (res.err_msg == "get_brand_wcpay_request:ok") {
appId: info.appId, //公众号名称,由商户传入 // 使用以上方式判断前端返回,微信团队郑重提示:
timeStamp: info.timeStamp, //时间戳,自1970年以来的秒数 //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
nonceStr: info.nonceStr, //随机串 callback("ok");
package: `prepay_id=${info.prepayId}`, } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
signType: "MD5", //微信签名方式: // 支付取消
paySign: info.sign //微信签名 callback("cancel");
}, } else {
function(res) { // 支付失败
if (res.err_msg == "get_brand_wcpay_request:ok") { callback("fail");
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
callback("ok");
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
// 支付取消
callback("cancel");
} else {
// 支付失败
callback("fail");
}
} }
); });
} }
if (typeof WeixinJSBridge == "undefined") { if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) { if (document.addEventListener) {
...@@ -71,6 +63,8 @@ function payByWeixinH5(info) { ...@@ -71,6 +63,8 @@ function payByWeixinH5(info) {
} }
/** /**
* TODO
*
* payByThirdPartyCashier * payByThirdPartyCashier
* @description: 第三方收银台 * @description: 第三方收银台
* @param {type} * @param {type}
...@@ -86,6 +80,7 @@ function payByThirdPartyCashier(info) { ...@@ -86,6 +80,7 @@ function payByThirdPartyCashier(info) {
/** /**
* @description: 支付方式判断, 返回promise * @description: 支付方式判断, 返回promise
* NATIVE=原生扫码支付.,APP=ap支付,,JSAPI=公众号支付/小程序支付,,MWEB=H5支付.,MICROPAY=刷卡支付,默认JSAPI
* @param {String} type 支付方式,THIRD -> 第三方,MWEB -> H5支付, JSAPI -> jsapi支付,默认支付方式,THIRD * @param {String} type 支付方式,THIRD -> 第三方,MWEB -> H5支付, JSAPI -> jsapi支付,默认支付方式,THIRD
* @param {Object/String} payInfo 支付信息 * @param {Object/String} payInfo 支付信息
* @return {Promise} 回调 * @return {Promise} 回调
......
...@@ -100,23 +100,31 @@ export function filterEmoji(name) { ...@@ -100,23 +100,31 @@ export function filterEmoji(name) {
); );
return str; return str;
} }
/** /**
* xss处理 * hash路由获取url参数
* @param {String} s 输入字符串 * @param {String} searchString 输入字符串
* @return: {String} str 字符串 * @return: {String} str 字符串
*/ */
export function parseSearch(searchString) {
export function xssParse(str) { if (!searchString) {
return str return {};
? str.replace(/&((g|l|quo)t|amp|#39|nbsp);/g, function(m) { }
return { if (!searchString.includes("?")) {
"&lt;": "<", return {};
"&amp;": "&", }
"&quot;": '"', return searchString
"&gt;": ">", .split("?")[1]
"&#39;": "'", .split("#")[0]
"&nbsp;": " " .split("&")
}[m]; .reduce((result, next) => {
}) const pair = next.split("=");
: ""; try {
result[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
} catch (e) {
// eslint-disable-next-line
// result[decodeURIComponent(pair[0])] = window.$URL.decode(pair[1]);
}
return result;
}, {});
} }
...@@ -250,7 +250,6 @@ export function isBankNumber(str) { ...@@ -250,7 +250,6 @@ export function isBankNumber(str) {
} }
// 判断微信环境 // 判断微信环境
export function isWeixinBrower() { export const isWeixinBrower = window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger";
const ua = window.navigator.userAgent.toLowerCase(); // 判断信用钱包环境
return ua.match(/MicroMessenger/i) == "micromessenger"; export const isXyqb = window.navigator.userAgent.toLowerCase().match(/xyqb/i) == "xyqb";
}
import Vue from "vue"; import Vue from "vue";
import Vuex from "vuex"; import Vuex from "vuex";
import user from "./modules/user"; import user from "./modules/user";
import { isXyqb } from "@/service/validation";
import localStorage from "@/service/localStorage";
const XYQB_AUTH_STATE = localStorage.get("xyqbAuthState") || 1;
Vue.use(Vuex); Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
activeIdx: 0, activeIdx: 0,
isLoading: false, isLoading: false,
isShowLogin: false isShowLogin: false,
showAuthXyqb: isXyqb ? XYQB_AUTH_STATE : -1 // 1 已获取信息未授权,2 打开授权弹框, 3 拒绝授权,4 允许授权, -1 非信用钱包环境
}, },
mutations: { mutations: {
setActiveIdx(state, value) { setActiveIdx(state, value) {
...@@ -19,6 +23,10 @@ export default new Vuex.Store({ ...@@ -19,6 +23,10 @@ export default new Vuex.Store({
}, },
setIsShowLogin(state, value) { setIsShowLogin(state, value) {
state.isShowLogin = value; state.isShowLogin = value;
},
setAuthXyqb(state, value) {
state.showAuthXyqb = value;
localStorage.set("xyqbAuthState", value);
} }
}, },
actions: { actions: {
...@@ -30,6 +38,9 @@ export default new Vuex.Store({ ...@@ -30,6 +38,9 @@ export default new Vuex.Store({
}, },
setIsShowLogin({ commit }, args) { setIsShowLogin({ commit }, args) {
commit("setIsShowLogin", args); commit("setIsShowLogin", args);
},
setAuthXyqb({ commit }, args) {
commit("setAuthXyqb", args);
} }
}, },
modules: { modules: {
......
...@@ -54,38 +54,41 @@ input::-webkit-input-placeholder { ...@@ -54,38 +54,41 @@ input::-webkit-input-placeholder {
&--round { &--round {
border-radius: 1em !important; border-radius: 1em !important;
} }
&_light {
background-color: @tag-default-light-background-color !important;
color: @tag-default-light-color !important;
}
&--primary { &--primary {
background-color: @tag-primary-background-color !important; background-color: @tag-primary-background-color !important;
color: @tag-primary-color !important; color: @tag-primary-color !important;
&_light {
background-color: @tag-primary-light-background-color !important;
color: @tag-primary-light-color !important;
}
} }
&--success { &--success {
background-color: @tag-success-background-color !important; background-color: @tag-success-background-color !important;
color: @tag-success-color !important; color: @tag-success-color !important;
&_light {
background-color: @tag-success-light-background-color !important;
color: @tag-success-light-color !important;
}
} }
&--danger { &--danger {
background-color: @tag-danger-background-color !important; background-color: @tag-danger-background-color !important;
color: @tag-danger-color !important; color: @tag-danger-color !important;
&_light {
background-color: @tag-danger-light-background-color !important;
color: @tag-danger-light-color !important;
}
} }
&--warning { &--warning {
background-color: @tag-warning-background-color !important; background-color: @tag-warning-background-color !important;
color: @tag-warning-color !important; color: @tag-warning-color !important;
&_light { }
&--plain {
background-color: @tag-default-light-background-color !important;
color: @tag-default-light-color !important;
&::after {
display: none;
}
&.cr-tag--primary {
background-color: @tag-primary-light-background-color !important;
color: @tag-primary-light-color !important;
}
&.cr-tag--success {
background-color: @tag-success-light-background-color !important;
color: @tag-success-light-color !important;
}
&.cr-tag--danger {
background-color: @tag-danger-light-background-color !important;
color: @tag-danger-light-color !important;
}
&.cr-tag--warning {
background-color: @tag-warning-light-background-color !important; background-color: @tag-warning-light-background-color !important;
color: @tag-warning-light-color !important; color: @tag-warning-light-color !important;
} }
......
@import "../../style/var.less"; @import "../../../style/var.less";
@import "../../style/mixins.less"; @import "../../../style/mixins.less";
.item-show-mixin { .item-show-mixin {
text-align: center; text-align: center;
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
} }
} }
.cul-hd { .cul-hd {
background: url("../../assets/images/consultant/bg.png") top no-repeat; background: url("../../../assets/images/consultant/bg.png") top no-repeat;
background-size: contain; background-size: contain;
padding: 10px 16px; padding: 10px 16px;
position: relative; position: relative;
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
background-color: #fff; background-color: #fff;
&-title { &-title {
.sub-text-mixins(); .sub-text-mixins();
text-align: center;
} }
.cr-button { .cr-button {
height: @button-large-height + 2; height: @button-large-height + 2;
......
This diff is collapsed.
@import "../index.less"; @import "../Buy/index.less";
.container { .container {
background-color: @white; background-color: @white;
} }
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<div class="cul-hd"> <div class="cul-hd">
<div class="cul-hd-info"> <div class="cul-hd-info">
<small>“保险从业多年,口碑极佳”</small> <small>“保险从业多年,口碑极佳”</small>
<h1>李玉婷</h1> <h1>{{ info.name }}</h1>
<cr-tag><svg-icon icon-class="medal" />金牌保险顾问</cr-tag> <cr-tag><svg-icon icon-class="medal" />{{ info.role }}</cr-tag>
<small>执业保险销售资质:</small> <small>执业保险销售资质:</small>
<small>201920000000800<br />02020003828</small> <small v-html="`${info.id.slice(0, 15)}<br />${info.id.slice(15)}`"></small>
</div> </div>
<cr-image <cr-image
class="cul-hd-img" class="cul-hd-img"
...@@ -17,7 +17,15 @@ ...@@ -17,7 +17,15 @@
</div> </div>
<div class="cul-det"> <div class="cul-det">
<card title="" class="cul-card"> <card title="" class="cul-card">
<div class="cul-contact"> <router-link tag="div" class="cul-entry" to="/consultant/plan" v-if="hasSuggestion">
<div class="cul-entry-title">
<h3>您的专属保险方案</h3>
<small>CAPTIVE INSURANC</small>
<cr-tag>自己</cr-tag>
</div>
<svg-icon icon-class="arrow-right" />
</router-link>
<div class="cul-contact" v-else>
<div class="cul-contact-qrcode"> <div class="cul-contact-qrcode">
<cr-image <cr-image
src="@/assets/images/consultant/qrcode-demo.png" src="@/assets/images/consultant/qrcode-demo.png"
...@@ -28,28 +36,20 @@ ...@@ -28,28 +36,20 @@
</div> </div>
<div class="cul-rate"> <div class="cul-rate">
<div class="cul-rate-item"> <div class="cul-rate-item">
<h2>38100</h2> <h2>{{ info.serveNum }}</h2>
<p>已服务用户人</p> <p>已服务用户人</p>
</div> </div>
<div class="cul-rate-item"> <div class="cul-rate-item">
<h2>99.8%</h2> <h2>{{ info.rate }}</h2>
<p>满意度</p> <p>满意度</p>
</div> </div>
</div> </div>
</div> </div>
<router-link tag="div" class="cul-entry" to="/consultant/plan">
<div class="cul-entry-title">
<h3>您的专属保险方案</h3>
<small>CAPTIVE INSURANC</small>
<cr-tag>自己</cr-tag>
</div>
<svg-icon icon-class="arrow-right" />
</router-link>
<div class="cul-tel"> <div class="cul-tel">
<a class="cul-tel-num" href="tel:13888888888"> <a class="cul-tel-num" :href="`tel:${info.tel}`">
<svg-icon icon-class="call" />138 8888 8888 <svg-icon icon-class="call" />{{ info.tel }}
</a> </a>
<div class="cul-time">服务时间 9:00 ~ 21:00</div> <div class="cul-time">服务时间 {{ info.date }}</div>
</div> </div>
<div class="cul-slogan"> <div class="cul-slogan">
<p>“我们的价值:让客户少花钱买好保险”</p> <p>“我们的价值:让客户少花钱买好保险”</p>
...@@ -90,9 +90,25 @@ export default { ...@@ -90,9 +90,25 @@ export default {
Card, Card,
copyright copyright
}, },
props: {
hasSuggestion: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
Info: {}, info: {
name: "李玉婷",
role: "金牌保险顾问",
id: "20192000000080002020003828",
qrcode: "",
avator: "",
serveNum: 38100,
rate: "99.8%",
tel: "13888888888",
date: "9:00 ~ 21:00"
},
oddsInsureList: [ oddsInsureList: [
{ {
title: "投保前", title: "投保前",
......
...@@ -10,21 +10,21 @@ ...@@ -10,21 +10,21 @@
<card title="1"> <card title="1">
<h5 class="cul-hd-card-title" slot="header"> <h5 class="cul-hd-card-title" slot="header">
总保费: 总保费:
<strong>{{ baseInfo.amount }}</strong> <strong>{{ goodInfo.totalAmount }}</strong>
{{ baseInfo.unit }} {{ baseInfo.unit }}
</h5> </h5>
<p class="cul-hd-card-content"> <p class="cul-hd-card-content">
推荐理由: 推荐理由:
{{ baseInfo.reason }} {{ goodInfo.remarks }}
</p> </p>
</card> </card>
</div> </div>
<div class="cul-det"> <div class="cul-det">
<card title="保障分布"> <card title="保障分布">
<div class="cul-dist"> <div class="cul-dist">
<div class="cul-dist-item" v-for="(item, index) in distList" :key="index"> <div class="cul-dist-item" v-for="(item, index) in goodInfo.ensure" :key="index">
<h3>{{ item.price }}</h3> <h3>{{ item.insuredAmount }}</h3>
<p>{{ item.title }}</p> <p>{{ item.productType }}</p>
</div> </div>
</div> </div>
</card> </card>
...@@ -40,39 +40,41 @@ ...@@ -40,39 +40,41 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in overviewList" :key="index"> <tr v-for="(item, index) in goodInfo.ensure" :key="index">
<th>{{ item.title }}</th> <th>{{ item.productType }}</th>
<th>{{ item.amount }}</th> <th>{{ item.insuredAmount }}</th>
<th>{{ item.range }}</th> <th>{{ item.term }}</th>
<th>{{ item.way }}</th> <th>{{ item.paymentPeriod }}</th>
<th>{{ item.price }}</th> <th>{{ item.price || "-" }}</th>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</card> </card>
<card title="保障产品"> <card title="保障产品">
<div class="good-item" v-for="(item, index) in overviewList" :key="index"> <div class="good-item" v-for="(item, index) in goodInfo.ensure" :key="index">
<div class="good-title"> <div class="good-title">
{{ item.goods }} {{ item.productName || "" }}
<cr-tag :type="tagFilter(item.type)">{{ item.title }}</cr-tag> <cr-tag :type="tagFilter(item.productType)" plain>{{ item.productType }}</cr-tag>
</div> </div>
<div class="good-date"> <div class="good-date">
<span class="good-date-item"> <span class="good-date-item">
保额 | <strong>{{ item.amount }}</strong> 保额 | <strong>{{ item.insuredAmount }}</strong>
</span> </span>
<span class="good-date-item"> <span class="good-date-item">
缴费期 | <strong>{{ item.way }}</strong> 缴费期 | <strong>{{ item.paymentPeriod }}</strong>
</span> </span>
<span class="good-date-item"> <span class="good-date-item">
保障期限 | <strong>{{ item.range }}</strong> 保障期限 | <strong>{{ item.term }}</strong>
</span> </span>
</div> </div>
<div class="good-price"> <div class="good-price">
<div class="good-price-item"> <div class="good-price-item">
<strong>{{ item.goodsPirce }}</strong> <strong>{{ item.firstPrice && item.firstPrice.split("")[0] }}</strong>
{{ item.goodsUnit }} {{ item.firstPrice && item.firstPrice.split("")[1] }}
</div> </div>
<cr-button type="warning" @click="goDetail(item.id, item.type)">去投保</cr-button> <cr-button type="warning" @click="goDetail(item.productNo, item.productType)">
去投保
</cr-button>
</div> </div>
<div class="good-reason"> <div class="good-reason">
<div class="good-reason-avator"> <div class="good-reason-avator">
...@@ -91,6 +93,7 @@ ...@@ -91,6 +93,7 @@
<script> <script>
import Card from "@/components/Card"; import Card from "@/components/Card";
import { getCulsuggestion } from "@/api/consultant";
import avator from "@/assets/images/consultant/avator.png"; import avator from "@/assets/images/consultant/avator.png";
export default { export default {
name: "ConsultantSuccess", name: "ConsultantSuccess",
...@@ -100,6 +103,9 @@ export default { ...@@ -100,6 +103,9 @@ export default {
data() { data() {
return { return {
avator, avator,
goodInfo: {
ensure: []
},
baseInfo: { baseInfo: {
userName: "王斌", userName: "王斌",
sex: 1, sex: 1,
...@@ -169,31 +175,39 @@ export default { ...@@ -169,31 +175,39 @@ export default {
] ]
}; };
}, },
mounted() {}, mounted() {
this.getSuggestion();
},
methods: { methods: {
tagFilter(type) { tagFilter(type) {
let _type = ""; let _type = "";
switch (type) { switch (type) {
case "mi": case "医疗":
_type = "warning"; _type = "warning";
break; break;
case "cii": case "重疾":
_type = "danger"; _type = "danger";
break; break;
case "ai": case "意外":
_type = "primary"; _type = "primary";
break; break;
case "li": case "寿险":
_type = "light"; _type = "";
break; break;
default: default:
_type = "light"; _type = "";
break; break;
} }
return _type; return _type;
}, },
goDetail(id, type) { goDetail(id, type) {
this.$router.push({ url: "/goods/detail", query: { id, type } }); this.$router.push({ url: "/goods/detail", query: { id, type } });
},
async getSuggestion() {
const res = await getCulsuggestion();
if (res) {
this.goodInfo = res;
}
} }
} }
}; };
......
...@@ -16,9 +16,15 @@ ...@@ -16,9 +16,15 @@
text-align: center; text-align: center;
a { a {
.sub-text-mixins(); .sub-text-mixins();
display: block;
margin-top: 15px;
} }
} }
&-body { &-body {
height: 230px;
@{deep} .cr-picker--content-choose {
display: none;
}
@{deep} .wheel-item { @{deep} .wheel-item {
font-size: 16px; font-size: 16px;
} }
...@@ -71,6 +77,7 @@ ...@@ -71,6 +77,7 @@
margin-top: 8px; margin-top: 8px;
color: @gray-4; color: @gray-4;
width: 100%; width: 100%;
height: 32px;
} }
.cul-inline { .cul-inline {
@{deep} .cr-radio { @{deep} .cr-radio {
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
</h5> </h5>
<div class="cul-tip">{{ stepTips[currentStep].sub }}</div> <div class="cul-tip">{{ stepTips[currentStep].sub }}</div>
</template> </template>
<cr-form class="cul-hd-card-body" @submit="onSubmit" @failed="onFailed"> <cr-form class="cul-hd-card-body">
<cr-radio-btn <cr-radio-btn
v-model="formData.who" v-model="formData.relation"
class="qus-radio" class="qus-radio"
:radio-data="insuredOptions" :radio-data="insuredOptions"
v-show="currentStep === 0" v-show="currentStep === 0"
...@@ -40,10 +40,11 @@ ...@@ -40,10 +40,11 @@
} }
" "
v-show="currentStep === 1" v-show="currentStep === 1"
item-height="35"
:show-toolbar="false" :show-toolbar="false"
/> />
<cr-radio-btn <cr-radio-btn
v-model="formData.social" v-model="formData.socialSecurity"
:radio-data="hasSocialOptions" :radio-data="hasSocialOptions"
class="qus-radio cul-inline" class="qus-radio cul-inline"
v-show="currentStep === 2" v-show="currentStep === 2"
...@@ -53,10 +54,11 @@ ...@@ -53,10 +54,11 @@
:columns="incomeOptions" :columns="incomeOptions"
@change=" @change="
(picker, value) => { (picker, value) => {
onPickerChange(picker, value, 'income'); onPickerChange(picker, value, 'annualIncome');
} }
" "
v-show="currentStep === 3" v-show="currentStep === 3"
item-height="35"
:show-toolbar="false" :show-toolbar="false"
/> />
<cr-picker <cr-picker
...@@ -68,6 +70,7 @@ ...@@ -68,6 +70,7 @@
} }
" "
v-show="currentStep === 4" v-show="currentStep === 4"
item-height="35"
:show-toolbar="false" :show-toolbar="false"
/> />
<cr-area <cr-area
...@@ -75,21 +78,22 @@ ...@@ -75,21 +78,22 @@
:list="areaList" :list="areaList"
@change=" @change="
(picker, value) => { (picker, value) => {
onPickerChange(picker, value, 'area'); onPickerChange(picker, value, 'addressCode');
} }
" "
:columns-num="2" :columns-num="2"
item-height="35"
v-show="currentStep === 5" v-show="currentStep === 5"
/> />
<cr-radio-btn <cr-radio-btn
v-model="formData.solve" v-model="formData.questionType"
:radio-data="solveOptions" :radio-data="solveOptions"
class="qus-radio cul-inline" class="qus-radio cul-inline"
v-show="currentStep === 6" v-show="currentStep === 6"
/> />
<div class="qus-form" v-show="currentStep === 7"> <div class="qus-form" v-show="currentStep === 7">
<cr-field <cr-field
v-model="formData.username" v-model="formData.userName"
name="姓名" name="姓名"
label="姓名" label="姓名"
placeholder="请输入投保人姓名" placeholder="请输入投保人姓名"
...@@ -101,9 +105,10 @@ ...@@ -101,9 +105,10 @@
label="您的性别" label="您的性别"
:rules="[{ required: true, message: '请选择性别' }]" :rules="[{ required: true, message: '请选择性别' }]"
> >
<cr-radio-btn slot="input" v-model="formData.sex" :radio-data="sexOptions" /> <cr-radio-btn slot="input" v-model="formData.gender" :radio-data="sexOptions" />
</cr-field> </cr-field>
<cr-field <!-- <cr-field
v-if="!isLogin"
v-model="formData.phone" v-model="formData.phone"
type="password" type="password"
name="预留手机" name="预留手机"
...@@ -112,6 +117,7 @@ ...@@ -112,6 +117,7 @@
:rules="[{ required: true, message: '请输入手机号' }]" :rules="[{ required: true, message: '请输入手机号' }]"
/> />
<cr-field <cr-field
v-if="!isLogin"
v-model="formData.code" v-model="formData.code"
name="验证码" name="验证码"
label="验证码" label="验证码"
...@@ -119,11 +125,13 @@ ...@@ -119,11 +125,13 @@
:rules="[{ required: true, message: '输入短信验证码' }]" :rules="[{ required: true, message: '输入短信验证码' }]"
> >
<a href="javascript:;" slot="button">发送验证码</a> <a href="javascript:;" slot="button">发送验证码</a>
</cr-field> </cr-field> -->
</div> </div>
</cr-form> </cr-form>
<div slot="footer" class="cul-hd-card-footer"> <div slot="footer" class="cul-hd-card-footer">
<cr-button type="warning" size="large" block @click="nextQuestion">下一步</cr-button> <cr-button type="warning" size="large" block @click="nextQuestion">
{{ currentStep === 7 ? "提交问卷" : "下一步" }}
</cr-button>
<a href="javascsript:;" @click="prevQuestion" v-show="currentStep > 0">返回上一步</a> <a href="javascsript:;" @click="prevQuestion" v-show="currentStep > 0">返回上一步</a>
</div> </div>
</card> </card>
...@@ -145,7 +153,9 @@ ...@@ -145,7 +153,9 @@
<script> <script>
import CrRadioBtn from "@/components/CrRadioBtn"; import CrRadioBtn from "@/components/CrRadioBtn";
import Card from "@/components/Card"; import Card from "@/components/Card";
import localStorage from "@/service/localStorage";
import areaList from "@qg/cherry-ui/src/area/demo/china"; import areaList from "@qg/cherry-ui/src/area/demo/china";
import { subCulQus } from "@/api/consultant";
export default { export default {
name: "ConsultantQuestion", name: "ConsultantQuestion",
components: { components: {
...@@ -154,65 +164,94 @@ export default { ...@@ -154,65 +164,94 @@ export default {
}, },
data() { data() {
return { return {
isLogin: localStorage.get("mongoToken"),
areaList, areaList,
formData: {}, formData: {
birthday: "",
socialSecurity: "",
annualIncome: "",
loan: "",
addressCode: "111,111,11",
questionType: "",
userName: "",
gender: "",
relation: ""
},
currentStep: 0, currentStep: 0,
showSubState: false, showSubState: false,
stepTips: [ stepTips: [
{ {
title: "您准备为谁买保险?", title: "您准备为谁买保险?",
tag: "relation",
rule: "请选择关系",
sub: sub:
"想为多人买保险的情况,请在和保险顾问沟通时说明信息,保险顾问会为每一位家人量身定制方案哦~~" "想为多人买保险的情况,请在和保险顾问沟通时说明信息,保险顾问会为每一位家人量身定制方案哦~~"
}, },
{ {
title: "请选择TA的出生日期?", title: "请选择TA的出生日期?",
tag: "birthday",
rule: "请选择出生日期",
sub: "出生日期会影响保费计算,准确的填写可让保险顾问帮您更精准的测算保费~" sub: "出生日期会影响保费计算,准确的填写可让保险顾问帮您更精准的测算保费~"
}, },
{ title: "请选择TA有无社保", sub: "新农合也算社保哦~~" }, {
title: "请选择TA有无社保",
tag: "socialSecurity",
rule: "请选择有无社保",
sub: "新农合也算社保哦~~"
},
{ {
title: "请选择您的年收入?", title: "请选择您的年收入?",
tag: "annualIncome",
rule: "请选择您的年收入",
sub: "保险顾问会根据您的年收入,帮您选择合适的额度和保费预算" sub: "保险顾问会根据您的年收入,帮您选择合适的额度和保费预算"
}, },
{ {
title: "请问您每月要还多少贷款呢?", title: "请问您每月要还多少贷款呢?",
tag: "loan",
rule: "请选择贷款",
sub: "贷款包含房贷、车贷、信用卡等,了解您的贷款情况,能让顾问更好的帮您定制寿险额度" sub: "贷款包含房贷、车贷、信用卡等,了解您的贷款情况,能让顾问更好的帮您定制寿险额度"
}, },
{ {
title: "请选择您的居住城市?", title: "请选择您的居住城市?",
tag: "addressCode",
rule: "请选择居住城市",
sub: "保险产品的销售会受到地区的限制,了解您的居住城市能让顾问帮您挑选到合适的保险" sub: "保险产品的销售会受到地区的限制,了解您的居住城市能让顾问帮您挑选到合适的保险"
}, },
{ {
title: "您主要想解决哪方面问题?", title: "您主要想解决哪方面问题?",
tag: "questionType",
rule: "请选择问题类型",
sub: "告诉保险顾问您的咨询意向,可以为您提供更专业的服务哦" sub: "告诉保险顾问您的咨询意向,可以为您提供更专业的服务哦"
}, },
{ {
title: "请填写您的个人信息", title: "请填写您的个人信息",
rule: "请完善个人信息",
sub: "请预留您的信息,保险师会在您方便时联系您" sub: "请预留您的信息,保险师会在您方便时联系您"
} }
], ],
insuredOptions: [ insuredOptions: [
{ label: "本人", value: "1" }, { label: "本人", value: "本人" },
{ label: "配偶", value: "2" }, { label: "配偶", value: "配偶" },
{ label: "儿子", value: "3" }, { label: "儿子", value: "儿子" },
{ label: "女儿", value: "4" }, { label: "女儿", value: "女儿" },
{ label: "父亲", value: "5" }, { label: "父亲", value: "父亲" },
{ label: "母亲", value: "6" } { label: "母亲", value: "母亲" }
], ],
hasSocialOptions: [ hasSocialOptions: [
{ label: "", value: "1" }, { label: "", value: "1" },
{ label: "", value: "2" } { label: "", value: "0" }
], ],
sexOptions: [ sexOptions: [
{ label: "", value: "1" }, { label: "", value: "0" },
{ label: "", value: "2" } { label: "", value: "1" }
], ],
incomeOptions: ["10万", "20万", "25万", "30万"], incomeOptions: ["10万", "20万", "25万", "30万"],
loanOptions: ["无房贷", "1000元", "2000元", "3000元", "4000元"], loanOptions: ["无房贷", "1000元", "2000元", "3000元", "4000元"],
solveOptions: [ solveOptions: [
{ label: "之前从没买过保险,打算配置保险", value: "1" }, { label: "之前从没买过保险,打算配置保险", value: "之前从没买过保险,打算配置保险" },
{ label: "已配置部分保险,打算再补充一些", value: "2" }, { label: "已配置部分保险,打算再补充一些", value: "已配置部分保险,打算再补充一些" },
{ label: "不配置保险,就想咨询些保险疑惑", value: "3" }, { label: "不配置保险,就想咨询些保险疑惑", value: "不配置保险,就想咨询些保险疑惑" },
{ label: "", value: "4" } { label: "", value: "" }
], ],
processList: [ processList: [
{ icon: "package-active", sub: "聘请成功", active: true }, { icon: "package-active", sub: "聘请成功", active: true },
...@@ -241,12 +280,15 @@ export default { ...@@ -241,12 +280,15 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
nextQuestion() { nextQuestion() {
if (this.currentStep === 7) { const { currentStep, stepTips, formData } = this;
const userName = formData.userName && formData.gender;
if (currentStep === 7 && userName) {
this.showSubState = true; this.showSubState = true;
setTimeout(() => { this.onSubmit();
this.showSubState = false; return;
this.$router.push("/consultant/exclusive"); }
}, 3000); if (!formData[stepTips[currentStep].tag] || currentStep === 7) {
this.$notify({ type: "warning", message: stepTips[currentStep].rule });
return; return;
} }
this.currentStep++; this.currentStep++;
...@@ -258,13 +300,24 @@ export default { ...@@ -258,13 +300,24 @@ export default {
this.currentStep--; this.currentStep--;
}, },
onPickerChange(picker, value, type) { onPickerChange(picker, value, type) {
if (type === "birthday") {
value = value.map(item => item[0]).join("-");
}
if (type === "annualIncome" || type === "loan") {
value = value[0];
}
// if (type === "area") {}
this.formData[type] = value; this.formData[type] = value;
}, },
async onSubmit() { async onSubmit() {
// console.log('sucess', values); const { formData } = this;
}, const res = await subCulQus(formData);
onFailed() { if (res) {
// console.log('fail', errorInfo); setTimeout(() => {
this.showSubState = false;
this.$parent.getOrderInfo();
}, 2000);
}
} }
} }
}; };
......
@import "../Success/index.less";
\ No newline at end of file
<template>
<div class="container">
<div class="cul-hd">
<div class="cul-hd-rec">
<h4 class="cul-hd-rec-title">{{ payStateTxt }}</h4>
<!-- <small class="cul-hd-rec-sub"></small> -->
</div>
<card title="1" footer="1">
<div class="cul-hd-card-body">
<div class="cul-tip">
订单将在1个小时后关闭
</div>
</div>
<cr-button type="warning" size="large" block slot="footer" @click="pay">
立即支付
</cr-button>
</card>
</div>
</div>
</template>
<script>
import Card from "@/components/Card";
export default {
name: "ConsultantState",
components: {
Card
},
data() {
return {
payState: 1
};
},
computed: {
payStateTxt() {
return this.payState === 1 ? "支付中" : "已支付";
}
},
mounted() {},
methods: {
pay() {}
}
};
</script>
<style lang="less" src="./index.less" scoped></style>
...@@ -22,28 +22,19 @@ ...@@ -22,28 +22,19 @@
为了给您提供更精准的保险定制服务,请花1分钟填写问卷,让顾问更了解您。 为了给您提供更精准的保险定制服务,请花1分钟填写问卷,让顾问更了解您。
</div> </div>
</div> </div>
<cr-button <cr-button type="warning" size="large" block slot="footer" @click="startQuestion">
type="warning"
size="large"
block
slot="footer"
@click="$router.push('/consultant/question')"
>
开始填写问卷 开始填写问卷
</cr-button> </cr-button>
</card> </card>
</div> </div>
<tabbar />
</div> </div>
</template> </template>
<script> <script>
import Tabbar from "@/components/Tabbar";
import Card from "@/components/Card"; import Card from "@/components/Card";
export default { export default {
name: "ConsultantSuccess", name: "ConsultantSuccess",
components: { components: {
Tabbar,
Card Card
}, },
data() { data() {
...@@ -55,7 +46,12 @@ export default { ...@@ -55,7 +46,12 @@ export default {
] ]
}; };
}, },
mounted() {} mounted() {},
methods: {
startQuestion() {
this.$parent.changeQuestion();
}
}
}; };
</script> </script>
<style lang="less" src="./index.less" scoped></style> <style lang="less" src="./index.less" scoped></style>
This diff is collapsed.
<template functional>
<div class="ai-test">
<div class="ai-test-tip">
<h5>不知道怎么买保险</h5>
<small>试一试智能风险评测,推荐最适合你的保险</small>
</div>
<cr-row class="ai-test-cell" type="flex" align="center">
<cr-col span="5" class="ai-test-cell-image">
<cr-image width="60px" height="68px" src="@/assets/images/goods/ai-mongo.png" />
</cr-col>
<div class="ai-test-cell-title">
<h5>智能<span>风险测评</span></h5>
<small>AI小果:为您提供30s快速测评</small>
</div>
<div class="ai-test-cell-btn">
<cr-button type="warning">开始测评</cr-button>
</div>
</cr-row>
</div>
</template>
<script>
export default {
name: "AiTestTip"
};
</script>
<style lang="less" scoped>
@import "../../../style/var.less";
@import "../../../style/mixins.less";
.ai-test {
padding: 20px 16px 25.5px;
&-tip {
text-align: center;
.cell-title-mixin();
margin-bottom: @padding-md;
}
&-cell {
background-color: @white;
border-radius: @border-radius-md;
padding: 0 0 0 @padding-xs;
height: 72px;
&-image {
align-self: flex-end;
.cr-image {
display: block;
margin: 0 auto;
}
}
&-title {
padding: 8px 10px 0 5px;
.cell-title-mixin();
h5 {
margin: 0;
}
span {
color: @orange-dark;
font-weight: bold;
}
}
&-btn {
width: 76px;
.cr-button {
font-size: @button-default-font-size !important;
height: @button-default-height !important;
line-height: @button-default-line-height !important;
border-radius: @border-radius-sm !important;
}
}
}
}
</style>
...@@ -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,9 +42,9 @@ ...@@ -42,9 +42,9 @@
* @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.service"; import { payByWay } from "@/service/pay";
let pollTimer = null; let pollTimer = null;
export default { export default {
name: "paytest", name: "paytest",
...@@ -60,49 +60,49 @@ export default { ...@@ -60,49 +60,49 @@ export default {
}, },
insuredOrderInfo: { insuredOrderInfo: {
insuredUserInfo: { insuredUserInfo: {
phoneNo: "13209654413", phoneNo: "15715416416",
userInfoSecId: "commodo", userName: "龚秀兰",
userName: "罗刚", idNo: "640181198708118231",
idNo: "566254180010306614",
longTerm: false, longTerm: false,
validEnd: "1978-11-18", validEnd: "2021-03-15",
relation: "1", relation: "2",
socialSecurity: false, socialSecurity: true,
email: "s.yfyviye@mxxv.ki", email: "r.icj@crtzzkdr.is",
annualIncome: "17159", annualIncome: "71067",
addressCode: "110100", addressCode: "110100",
addressDetail: "海外", addressDetail: "六安市",
occupation: "5", occupation: "7",
height: 169, height: 183,
weight: 58, weight: 66,
bankCardCode: "ICBC", bankCardCode: "ICBC",
bankCardNo: "6220549771082240618" bankCardNo: "1815137475347541839"
}, },
productNo: "1", productNo: "HTYLX001",
holderUserInfo: { holderUserInfo: {
phoneNo: "13499177270", phoneNo: "15664415945",
userInfoSecId: "eu in", userName: "郭平",
userName: "崔静", idNo: "640181198708118231",
idNo: "16479119920330003X", longTerm: true,
longTerm: false, validEnd: "2021-12-03",
validEnd: "1985-09-23", socialSecurity: true,
socialSecurity: false, email: "y.dcqoic@bkfygg.fo",
email: "n.ata@ueccvun.bz", annualIncome: "50401",
annualIncome: "35555",
addressCode: "110100", addressCode: "110100",
addressDetail: "白城", addressDetail: "通化",
occupation: "1", occupation: "3",
height: 186, height: 169,
weight: 54, weight: 66,
bankCardCode: "ICBC", bankCardCode: "ICBC",
bankCardNo: "667782802278796" bankCardNo: "9397487291495249077"
},
productItem: {
insuredAmount: "30万",
policyPeriod: "至60岁",
paymentPeriod: "20年"
}, },
insuredAmount: "57",
policyPeriod: "26",
paymentType: 4, paymentType: 4,
paymentPeriod: "et in", effectiveDate: "2020-08-16 12:44:18",
effectiveDate: "2003-07-06 23:11:44", autoRenewPolicy: false
autoRenewPolicy: true
}, },
orderInfo: {}, orderInfo: {},
tradeType: "", tradeType: "",
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
}; };
if (tradeType === "JSAPI") { if (tradeType === "JSAPI") {
payInfo = res.data.payInfo; payInfo = res.data.payInfo;
payInfo.appId = cfg.wxAppId; // payInfo.appId = cfg.wxAppId;
} }
payByWay(tradeType, payInfo).then(() => { payByWay(tradeType, payInfo).then(() => {
this.payBack = 1; this.payBack = 1;
......
...@@ -63,6 +63,11 @@ module.exports = { ...@@ -63,6 +63,11 @@ module.exports = {
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]@qg[\\/]_?cherry-ui(.*)/ // in order to adapt to cnpm test: /[\\/]node_modules[\\/]@qg[\\/]_?cherry-ui(.*)/ // in order to adapt to cnpm
}, },
// svg: {
// name: "chunk-svg",
// priority: 15,
// test: resolve("src/assets/icons/svg")
// },
commons: { commons: {
name: "chunk-commons", name: "chunk-commons",
test: resolve("src/components"), // can customize your rules test: resolve("src/components"), // can customize your rules
......
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