Commit 029a83f1 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/goods' into 'master'

Feature/goods

See merge request !37
parents e9d11fea e0213ac4
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@better-scroll/core": "^2.0.0-beta.6", "@better-scroll/core": "^2.0.0-beta.6",
"@qg/cherry-ui": "^1.1.2", "@qg/cherry-ui": "^1.2.1",
"@qg/qg-scroll": "^1.4.2", "@qg/qg-scroll": "^1.4.2",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"axios": "^0.19.2", "axios": "^0.19.2",
......
...@@ -20,6 +20,11 @@ export const getCulsuggestion = param => { ...@@ -20,6 +20,11 @@ export const getCulsuggestion = param => {
return req.get("consultant/suggestion/detail", param); return req.get("consultant/suggestion/detail", param);
}; };
// 创建顾问订单-查询顾问信息
export const getCulInfo = param => {
return req.post("consultant/info", param);
};
// 查询顾问订单信息 // 查询顾问订单信息
export const getCulOrder = param => { export const getCulOrder = param => {
return req.get("consultant/order/query", param); return req.get("consultant/order/query", param);
......
...@@ -69,10 +69,10 @@ export default { ...@@ -69,10 +69,10 @@ export default {
{ label: "无社保", value: "0" } { label: "无社保", value: "0" }
], ],
insuredOptions: [ insuredOptions: [
{ label: "本人", value: "0" }, { label: "本人", value: "1" },
{ label: "配偶", value: "1" }, { label: "配偶", value: "2" },
{ label: "父母", value: "2" }, { label: "父母", value: "3" },
{ label: "子女", value: "3" } { label: "子女", value: "4" }
], ],
medicalOptions: [ medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" }, { label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
......
...@@ -82,10 +82,10 @@ export default { ...@@ -82,10 +82,10 @@ export default {
{ label: "10万", value: "100000" } { label: "10万", value: "100000" }
], ],
insuredOptions: [ insuredOptions: [
{ label: "本人", value: "0" }, { label: "本人", value: "1" },
{ label: "配偶", value: "1" }, { label: "配偶", value: "2" },
{ label: "父母", value: "2" }, { label: "父母", value: "3" },
{ label: "子女", value: "3" } { label: "子女", value: "4" }
], ],
paywayOptions: [ paywayOptions: [
{ label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" }, { label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" },
......
...@@ -71,10 +71,10 @@ export default { ...@@ -71,10 +71,10 @@ export default {
], ],
planTipOptions: ["不限社保", "报销自费药", "额外400万特定赔付"], planTipOptions: ["不限社保", "报销自费药", "额外400万特定赔付"],
insuredOptions: [ insuredOptions: [
{ label: "本人", value: "0" }, { label: "本人", value: "1" },
{ label: "配偶", value: "1" }, { label: "配偶", value: "2" },
{ label: "父母", value: "2" }, { label: "父母", value: "3" },
{ label: "子女", value: "3" } { label: "子女", value: "4" }
], ],
medicalOptions: [ medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" }, { label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Description:众安50万意外险 * @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37 * @Date: 2020-07-27 15:46:37
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2020-08-12 14:13:20 * @LastEditTime: 2020-08-13 10:37:30
*/ */
import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png"; import goodsBg from "@/assets/images/goods/detail/yiwaixian/bg.png";
...@@ -100,10 +100,10 @@ export default { ...@@ -100,10 +100,10 @@ export default {
{ label: "10万", value: "100000" } { label: "10万", value: "100000" }
], ],
insuredOptions: [ insuredOptions: [
{ label: "本人", value: "0" }, { label: "本人", value: "1" },
{ label: "配偶", value: "1" }, { label: "配偶", value: "2" },
{ label: "父母", value: "2" }, { label: "父母", value: "3" },
{ label: "子女", value: "3" } { label: "子女", value: "4" }
], ],
noticeCellInfo: { noticeCellInfo: {
"1000000": [ "1000000": [
......
...@@ -58,12 +58,32 @@ export default [ ...@@ -58,12 +58,32 @@ export default [
], ],
policyPeriod: [] policyPeriod: []
}, },
{
id: "ZAYWX001",
itype: "ai",
scope: [1, 2, 3],
img: good03,
title: "万家保·综合意外险",
sub: "意外风险覆盖全,最高100万保额",
glory: "开车必备",
price: "145",
unit: "年起",
allow: true,
termType: "short",
icon_closed: casualty_closed,
icon: casualty,
guarantee_title: "意外保障",
guarantee_sub: "意外风险覆盖全,最高100万保额",
company: "众安保险",
payType: [],
policyPeriod: []
},
{ {
id: "BNZJX001", id: "BNZJX001",
itype: "cii", itype: "cii",
scope: [1, 3], scope: [1, 3],
img: good02, img: good02,
url: "http://www.baidu.com", url: "",
title: "百年康惠保(2.0)重大疾病险", title: "百年康惠保(2.0)重大疾病险",
sub: "终身保障155种重疾,最多赔付6次", sub: "终身保障155种重疾,最多赔付6次",
glory: "", glory: "",
...@@ -82,26 +102,6 @@ export default [ ...@@ -82,26 +102,6 @@ export default [
{ label: "保至终身", value: "2" } { label: "保至终身", value: "2" }
] ]
}, },
{
id: "ZAYWX001",
itype: "ai",
scope: [1, 2, 3],
img: good03,
title: "万家保·综合意外险",
sub: "意外风险覆盖全,最高100万保额",
glory: "开车必备",
price: "145",
unit: "年起",
allow: true,
termType: "short",
icon_closed: casualty_closed,
icon: casualty,
guarantee_title: "意外保障",
guarantee_sub: "意外风险覆盖全,最高100万保额",
company: "众安保险",
payType: [],
policyPeriod: []
},
{ {
id: "HGSX001", id: "HGSX001",
itype: "li", itype: "li",
......
This diff is collapsed.
...@@ -5,11 +5,20 @@ export const list = param => { ...@@ -5,11 +5,20 @@ export const list = param => {
return req.get("product/list", param); return req.get("product/list", param);
}; };
// 产品详情 // 获取产品H5链接
export const detail = param => { export const getLink = () => {
return req.get("product/detail", param); return req.get("third/bainian/insurance_url", {
params: {
goBackUrl: `${window.location.origin}/policy/detail/`
}
});
}; };
// 产品详情
// export const detail = param => {
// return req.get("product/detail", param);
// };
// 产品算价 // 产品算价
export const trail = param => { export const trail = param => {
return req.post("product/price/trail", param); return req.post("product/price/trail", param);
...@@ -27,6 +36,8 @@ export const placeOrder = { ...@@ -27,6 +36,8 @@ export const placeOrder = {
}, },
// 轮询支付结果 // 轮询支付结果
polling: params => { polling: params => {
return req.get("pay/result", params); return req.get("pay/result", {
params
});
} }
}; };
...@@ -3,5 +3,17 @@ export default { ...@@ -3,5 +3,17 @@ export default {
serviceHours: "9:00-21:00", serviceHours: "9:00-21:00",
sobot: "", sobot: "",
icp: "京ICP备15059975号", icp: "京ICP备15059975号",
copyright: "全天候保险代理股份有限公司" copyright: "全天候保险代理股份有限公司",
consultant: {
name: "赵玉龙",
role: "金牌保险顾问",
card: "20192000000080002020003828",
id: "tgc5Dswotks",
qrcode: "",
avator: "",
serveNum: "-",
rate: "-%",
tel: "13888888888",
date: "9:00 ~ 21:00"
}
}; };
...@@ -7,7 +7,9 @@ export const loginByPhone = param => { ...@@ -7,7 +7,9 @@ export const loginByPhone = param => {
// 信用钱包用户自动登录 // 信用钱包用户自动登录
export const authByxyqb = param => { export const authByxyqb = param => {
return req.get("xyqb_user_info", param); return req.get("user/info/xyqb", {
params: param
});
}; };
// 微信用户获取openid // 微信用户获取openid
......
<template> <template>
<cr-radio-group v-model="radioVal" class="radio-btn"> <cr-radio-group v-model="radioVal" class="radio-btn" :class="{ readonly }">
<cr-radio <cr-radio
:name="item.value" :name="item.value"
:class="{ checked: value === item.value }" :class="{ checked: value === item.value }"
...@@ -26,6 +26,10 @@ export default { ...@@ -26,6 +26,10 @@ export default {
return []; return [];
} }
}, },
readonly: {
type: Boolean,
default: false
},
value: null value: null
}, },
watch: { watch: {
...@@ -51,6 +55,21 @@ export default { ...@@ -51,6 +55,21 @@ export default {
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
margin-bottom: 12px; margin-bottom: 12px;
&.readonly {
position: relative;
z-index: 1;
&::after {
display: block;
content: " ";
position: absolute;
z-index: 2;
background-color: rgba(0, 0, 0, 0);
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
@{deep} .cr-radio { @{deep} .cr-radio {
margin-right: 10px; margin-right: 10px;
flex: 1; flex: 1;
......
...@@ -92,9 +92,9 @@ export default { ...@@ -92,9 +92,9 @@ export default {
if (res) { if (res) {
this.$notify({ type: "success", message: "登录成功" }); this.$notify({ type: "success", message: "登录成功" });
this.setIsShowLogin(false); this.setIsShowLogin(false);
// localStorage.setItem("mongoToken", res.token); localStorage.setItem("mongoToken", res.token);
// TODO 开发目前使用这个token // TODO 开发目前使用这个token
localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12"); // localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
} }
}, },
async getCode() { async getCode() {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
get-container="body" get-container="body"
close-icon="close" close-icon="close"
class="panel-wrap" class="panel-wrap"
@close="onClose" @closed="onClose"
> >
<div class="panel"> <div class="panel">
<div class="panel-head"> <div class="panel-head">
......
<template>
<div class="jobs-wrap">
<div class="jobs-wrap-txt" :class="{ placeholder: !selectedTexts.length }" @click="show = true">
<span>{{ selectedTexts[1] || placeholder }}</span>
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" get-container="body" round closeable position="bottom" class="jobs">
<div class="jobs-head">
<div class="jobs-title">请选择</div>
<cr-divider :hairline="false" :style="{ color: '#F4F4F4', margin: 0 }" />
</div>
<!-- content -->
<div class="jobs-content">
<div class="job-list">
<div
class="jobs-item"
v-for="(item, index) in industry"
:key="index"
:class="{ active: columns[0].values.length > 0 && index === columns[0].selectedIndex }"
@click="changeIndustry(item, index)"
>
<div class="jobs-item-txt">
<span>{{ item.text }}</span>
<cr-icon type="arrow" />
</div>
<div
class="jobs-children"
v-if="columns[0].values.length > 0 && index === columns[0].selectedIndex"
>
<div
class="jobs-item"
v-for="(it, idx) in columns[1].values"
:key="idx"
@click="changeProfession(it, idx)"
>
<div class="jobs-item-txt">{{ it.text }}</div>
</div>
</div>
<cr-divider />
</div>
</div>
</div>
</cr-popup>
</div>
</template>
<script>
/**
* @description: 职业码表
* @param {type}
* @return:
*/
import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import jobs from "@/api/jobs";
const CHANGE_EVENT = "input";
const INDUSTRY_INDEX = 0;
const PROFESSION_INDEX = 1;
export default {
name: "PopupCascade",
mixins: [popupPickerMixin],
props: {
value: null
},
watch: {
// value(val) {
// this.popupShow = val;
// },
popupShow(val) {
this.$emit(CHANGE_EVENT, val);
}
},
computed: {
industry() {
const list = this.jobs[this.industryKey];
return Object.keys(list).map(key => {
return {
code: key,
text: list[key]
};
});
},
profession() {
const list = this.jobs[this.professionKey];
return Object.keys(list).map(key => {
return {
code: key,
text: list[key]
};
});
}
},
data() {
return {
show: false,
jobs,
industryKey: "industry",
professionKey: "profession",
columns: [],
selectedCodes: [],
selectedTexts: []
};
},
created() {
if (this.value) {
const value = "" + this.value;
this.selectedCodes = [value.substring(0, 4), value];
}
for (let i = 0; i < 2; i++) {
this.columns[i] = {
values: [],
selectedIndex: ""
};
}
},
mounted() {
this.renderIndustry();
},
methods: {
changeIndustry(item, index) {
this.columns[INDUSTRY_INDEX].selectedIndex = index;
this.selectedCodes[INDUSTRY_INDEX] = item.code;
this.selectedTexts[INDUSTRY_INDEX] = item.text;
this.renderProfession(item.code);
},
changeProfession(item, index) {
this.columns[PROFESSION_INDEX].selectedIndex = index;
this.selectedCodes[PROFESSION_INDEX] = item.code;
this.selectedTexts[PROFESSION_INDEX] = item.text;
this.$emit("input", this.selectedCodes);
this.show = false;
},
renderIndustry() {
this.columns[INDUSTRY_INDEX].values = this.industry;
this.setDefaultIndexOfColumn(this.industry, INDUSTRY_INDEX);
const industry = this.industry[this.columns[INDUSTRY_INDEX].selectedIndex];
if (industry) {
this.selectedTexts[PROFESSION_INDEX] = industry.text;
this.renderProfession(industry?.code);
}
},
renderProfession(industryCode) {
const professionOfIndustry = this.quickFilter(this.profession, 5, industryCode);
this.columns[PROFESSION_INDEX].values = professionOfIndustry;
this.setDefaultIndexOfColumn(professionOfIndustry, PROFESSION_INDEX);
this.$forceUpdate();
},
quickFilter(list, slice, code) {
const prefix = code.substring(0, slice);
let start = false;
const filtered = [];
for (let i = 0, len = list.length; i < len; i++) {
if (list[i].code.substr(0, slice) === prefix) {
start = true;
filtered.push(list[i]);
} else {
if (start) {
break;
}
}
}
return filtered;
},
setDefaultIndexOfColumn(list, index) {
if (this.selectedCodes[index]) {
list.some((item, i) => {
if (item.code === this.selectedCodes[index]) {
this.columns[index].selectedIndex = i;
return true;
}
return false;
});
// clear after first render
this.selectedCodes[index] = "";
}
}
}
};
</script>
<style lang="less" scoped>
@import "../style/var.less";
.body-wrap-mixin {
overflow-x: hidden;
overflow-y: auto;
height: 80vh;
padding: @padding-lg;
}
.jobs {
z-index: 200;
height: 80vh;
overflow: hidden;
@{deep} .cr-icon {
position: absolute;
color: #d0cfcf;
font-size: @font-size-18;
top: 16px;
right: 14px;
z-index: 201;
}
&-wrap {
width: 100%;
&-txt {
height: 24px;
color: #333;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
&-head {
width: 100%;
}
&-title {
font-weight: @font-weight-bold;
font-size: @font-size-18;
color: @black;
line-height: @line-height-lg + 1;
padding: 13px 0 10px;
text-align: center;
}
&-content {
.body-wrap-mixin();
font-size: @font-size-12;
color: @gray-5;
line-height: @line-height-md - 2;
}
&-list {
width: 100%;
}
&-item {
.cr-divider {
margin: 0;
}
&-txt {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 15px;
color: #333;
padding: 12px 0;
.cr-icon {
font-size: 14px;
color: #333;
position: initial;
transition: tranform 0.2s linear;
}
}
&.active {
.jobs-children {
display: block;
}
.cr-icon {
transform: rotate(90deg);
}
}
}
&-children {
display: none;
margin: 0 0 10px;
padding: 2px 10px;
border-radius: 8px;
background-color: @gray-1;
.jobs-item-txt {
color: @gray-5;
padding: 0;
margin: 8px 0;
font-size: 14px;
}
}
}
.placeholder {
color: #ccc;
}
</style>
...@@ -9,19 +9,27 @@ ...@@ -9,19 +9,27 @@
<svg-icon icon-class="triangle-right" slot="button" /> <svg-icon icon-class="triangle-right" slot="button" />
</div> </div>
<cr-popup v-model="show" position="bottom" get-container="body"> <cr-popup v-model="show" position="bottom" get-container="body">
<cr-date-picker ref="datepicker" @confirm="onConfirm" @cancel="onCancel" /> <cr-date-picker
ref="datepicker"
@confirm="onConfirm"
@cancel="onCancel"
:init-value="initVal"
/>
</cr-popup> </cr-popup>
</div> </div>
</template> </template>
<script> <script>
import popupPickerMixin from "../mixins/popupPicker.mixin.js"; import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import { parseTime } from "@/service/utils";
export default { export default {
name: "PopupDatePicker", name: "PopupDatePicker",
mixins: [popupPickerMixin], mixins: [popupPickerMixin],
data() { data() {
return { return {
refName: "datepicker" refName: "datepicker",
initVal: parseTime("", "{y}-{m}-{d}")
}; };
}, },
methods: { methods: {
......
export default { export default {
basicHost: "http://yapi.quantgroups.com/mock/329/", basicHost: "http://yapi.quantgroups.com/mock/329/",
// basicHost: "http://192.168.29.100:8964/", // basicHost: "http://192.168.29.211:8964/",
wxAppId: "wx514de17b23d53a20" wxAppId: "wx514de17b23d53a20"
}; };
export default { export default {
basicHost: "http://192.168.29.211:80/", basicHost: "http://192.168.29.211:8964/",
// basicHost: "http://127.0.0.1:8964/", // basicHost: "http://127.0.0.1:8964/",
// basicHost: "https://hathaway-mg.liangkebang.net/", // basicHost: "https://hathaway-mg.liangkebang.net/",
wxAppId: "wx514de17b23d53a20" wxAppId: "wx514de17b23d53a20"
......
...@@ -5,7 +5,7 @@ import router from "./router"; ...@@ -5,7 +5,7 @@ import router from "./router";
import store from "./store"; import store from "./store";
import "./style/index.less"; import "./style/index.less";
import "amfe-flexible"; import "amfe-flexible";
// import vConsole from "vconsole"; import vConsole from "vconsole";
import "@/assets/icons/index"; import "@/assets/icons/index";
import "@/service/cherry-ui"; import "@/service/cherry-ui";
...@@ -18,5 +18,5 @@ new Vue({ ...@@ -18,5 +18,5 @@ new Vue({
// if (process.env.NODE_ENV !== "development") { // if (process.env.NODE_ENV !== "development") {
// ! 上线后务必取掉 // ! 上线后务必取掉
// new vConsole(); new vConsole();
// } // }
/*
* @Description: autoSaveForm mixins
* @LastEditors: gzw
* @Date: 2019-08-14 15:53:37
* @LastEditTime: 2020-08-14 16:16:58
*/
import localStorage from "@/service/localStorage";
export default {
data() {
return {
autoSaveTimer: null
};
},
methods: {
autoSaveHandler(key, saveKey, interval = 1000) {
if (this.autoSaveTimer) {
clearTimeout(this.autoSaveTimer);
}
const val = this[key];
this.autoSaveTimer = setTimeout(() => {
localStorage.set(saveKey, val);
}, interval);
},
clearSaveHandler(key) {
localStorage.remove(key);
},
hasAutoSaveData(key) {
return !!localStorage.get(key);
},
getSaveInfoHandler(key, target) {
this[target] = localStorage.get(key);
this.$forceUpdate();
}
}
};
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: PopupPicker mixin * @Description: PopupPicker mixin
* @Date: 2020-07-28 19:46:31 * @Date: 2020-07-28 19:46:31
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2020-07-28 20:33:52 * @LastEditTime: 2020-08-16 21:21:05
*/ */
// TODO 默认值需要处理 // TODO 默认值需要处理
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
watch: { watch: {
show(val) { show(val) {
if (val && !this.refreshed) { if (val && !this.refreshed && this.$refs[this.refName]) {
this.refreshed = true; this.refreshed = true;
this.$refs[this.refName].refreshColumns(); this.$refs[this.refName].refreshColumns();
} }
......
...@@ -42,7 +42,6 @@ async function getAuthInfo(xyqbToken) { ...@@ -42,7 +42,6 @@ async function getAuthInfo(xyqbToken) {
async function getWxOpenId(code) { async function getWxOpenId(code) {
if (localStorage.get("openId")) return; if (localStorage.get("openId")) return;
const res = await getwxOpenId({ code, appId: cfg.wxAppId }); const res = await getwxOpenId({ code, appId: cfg.wxAppId });
this.openId = res.openId;
localStorage.set("openId", res.openId); localStorage.set("openId", res.openId);
} }
// router.afterEach(() => {}); // router.afterEach(() => {});
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +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-08-12 17:59:02 * @LastEditTime: 2020-08-13 14:14:32
*/ */
import cherry from "@qg/cherry-ui"; // import cherry from "@qg/cherry-ui";
import qs from "qs"; // import qs from "qs";
const { Notify } = cherry; // const { Notify } = cherry;
/** /**
* payByWeixinJsapi * payByWeixinJsapi
...@@ -22,17 +22,18 @@ function payByWeixinJsapi(info = {}, callback) { ...@@ -22,17 +22,18 @@ function payByWeixinJsapi(info = {}, callback) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
WeixinJSBridge.invoke("getBrandWCPayRequest", info, function(res) { WeixinJSBridge.invoke("getBrandWCPayRequest", info, function(res) {
console.log(res); console.log(res);
if (res.err_msg == "get_brand_wcpay_request:ok") { callback();
// 使用以上方式判断前端返回,微信团队郑重提示: // if (res.err_msg == "get_brand_wcpay_request:ok") {
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 // // 使用以上方式判断前端返回,微信团队郑重提示:
callback("ok"); // //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
} else if (res.err_msg == "get_brand_wcpay_request:cancel") { // callback("ok");
// 支付取消 // } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
callback("cancel"); // // 支付取消
} else { // callback("cancel");
// 支付失败 // } else {
callback("fail"); // // 支付失败
} // callback("fail");
// }
}); });
} }
if (typeof WeixinJSBridge == "undefined") { if (typeof WeixinJSBridge == "undefined") {
...@@ -54,12 +55,12 @@ function payByWeixinJsapi(info = {}, callback) { ...@@ -54,12 +55,12 @@ function payByWeixinJsapi(info = {}, callback) {
* @param {type} * @param {type}
* @return: * @return:
*/ */
function payByWeixinH5(info) { function payByWeixinH5() {
if (info.url) return; // if (info.url) return;
const currentPath = encodeURIComponent( // const currentPath = encodeURIComponent(
window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true }) // window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
); // );
window.location.href = `${info.url}&redirect_url=${currentPath}`; // window.location.href = `${info.url}&redirect_url=${currentPath}`;
} }
/** /**
...@@ -70,12 +71,12 @@ function payByWeixinH5(info) { ...@@ -70,12 +71,12 @@ function payByWeixinH5(info) {
* @param {type} * @param {type}
* @return: * @return:
*/ */
function payByThirdPartyCashier(info) { function payByThirdPartyCashier() {
if (info.url) return; // if (info.url) return;
const currentPath = encodeURIComponent( // const currentPath = encodeURIComponent(
window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true }) // window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
); // );
window.location.href = `${info.url}&redirect_uri=${currentPath}`; // window.location.href = `${info.url}&redirect_uri=${currentPath}`;
} }
/** /**
...@@ -88,13 +89,13 @@ function payByThirdPartyCashier(info) { ...@@ -88,13 +89,13 @@ function payByThirdPartyCashier(info) {
export function payByWay(type = "THIRD", payInfo) { export function payByWay(type = "THIRD", payInfo) {
return new Promise(resolve => { return new Promise(resolve => {
if (type === "JSAPI") { if (type === "JSAPI") {
payByWeixinJsapi(payInfo, function(e) { payByWeixinJsapi(payInfo, function() {
if (e === "ok") { // if (e === "ok") {
Notify({ type: "success", message: "支付成功" }); // Notify({ type: "success", message: "支付成功" });
} else { // } else {
Notify({ type: "warning", message: "支付失败" }); // Notify({ type: "warning", message: "支付失败" });
} // }
resolve(e); resolve();
}); });
} else if (type === "MWEB") { } else if (type === "MWEB") {
payByWeixinH5(payInfo); payByWeixinH5(payInfo);
......
...@@ -4,7 +4,6 @@ import user from "./modules/user"; ...@@ -4,7 +4,6 @@ import user from "./modules/user";
import { isXyqb } from "@/service/validation"; import { isXyqb } from "@/service/validation";
import localStorage from "@/service/localStorage"; 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({
...@@ -12,7 +11,7 @@ export default new Vuex.Store({ ...@@ -12,7 +11,7 @@ export default new Vuex.Store({
activeIdx: 0, activeIdx: 0,
isLoading: false, isLoading: false,
isShowLogin: false, isShowLogin: false,
showAuthXyqb: isXyqb ? XYQB_AUTH_STATE : -1 // 1 已获取信息未授权,2 打开授权弹框, 3 拒绝授权,4 允许授权, -1 非信用钱包环境 showAuthXyqb: isXyqb ? localStorage.get("xyqbAuthState") || 1 : -1 // 1 已获取信息未授权,2 打开授权弹框, 3 拒绝授权,4 允许授权, -1 非信用钱包环境
}, },
mutations: { mutations: {
setActiveIdx(state, value) { setActiveIdx(state, value) {
......
...@@ -88,6 +88,7 @@ import { create, goPay } from "@/api/consultant"; ...@@ -88,6 +88,7 @@ import { create, goPay } 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";
export default { export default {
name: "ConsultantBuy", name: "ConsultantBuy",
components: { components: {
...@@ -105,7 +106,7 @@ export default { ...@@ -105,7 +106,7 @@ export default {
data() { data() {
return { return {
isLogin: localStorage.get("mongoToken"), isLogin: localStorage.get("mongoToken"),
remain: 126, remain: 0,
price: [0.99, 199], price: [0.99, 199],
consultantOrderNo: "", consultantOrderNo: "",
tradeType: isXyqb ? "MWEB" : "JSAPI", tradeType: isXyqb ? "MWEB" : "JSAPI",
...@@ -205,13 +206,17 @@ export default { ...@@ -205,13 +206,17 @@ export default {
}, },
watch: { watch: {
isShowLogin(val) { isShowLogin(val) {
console.log(111);
if (!val) { if (!val) {
this.isLogin = localStorage.get("mongoToken"); this.isLogin = localStorage.get("mongoToken");
} }
},
isLogin() {
this.checkLogin();
} }
}, },
mounted() {}, mounted() {
this.updateRemain();
},
methods: { methods: {
...mapActions(["setIsShowLogin"]), ...mapActions(["setIsShowLogin"]),
checkLogin() { checkLogin() {
...@@ -225,10 +230,21 @@ export default { ...@@ -225,10 +230,21 @@ export default {
this.generateOrder(); this.generateOrder();
} }
}, },
updateRemain(isBuy = false) {
let historyRemain = sessionStorage.getItem("historyRemain");
if (historyRemain && +historyRemain > 100) {
isBuy && historyRemain--;
} else {
historyRemain = Math.floor(Math.random() * (200 - 100) + 100);
}
this.remain = historyRemain;
sessionStorage.setItem("historyRemain", historyRemain);
},
async generateOrder() { async generateOrder() {
const res = await create(); const res = await create();
if (res) { if (res) {
this.consultantOrderNo = res.consultantOrderNo; this.consultantOrderNo = res.consultantOrderNo;
this.updateRemain(true);
this.goPay(); this.goPay();
} }
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h1>{{ info.name }}</h1> <h1>{{ info.name }}</h1>
<cr-tag><svg-icon icon-class="medal" />{{ info.role }}</cr-tag> <cr-tag><svg-icon icon-class="medal" />{{ info.role }}</cr-tag>
<small>执业保险销售资质:</small> <small>执业保险销售资质:</small>
<small v-html="`${info.id.slice(0, 15)}<br />${info.id.slice(15)}`"></small> <small v-html="`${info.card.slice(0, 15)}<br />${info.id.slice(15)}`"></small>
</div> </div>
<cr-image <cr-image
class="cul-hd-img" class="cul-hd-img"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="cul-entry-title"> <div class="cul-entry-title">
<h3>您的专属保险方案</h3> <h3>您的专属保险方案</h3>
<small>CAPTIVE INSURANC</small> <small>CAPTIVE INSURANC</small>
<cr-tag>自己</cr-tag> <cr-tag v-if="relation">{{ relation }}</cr-tag>
</div> </div>
<svg-icon icon-class="arrow-right" /> <svg-icon icon-class="arrow-right" />
</router-link> </router-link>
...@@ -84,6 +84,10 @@ ...@@ -84,6 +84,10 @@
<script> <script>
import copyright from "@/components/Copyright"; import copyright from "@/components/Copyright";
import Card from "@/components/Card"; import Card from "@/components/Card";
import { getCulInfo } from "@/api/consultant";
import { getCulsuggestion } from "@/api/consultant";
import settings from "@/api/settings";
const { consultant } = settings;
export default { export default {
name: "ConsultantExclusive", name: "ConsultantExclusive",
components: { components: {
...@@ -98,16 +102,9 @@ export default { ...@@ -98,16 +102,9 @@ export default {
}, },
data() { data() {
return { return {
relation: "",
info: { info: {
name: "李玉婷", ...consultant
role: "金牌保险顾问",
id: "20192000000080002020003828",
qrcode: "",
avator: "",
serveNum: 38100,
rate: "99.8%",
tel: "13888888888",
date: "9:00 ~ 21:00"
}, },
oddsInsureList: [ oddsInsureList: [
{ {
...@@ -135,7 +132,34 @@ export default { ...@@ -135,7 +132,34 @@ export default {
] ]
}; };
}, },
mounted() {} watch: {
hasSuggestion: {
immediate: true,
handler(val) {
if (val) {
this.getSuggestion();
}
}
}
},
mounted() {
this.getInfo();
},
methods: {
async getInfo() {
const res = await getCulInfo({ consultantSecId: this.info.id });
if (res) {
this.info.rate = res.satisfaction;
this.info.serveNum = res.serviceNum;
}
},
async getSuggestion() {
const res = await getCulsuggestion();
if (res) {
this.relation = res.relation;
}
}
}
}; };
</script> </script>
<style lang="less" src="./index.less" scoped></style> <style lang="less" src="./index.less" scoped></style>
...@@ -2,20 +2,18 @@ ...@@ -2,20 +2,18 @@
<div class="container"> <div class="container">
<div class="cul-hd"> <div class="cul-hd">
<div class="cul-hd-rec"> <div class="cul-hd-rec">
<small class="cul-hd-rec-sub"> <small class="cul-hd-rec-sub"> HI,{{ goodInfo.name || "-" }}</small>
HI,{{ baseInfo.userName }}{{ baseInfo.sex === 1 ? "先生" : "女士" }} <h4 class="cul-hd-rec-title">以下是您{{ goodInfo.relation || "-" }}的专属保险方案</h4>
</small>
<h4 class="cul-hd-rec-title">以下是您本人的专属保险方案</h4>
</div> </div>
<card title="1"> <card title="1">
<h5 class="cul-hd-card-title" slot="header"> <h5 class="cul-hd-card-title" slot="header">
总保费: 总保费:
<strong>{{ goodInfo.totalAmount }}</strong> <strong>{{ goodInfo.totalAmount || "-" }}</strong>
{{ baseInfo.unit }} 元/年
</h5> </h5>
<p class="cul-hd-card-content"> <p class="cul-hd-card-content">
推荐理由: 推荐理由:
{{ goodInfo.remarks }} {{ goodInfo.remarks || "-" }}
</p> </p>
</card> </card>
</div> </div>
...@@ -106,13 +104,6 @@ export default { ...@@ -106,13 +104,6 @@ export default {
goodInfo: { goodInfo: {
ensure: [] ensure: []
}, },
baseInfo: {
userName: "王斌",
sex: 1,
amount: 10425,
unit: "元/年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
},
distList: [ distList: [
{ title: "医疗险", price: "500万" }, { title: "医疗险", price: "500万" },
{ title: "重疾险", price: "50万" }, { title: "重疾险", price: "50万" },
......
...@@ -169,9 +169,9 @@ export default { ...@@ -169,9 +169,9 @@ export default {
formData: { formData: {
birthday: "", birthday: "",
socialSecurity: "", socialSecurity: "",
annualIncome: "", annualIncome: "10万",
loan: "", loan: "无房贷",
addressCode: "111,111,11", addressCode: "北京市,北京市",
questionType: "", questionType: "",
userName: "", userName: "",
gender: "", gender: "",
...@@ -306,12 +306,16 @@ export default { ...@@ -306,12 +306,16 @@ export default {
if (type === "annualIncome" || type === "loan") { if (type === "annualIncome" || type === "loan") {
value = value[0]; value = value[0];
} }
// if (type === "area") {} if (type === "addressCode") {
value = value.map(item => item.name).join(",");
}
this.formData[type] = value; this.formData[type] = value;
}, },
async onSubmit() { async onSubmit() {
const { formData } = this; const { formData } = this;
const res = await subCulQus(formData); const { socialSecurity, gender } = formData;
const params = { ...formData, ...{ socialSecurity: +socialSecurity, gender: +gender } };
const res = await subCulQus(params);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
this.showSubState = false; this.showSubState = false;
......
...@@ -36,14 +36,14 @@ export default { ...@@ -36,14 +36,14 @@ export default {
orderInfo: [ orderInfo: [
{ {
consultantOrderNo: "", consultantOrderNo: "",
state: 0 state: -1
} }
] ]
}; };
}, },
computed: { computed: {
orderState() { orderState() {
return this.orderInfo[0].state; return this.orderInfo[0] ? this.orderInfo[0].state : -1;
}, },
...mapState(["isShowLogin"]) ...mapState(["isShowLogin"])
}, },
...@@ -51,6 +51,7 @@ export default { ...@@ -51,6 +51,7 @@ export default {
isShowLogin(val) { isShowLogin(val) {
if (!val) { if (!val) {
this.isLogin = localStorage.get("mongoToken"); this.isLogin = localStorage.get("mongoToken");
this.getOrderInfo();
} }
} }
}, },
......
<template> <template>
<cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container"> <cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container">
<nav-tab :nav-list="navBarOptions" /> <nav-tab :nav-list="navBarOptions" ref="navTab" @show="e => (goodActionShow = e)" />
<detail-header :det="headerInfo" /> <detail-header :det="headerInfo" />
<div class="det-body"> <div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)"> <card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<plan-tip :tip-list="planTipOptions" /> <plan-tip :tip-list="planTipOptions" />
</card> </card>
<div id="det_insure"> <div id="det_insure">
<insure-person-form v-model="formData" :radio-options="personFormOptions" /> <insure-person-form
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
/>
<auto-deduct <auto-deduct
v-model="formData.autoRenewPolicy" v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo" :cell-data="autoCellInfo"
...@@ -39,7 +43,11 @@ ...@@ -39,7 +43,11 @@
</div> </div>
<detail-footer :company-info="companyInfo" /> <detail-footer :company-info="companyInfo" />
<copyright /> <copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" /> <good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe <popup-with-iframe
v-model="popupShow" v-model="popupShow"
:title="pupopData.title" :title="pupopData.title"
...@@ -125,12 +133,12 @@ export default { ...@@ -125,12 +133,12 @@ export default {
goodBuyModalInfo: [], goodBuyModalInfo: [],
popupShow: false, popupShow: false,
currentPupopIndex: null, currentPupopIndex: null,
goodActionShow: false,
calTimer: null, calTimer: null,
formData: { formData: {
name: "", name: "",
idNo: "", idNo: "",
socialSecurity: "1", relation: "1",
relation: "0",
payType: "1", payType: "1",
amountInsured: "1000000", amountInsured: "1000000",
autoRenewPolicy: false, autoRenewPolicy: false,
...@@ -203,10 +211,16 @@ export default { ...@@ -203,10 +211,16 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
const { selfPhone, selfCode } = this.formData; if (localStorage.get("mongoToken")) {
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.goInsureState = true;
}); this.$refs.insureForm.getFamilyList();
} else {
const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true;
this.$refs.insureForm.getFamilyList();
});
}
// sessionStorage.setItem( // sessionStorage.setItem(
// "policyFormData", // "policyFormData",
// JSON.stringify(Object.assign(this.formData, { productNo: this.goodId })) // JSON.stringify(Object.assign(this.formData, { productNo: this.goodId }))
...@@ -214,6 +228,9 @@ export default { ...@@ -214,6 +228,9 @@ export default {
}, },
onFailed(errorInfo) { onFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
nextStep() { nextStep() {
...@@ -221,7 +238,37 @@ export default { ...@@ -221,7 +238,37 @@ export default {
this.generateOrder(); this.generateOrder();
}, },
generateFormData() { generateFormData() {
this.subFromData = {}; const {
userInfoSecId,
name,
idNo,
relation,
selfName,
selfIdNo,
selfPhone,
selfSecId,
payType,
autoRenewPolicy
} = this.formData;
this.subFromData = {
insuredUserInfo: {
userInfoSecId: userInfoSecId ?? null,
name,
idNo,
relation
},
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
userInfoSecId: selfSecId ?? null,
name: selfName,
idNo: selfIdNo
},
productItem: {
payType
},
autoRenewPolicy: autoRenewPolicy
};
}, },
async getDetail() { async getDetail() {
this.goodId = this.$route.query.id; this.goodId = this.$route.query.id;
...@@ -237,13 +284,14 @@ export default { ...@@ -237,13 +284,14 @@ export default {
}, },
async calFee() { async calFee() {
let { price } = this.headerInfo; let { price } = this.headerInfo;
const { idNo, amountInsured } = this.formData; const { idNo, amountInsured, userInfoSecId } = this.formData;
if (!idNo || !amountInsured) return; if (!idNo || !amountInsured) return;
const _param = { const _param = {
productNo: this.goodId, productNo: this.goodId,
productUserInfo: { productUserInfo: {
userInfo: { userInfo: {
idNo idNo,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
}, },
productItem: { productItem: {
amountInsured amountInsured
......
<template> <template>
<cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container"> <cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container">
<nav-tab :nav-list="navBarOptions" /> <nav-tab :nav-list="navBarOptions" ref="navTab" @show="e => (goodActionShow = e)" />
<detail-header :det="headerInfo" /> <detail-header :det="headerInfo" />
<div class="det-body"> <div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)"> <card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<plan-tip :tip-list="planTipOptions" /> <plan-tip :tip-list="planTipOptions" />
</card> </card>
<div id="det_insure"> <div id="det_insure">
<insure-person-form v-model="formData" :radio-options="personFormOptions" /> <insure-person-form
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
/>
<auto-deduct <auto-deduct
v-model="formData.autoRenewPolicy" v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo" :cell-data="autoCellInfo"
...@@ -38,7 +42,11 @@ ...@@ -38,7 +42,11 @@
</div> </div>
<detail-footer :company-info="companyInfo" /> <detail-footer :company-info="companyInfo" />
<copyright /> <copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" /> <good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe <popup-with-iframe
v-model="popupShow" v-model="popupShow"
:title="pupopData.title" :title="pupopData.title"
...@@ -122,12 +130,12 @@ export default { ...@@ -122,12 +130,12 @@ export default {
goodActionInfo: {}, goodActionInfo: {},
goodBuyModalInfo: [], goodBuyModalInfo: [],
popupShow: false, popupShow: false,
goodActionShow: false,
currentPupopIndex: null, currentPupopIndex: null,
formData: { formData: {
name: "", name: "",
idNo: "", idNo: "",
socialSecurity: "1", relation: "1",
relation: "0",
payType: "1", payType: "1",
amountInsured: "300000", amountInsured: "300000",
autoRenewPolicy: false, autoRenewPolicy: false,
...@@ -160,6 +168,12 @@ export default { ...@@ -160,6 +168,12 @@ export default {
} }
const { idNo, payType } = val; const { idNo, payType } = val;
const { idNo: oldNo, payType: oldType } = oldVal; const { idNo: oldNo, payType: oldType } = oldVal;
if (this.goInsureState) {
sessionStorage.setItem(
"policyFormData",
JSON.stringify(Object.assign(this.formData, { productNo: this.goodId }))
);
}
if (idNo === oldNo && payType === oldType) return; if (idNo === oldNo && payType === oldType) return;
this.calTimer = setTimeout(() => { this.calTimer = setTimeout(() => {
this.calFee(); this.calFee();
...@@ -206,17 +220,22 @@ export default { ...@@ -206,17 +220,22 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
const { selfPhone, selfCode } = this.formData; if (localStorage.get("mongoToken")) {
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.goInsureState = true;
sessionStorage.setItem( this.$refs.insureForm.getFamilyList();
"policyFormData", } else {
JSON.stringify(Object.assign(this.formData, { productNo: this.goodId })) const { selfPhone, selfCode } = this.formData;
); this.login(selfPhone, selfCode).then(() => {
}); this.goInsureState = true;
this.$refs.insureForm.getFamilyList();
});
}
}, },
onFailed(errorInfo) { onFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
nextStep() { nextStep() {
...@@ -245,7 +264,7 @@ export default { ...@@ -245,7 +264,7 @@ export default {
userInfo: { userInfo: {
idNo, idNo,
socialSecurity: !!Number(socialSecurity), socialSecurity: !!Number(socialSecurity),
userInfoSecId: userInfoSecId ?? null userInfoSecId: userInfoSecId ? userInfoSecId : undefined
}, },
productItem: { productItem: {
payType, payType,
......
<template> <template>
<cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container"> <cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container">
<nav-tab :nav-list="navBarOptions" /> <nav-tab :nav-list="navBarOptions" ref="navTab" @show="e => (goodActionShow = e)" />
<detail-header :det="headerInfo"> <detail-header :det="headerInfo">
<div class="li-header"> <div class="li-header">
<plan-tip :tip-list="planTipOptions" /> <plan-tip :tip-list="planTipOptions" />
...@@ -71,6 +71,11 @@ ...@@ -71,6 +71,11 @@
</div> </div>
<detail-footer :company-info="companyInfo" /> <detail-footer :company-info="companyInfo" />
<copyright /> <copyright />
<good-action
:content="goodActionInfo"
:class="{ 'cal-fee': currentPupopIndex === 6 }"
v-show="goodActionShow"
/>
<good-action :content="goodActionInfo" :class="{ 'cal-fee': currentPupopIndex === 6 }" /> <good-action :content="goodActionInfo" :class="{ 'cal-fee': currentPupopIndex === 6 }" />
<popup-with-iframe <popup-with-iframe
v-model="popupShow" v-model="popupShow"
...@@ -138,6 +143,7 @@ export default { ...@@ -138,6 +143,7 @@ export default {
goodId: "", goodId: "",
calTimer: null, calTimer: null,
goodActionInfo: {}, goodActionInfo: {},
goodActionShow: false,
popupShow: false, popupShow: false,
currentPupopIndex: null, currentPupopIndex: null,
formData: {}, formData: {},
...@@ -198,6 +204,9 @@ export default { ...@@ -198,6 +204,9 @@ export default {
}, },
onFailed(errorInfo) { onFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
nextStep() { nextStep() {
......
<template> <template>
<cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container"> <cr-form scroll-to-error @submit="onSubmit" @failed="onFailed" class="container">
<nav-tab :nav-list="navBarOptions" /> <nav-tab :nav-list="navBarOptions" ref="navTab" @show="e => (goodActionShow = e)" />
<detail-header :det="headerInfo" /> <detail-header :det="headerInfo" />
<div class="det-body"> <div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)"> <card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
<plan-tip :tip-list="planTipOptions" /> <plan-tip :tip-list="planTipOptions" />
</card> </card>
<div id="det_insure"> <div id="det_insure">
<insure-person-form v-model="formData" :radio-options="personFormOptions" /> <insure-person-form
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
/>
<auto-deduct <auto-deduct
v-model="formData.autoRenewPolicy" v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo" :cell-data="autoCellInfo"
...@@ -37,7 +41,11 @@ ...@@ -37,7 +41,11 @@
</div> </div>
<detail-footer :company-info="companyInfo" /> <detail-footer :company-info="companyInfo" />
<copyright /> <copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" /> <good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe <popup-with-iframe
v-model="popupShow" v-model="popupShow"
:title="pupopData.title" :title="pupopData.title"
...@@ -86,6 +94,7 @@ import detailPayMixin from "./modules/detailPay.mixin"; ...@@ -86,6 +94,7 @@ import detailPayMixin from "./modules/detailPay.mixin";
import detailLoginMixin from "./modules/detailLogin.mixin"; import detailLoginMixin from "./modules/detailLogin.mixin";
import { trail, list } from "@/api/product"; import { trail, list } from "@/api/product";
import localStorage from "@/service/localStorage";
import Detail from "@/api/detail.taikang.yiliaobaozhang"; import Detail from "@/api/detail.taikang.yiliaobaozhang";
export default { export default {
...@@ -128,12 +137,13 @@ export default { ...@@ -128,12 +137,13 @@ export default {
name: "", name: "",
idNo: "", idNo: "",
socialSecurity: "1", socialSecurity: "1",
relation: "0", relation: "1",
payType: "1", payType: "1",
planValue: "3", planValue: "3",
autoRenewPolicy: false, autoRenewPolicy: false,
read: true read: true
}, },
goodActionShow: false,
goInsureState: false goInsureState: false
}; };
}, },
...@@ -198,14 +208,23 @@ export default { ...@@ -198,14 +208,23 @@ export default {
this.popupShow = true; this.popupShow = true;
}, },
onSubmit() { onSubmit() {
const { selfPhone, selfCode } = this.formData; if (localStorage.get("mongoToken")) {
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.goInsureState = true;
}); this.$refs.insureForm.getFamilyList();
} else {
const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true;
this.$refs.insureForm.getFamilyList();
});
}
// sessionStorage.setItem("policyFormData", JSON.stringify(this.formData)); // sessionStorage.setItem("policyFormData", JSON.stringify(this.formData));
}, },
onFailed(errorInfo) { onFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
nextStep() { nextStep() {
...@@ -219,7 +238,7 @@ export default { ...@@ -219,7 +238,7 @@ export default {
idNo, idNo,
relation, relation,
socialSecurity, socialSecurity,
// selfSocialSecurity, selfSocialSecurity,
selfName, selfName,
selfIdNo, selfIdNo,
selfPhone, selfPhone,
...@@ -228,26 +247,31 @@ export default { ...@@ -228,26 +247,31 @@ export default {
autoRenewPolicy autoRenewPolicy
} = this.formData; } = this.formData;
this.subFromData = { this.subFromData = {
insuredUserInfo: {
userInfoSecId: userInfoSecId ?? null,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
},
productNo: this.goodId, productNo: this.goodId,
holderUserInfo: { holderUserInfo: {
phoneNo: selfPhone, phoneNo: selfPhone,
userInfoSecId: selfSecId ?? null, userInfoSecId: selfSecId ? selfSecId : null,
name: selfName, name: selfName,
idNo: selfIdNo idNo: selfIdNo
// socialSecurity: selfSocialSecurity ? !!Number(selfSocialSecurity) : null
}, },
productItem: { productItem: {
payType payType
}, },
autoRenewPolicy: autoRenewPolicy autoRenewPolicy: autoRenewPolicy
}; };
if (relation === "1") {
this.subFromData.holderUserInfo.socialSecurity = !!Number(selfSocialSecurity);
this.subFromData.productItem.socialSecurity = !!Number(selfSocialSecurity);
} else {
this.subFromData.insuredUserInfo = {
userInfoSecId: userInfoSecId ? userInfoSecId : undefined,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
};
this.subFromData.productItem.socialSecurity = !!Number(socialSecurity);
}
}, },
async getDetail() { async getDetail() {
this.goodId = this.$route.query.id; this.goodId = this.$route.query.id;
...@@ -272,7 +296,7 @@ export default { ...@@ -272,7 +296,7 @@ export default {
userInfo: { userInfo: {
idNo, idNo,
socialSecurity: !!Number(socialSecurity), socialSecurity: !!Number(socialSecurity),
userInfoSecId: userInfoSecId ?? null userInfoSecId: userInfoSecId ? userInfoSecId : undefined
}, },
productItem: { productItem: {
payType payType
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<mi-detail v-if="detailType === 'mi'" /> <mi-detail v-if="detailType === 'mi'" />
<ai-detail v-if="detailType === 'ai'" /> <ai-detail v-if="detailType === 'ai'" />
<li-detail v-if="detailType === 'li'" /> <li-detail v-if="detailType === 'li'" />
<advisor-rec-dialog :value="showRec" @close="pageBack" />
</div> </div>
</template> </template>
...@@ -12,22 +13,57 @@ import ciiDetail from "./CIIDetail"; ...@@ -12,22 +13,57 @@ import ciiDetail from "./CIIDetail";
import miDetail from "./MIDetail"; import miDetail from "./MIDetail";
import liDetail from "./LIDetail"; import liDetail from "./LIDetail";
import aiDetail from "./AIDetail"; import aiDetail from "./AIDetail";
import AdvisorRecDialog from "./modules/AdvisorRecDialog";
import { getCulOrder } from "@/api/consultant";
import localStorage from "@/service/localStorage";
export default { export default {
name: "GoodsDetail", name: "GoodsDetail",
components: { components: {
ciiDetail, ciiDetail,
miDetail, miDetail,
aiDetail, aiDetail,
liDetail liDetail,
AdvisorRecDialog
}, },
data() { data() {
return { return {
detailType: "", detailType: "",
show: true showRec: false,
noOrder: true,
userClickState: false,
userBackState: false
}; };
}, },
beforeRouteLeave(to, from, next) {
if (this.noOrder && !this.userClickState && to.name === "Goods") {
this.showRec = true;
next(false);
} else {
next();
}
},
mounted() { mounted() {
this.getOrderInfo();
this.detailType = this.$route.query.type; this.detailType = this.$route.query.type;
},
methods: {
async getOrderInfo() {
const isLogin = localStorage.get("mongoToken");
if (!isLogin) {
this.noOrder = true;
return;
}
const res = await getCulOrder();
this.noOrder = res[0].state && res[0].state <= 2;
},
pageBack(e) {
this.showRec = false;
this.userClickState = true;
if (e === 2) {
this.$router.replace({ path: "/consultant" });
}
}
} }
}; };
</script> </script>
<template> <template>
<modal <modal
v-model="show" :value="show"
:closeable="true" :closeable="true"
cancel-btn="" cancel-btn=""
confirm-btn="0.99元聘请" confirm-btn="0.99元聘请"
@confirm="go" @confirm="go"
@close="onClose"
class="rec" class="rec"
> >
<div class="rec-title" slot="title"> <div class="rec-title" slot="title">
...@@ -31,7 +32,8 @@ ...@@ -31,7 +32,8 @@
<script> <script>
import Modal from "@/components/Modal"; import Modal from "@/components/Modal";
const DIALOG_CHANGE_EVENT = "input"; const DIALOG_CLOSE_EVENT = "close";
export default { export default {
name: "AdvisorRecDialog", name: "AdvisorRecDialog",
components: { components: {
...@@ -51,14 +53,14 @@ export default { ...@@ -51,14 +53,14 @@ export default {
handler(val) { handler(val) {
this.show = val; this.show = val;
} }
},
show(val) {
this.$emit(DIALOG_CHANGE_EVENT, val);
} }
}, },
methods: { methods: {
onClose() {
this.$emit(DIALOG_CLOSE_EVENT, 1);
},
go() { go() {
this.$router.push("/goods/inform"); this.$emit(DIALOG_CLOSE_EVENT, 2);
} }
} }
}; };
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<script> <script>
const SCROLL_ACHOR_CHANGE_EVENT = "input"; const SCROLL_ACHOR_CHANGE_EVENT = "input";
const SCROLL_SHOW_EVENT = "show";
export default { export default {
name: "NavTab", name: "NavTab",
props: { props: {
...@@ -71,6 +72,7 @@ export default { ...@@ -71,6 +72,7 @@ export default {
} }
this.active = navIndex; this.active = navIndex;
this.showNavBar = scrollTop > 300; this.showNavBar = scrollTop > 300;
this.$emit(SCROLL_SHOW_EVENT, this.showNavBar);
}, },
// 跳转到指定索引的元素 // 跳转到指定索引的元素
scrollTo(index) { scrollTo(index) {
......
...@@ -16,8 +16,10 @@ export default { ...@@ -16,8 +16,10 @@ export default {
}, },
methods: { methods: {
...mapActions(["setIsShowLogin"]), ...mapActions(["setIsShowLogin"]),
...mapActions("user", ["setUserInfo"]),
showLoginPopup() { showLoginPopup() {
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.setUserInfo();
this.nextStep(); this.nextStep();
} else { } else {
this.setIsShowLogin(true); this.setIsShowLogin(true);
...@@ -37,10 +39,11 @@ export default { ...@@ -37,10 +39,11 @@ export default {
}; };
const res = await loginByPhone(formData); const res = await loginByPhone(formData);
if (res) { if (res) {
this.$notify("登录成功"); this.setUserInfo();
// localStorage.setItem("mongoToken", res.token); this.$notify({ type: "success", message: "登录成功" });
localStorage.set("mongoToken", res.token);
// TODO 开发目前使用这个token // TODO 开发目前使用这个token
localStorage.set("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12"); // localStorage.set("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
} }
return new Promise(resolve => { return new Promise(resolve => {
resolve(); resolve();
......
import { payByWay } from "@/service/pay"; import { payByWay } from "@/service/pay";
import { isXyqb, isWeixinBrower } from "@/service/validation"; import { isXyqb, isWeixinBrower } from "@/service/validation";
import { placeOrder } from "@/api/product"; import { placeOrder } from "@/api/product";
import localStorage from "@/service/localStorage";
import { mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
subFromData: {}, // 组装好的数据 subFromData: {}, // 组装好的数据
orderInfo: {}, orderInfo: {},
tradeType: "" openId: localStorage.get("openId"),
tradeType: "",
payTimer: null
// customTradeType: "" // customTradeType: ""
}; };
}, },
...@@ -15,6 +19,7 @@ export default { ...@@ -15,6 +19,7 @@ export default {
this.tradeType = this.customTradeType ?? (isXyqb ? "MWEB" : isWeixinBrower ? "JSAPI" : "MWEB"); this.tradeType = this.customTradeType ?? (isXyqb ? "MWEB" : isWeixinBrower ? "JSAPI" : "MWEB");
}, },
methods: { methods: {
...mapActions(["setIsLoading"]),
async generateOrder() { async generateOrder() {
const res = await placeOrder.create({ const res = await placeOrder.create({
...this.subFromData ...this.subFromData
...@@ -25,13 +30,21 @@ export default { ...@@ -25,13 +30,21 @@ export default {
} }
}, },
async goPay() { async goPay() {
const { tradeType, orderInfo } = this; const { tradeType, orderInfo, openId } = this;
const { payOrderNo, payType, orderNo } = orderInfo; const { payOrderNo, payType } = orderInfo;
if (!payOrderNo) { if (!payOrderNo) {
this.$toast("请先生成订单"); this.$toast("请先生成订单");
return; return;
} }
const res = await placeOrder.pay({ payOrderNo, payType, tradeType }); const params = {
payOrderNo,
payOrderType: payType,
tradeType
};
if (openId && tradeType === "JSAPI") {
params.openId = openId;
}
const res = await placeOrder.pay(params);
if (res) { if (res) {
let payInfo = { let payInfo = {
mock: true, mock: true,
...@@ -46,9 +59,23 @@ export default { ...@@ -46,9 +59,23 @@ export default {
payInfo = res.payInfo; payInfo = res.payInfo;
} }
payByWay(tradeType, payInfo).then(() => { payByWay(tradeType, payInfo).then(() => {
this.$router.push({ path: "/policy/detail/" + orderNo }); this.getPayResult();
}); });
} }
},
getPayResult() {
const { payOrderNo, orderNo } = this.orderInfo;
this.setIsLoading(true);
placeOrder.polling({ payOrderNo, payOrderType: 1 }).then(payRes => {
if (!payRes.result && payRes.payState === 2) {
this.payTimer = setTimeout(() => {
this.getPayResult();
}, 3000);
} else {
this.setIsLoading(false);
this.$router.push({ path: "/policy/detail/" + orderNo });
}
});
} }
} }
}; };
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script> <script>
import goodsList from "@/api/goodsList.mock"; import goodsList from "@/api/goodsList.mock";
import { list } from "@/api/product"; import { list, getLink } from "@/api/product";
import AiTestTip from "./modules/AiTestTip"; import AiTestTip from "./modules/AiTestTip";
import GoodList from "@/components/GoodList/index"; import GoodList from "@/components/GoodList/index";
...@@ -59,12 +59,13 @@ export default { ...@@ -59,12 +59,13 @@ export default {
return { return {
active: 0, active: 0,
showLayer: false, showLayer: false,
goodsList: [] goodsList: [],
goodsLink: ""
}; };
}, },
computed: { computed: {
list() { list() {
const { active } = this; const { active, goodsLink } = this;
const _catList = JSON.parse(JSON.stringify(categoryList)); const _catList = JSON.parse(JSON.stringify(categoryList));
this.goodsList.forEach(item => { this.goodsList.forEach(item => {
switch (item.itype) { switch (item.itype) {
...@@ -72,6 +73,9 @@ export default { ...@@ -72,6 +73,9 @@ export default {
_catList[0].children.push(item); _catList[0].children.push(item);
break; break;
case "cii": case "cii":
if (item.id === "BNZJX001") {
item.url = goodsLink;
}
(item.scope.includes(active) || active === 0) && _catList[1].children.push(item); (item.scope.includes(active) || active === 0) && _catList[1].children.push(item);
break; break;
case "ai": case "ai":
...@@ -89,6 +93,7 @@ export default { ...@@ -89,6 +93,7 @@ export default {
}, },
mounted() { mounted() {
this.getList(); this.getList();
this.getGoodsLink();
}, },
methods: { methods: {
async getList() { async getList() {
...@@ -106,6 +111,12 @@ export default { ...@@ -106,6 +111,12 @@ export default {
}); });
this.goodsList = goodsList; this.goodsList = goodsList;
} }
},
async getGoodsLink() {
const res = await getLink();
if (res) {
this.goodsLink = res.url;
}
} }
} }
}; };
......
...@@ -121,11 +121,10 @@ export default { ...@@ -121,11 +121,10 @@ export default {
if (!this.isLogin) { if (!this.isLogin) {
return "去投票"; return "去投票";
} }
return "";
} }
}, },
created() { created() {},
},
methods: { methods: {
gameStart() { gameStart() {
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -251,6 +251,10 @@ ...@@ -251,6 +251,10 @@
font-size: 16px; font-size: 16px;
color: #999999; color: #999999;
line-height: 19px; line-height: 19px;
a {
font-size: 16px;
color: #999999;
}
} }
p:last-child { p:last-child {
......
...@@ -87,7 +87,9 @@ ...@@ -87,7 +87,9 @@
</a> </a>
</div> </div>
<div class="home-phone"> <div class="home-phone">
<p>客服电话:{{ tel }}</p> <p>
客服电话:<a :href="`tel:${tel}`">{{ tel }}</a>
</p>
<p>服务时间:{{ serviceHours }}</p> <p>服务时间:{{ serviceHours }}</p>
</div> </div>
<copyright :logo="true" /> <copyright :logo="true" />
...@@ -98,7 +100,7 @@ ...@@ -98,7 +100,7 @@
import GoodList from "@/components/GoodList/index"; import GoodList from "@/components/GoodList/index";
import Tabbar from "@/components/Tabbar"; import Tabbar from "@/components/Tabbar";
import Copyright from "@/components/Copyright"; import Copyright from "@/components/Copyright";
import { list } from "@/api/product"; import { list, getLink } from "@/api/product";
import goodsList from "@/api/goodsList.mock"; import goodsList from "@/api/goodsList.mock";
import settings from "@/api/settings"; import settings from "@/api/settings";
...@@ -151,6 +153,13 @@ export default { ...@@ -151,6 +153,13 @@ export default {
}); });
}); });
this.goodsList = goodsList; this.goodsList = goodsList;
this.getGoodsLink();
}
},
async getGoodsLink() {
const res = await getLink();
if (res) {
this.goodsList[3].url = res.url;
} }
} }
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
name="holderUserInfo_name" name="holderUserInfo_name"
label="姓名" label="姓名"
placeholder="请输入投保人姓名" placeholder="请输入投保人姓名"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入投保人姓名' }]" :rules="[{ required: true, message: '请输入投保人姓名' }]"
@click.native="inputClick" @click.native="inputClick"
/> />
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
name="holderUserInfo_idNo" name="holderUserInfo_idNo"
label="身份证号" label="身份证号"
placeholder="请填写投保人身份证号" placeholder="请填写投保人身份证号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请填写投保人身份证号' }]" :rules="[{ required: true, message: '请填写投保人身份证号' }]"
@click.native="inputClick" @click.native="inputClick"
/> />
...@@ -33,6 +35,7 @@ ...@@ -33,6 +35,7 @@
type="tel" type="tel"
label="手机号" label="手机号"
placeholder="请填写投保人手机号" placeholder="请填写投保人手机号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请填写投保人手机号' }]" :rules="[{ required: true, message: '请填写投保人手机号' }]"
@click.native="inputClick" @click.native="inputClick"
/> />
...@@ -79,11 +82,7 @@ ...@@ -79,11 +82,7 @@
:rules="[{ required: true, message: '请选择投保人职业' }]" :rules="[{ required: true, message: '请选择投保人职业' }]"
> >
<template #input> <template #input>
<popup-picker <popup-cascade />
:picker-data="['老师', '工人']"
v-model="formData.holderUserInfo.occupation"
placeholder="请选择投保人职业"
/>
</template> </template>
</cr-field> </cr-field>
<cr-field <cr-field
...@@ -160,12 +159,13 @@ ...@@ -160,12 +159,13 @@
> >
<div class="form-unit" slot="button">公斤</div> <div class="form-unit" slot="button">公斤</div>
</cr-field> </cr-field>
<template v-if="formData.insuredUserInfo.relation !== '0'"> <template v-if="formData.insuredUserInfo.relation !== '1'">
<cr-field <cr-field
v-model="formData.insuredUserInfo.name" v-model="formData.insuredUserInfo.name"
name="insuredUserInfo_name" name="insuredUserInfo_name"
label="姓名" label="姓名"
placeholder="请输入投保人姓名" placeholder="请输入投保人姓名"
:readonly="infoReadonly"
:rules="[{ required: true, message: '请输入投保人姓名' }]" :rules="[{ required: true, message: '请输入投保人姓名' }]"
/> />
<cr-field <cr-field
...@@ -173,6 +173,7 @@ ...@@ -173,6 +173,7 @@
name="insuredUserInfo_idNo" name="insuredUserInfo_idNo"
label="身份证号" label="身份证号"
placeholder="请填写投保人身份证号" placeholder="请填写投保人身份证号"
:readonly="infoReadonly"
:rules="[{ required: true, message: '请填写投保人身份证号' }]" :rules="[{ required: true, message: '请填写投保人身份证号' }]"
/> />
<cr-field <cr-field
...@@ -343,9 +344,11 @@ import PopupPicker from "@/components/PopupPicker"; ...@@ -343,9 +344,11 @@ import PopupPicker from "@/components/PopupPicker";
import PopupAreaPicker from "@/components/PopupAreaPicker"; import PopupAreaPicker from "@/components/PopupAreaPicker";
import PopupDatePicker from "@/components/PopupDatePicker"; import PopupDatePicker from "@/components/PopupDatePicker";
import PopupWithIframe from "@/components/PopupWithIframe"; import PopupWithIframe from "@/components/PopupWithIframe";
import PopupCascade from "@/components/PopupCascade";
import Stepper from "@/components/Stepper"; import Stepper from "@/components/Stepper";
import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog"; import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog";
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin"; import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
...@@ -353,6 +356,9 @@ import Detail from "@/api/detail.huagui.shouxian"; ...@@ -353,6 +356,9 @@ import Detail from "@/api/detail.huagui.shouxian";
import { list, trail } from "@/api/product"; import { list, trail } from "@/api/product";
import { getFamilyList } from "@/api/user"; import { getFamilyList } from "@/api/user";
import { parseTime } from "@/service/utils"; import { parseTime } from "@/service/utils";
const AUTO_SAVE_KEY = "PolicyFormData";
const AUTO_SAVE_TARGET = "formData";
const { const {
headerInfo, headerInfo,
popupArray, popupArray,
...@@ -366,7 +372,7 @@ const { ...@@ -366,7 +372,7 @@ const {
} = Detail; } = Detail;
export default { export default {
name: "AddPolicy", name: "AddPolicy",
mixins: [detailPayMixin], mixins: [detailPayMixin, autoSaveForm],
components: { components: {
GoodAction, GoodAction,
CrRadioBtn, CrRadioBtn,
...@@ -375,6 +381,7 @@ export default { ...@@ -375,6 +381,7 @@ export default {
PopupAreaPicker, PopupAreaPicker,
PopupDatePicker, PopupDatePicker,
PopupWithIframe, PopupWithIframe,
PopupCascade,
Stepper Stepper
}, },
data() { data() {
...@@ -387,10 +394,11 @@ export default { ...@@ -387,10 +394,11 @@ export default {
currentPupopIndex: null, currentPupopIndex: null,
goodActionInfo: {}, goodActionInfo: {},
goodBuyModalInfo: [], goodBuyModalInfo: [],
mongoToken: localStorage.get("mongoToken"),
policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"), policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
formData: { formData: {
insuredUserInfo: { insuredUserInfo: {
relation: "0" relation: "1"
}, },
holderUserInfo: {}, holderUserInfo: {},
productItem: { productItem: {
...@@ -406,13 +414,23 @@ export default { ...@@ -406,13 +414,23 @@ export default {
termOptions, termOptions,
paywayOptions, paywayOptions,
benefitOptions, benefitOptions,
insuredAmountOptions insuredAmountOptions,
selfInfoReadonly: false,
infoReadonly: false
}; };
}, },
watch: { watch: {
popupShow(val) { popupShow(val) {
if (!val && this.currentPupopIndex === 6) this.currentPupopIndex = null; if (!val && this.currentPupopIndex === 6) this.currentPupopIndex = null;
}, },
userInfo: {
immediate: true,
deep: true,
handler(val) {
this.formData.holderUserInfo.phoneNo =
val.phoneNoMask && val.phoneNoMask !== "点击登录" ? val.phoneNoMask : "";
}
},
headerInfo: { headerInfo: {
deep: true, deep: true,
handler(val) { handler(val) {
...@@ -426,6 +444,7 @@ export default { ...@@ -426,6 +444,7 @@ export default {
formDataCpu: { formDataCpu: {
deep: true, deep: true,
handler() { handler() {
this.autoSaveHandler(AUTO_SAVE_TARGET, AUTO_SAVE_KEY);
if (this.calTimer) { if (this.calTimer) {
clearTimeout(this.calTimer); clearTimeout(this.calTimer);
} }
...@@ -442,6 +461,7 @@ export default { ...@@ -442,6 +461,7 @@ export default {
this.formData.holderUserInfo.name = xyqbUserInfo.nameMask; this.formData.holderUserInfo.name = xyqbUserInfo.nameMask;
this.formData.holderUserInfo.idNo = xyqbUserInfo.idNoMask; this.formData.holderUserInfo.idNo = xyqbUserInfo.idNoMask;
this.formData.holderUserInfo.phoneNo = xyqbUserInfo.phoneNoMask; this.formData.holderUserInfo.phoneNo = xyqbUserInfo.phoneNoMask;
this.selfInfoReadonly = true;
this.$forceUpdate(); this.$forceUpdate();
} }
} }
...@@ -449,12 +469,18 @@ export default { ...@@ -449,12 +469,18 @@ export default {
}, },
computed: { computed: {
...mapState(["showAuthXyqb"]), ...mapState(["showAuthXyqb"]),
...mapState("user", ["userInfo"]),
pupopData() { pupopData() {
const { popupArray, currentPupopIndex } = this; const { popupArray, currentPupopIndex } = this;
return popupArray[currentPupopIndex] || {}; return popupArray[currentPupopIndex] || {};
}, },
formDataCpu() { formDataCpu() {
return JSON.parse(JSON.stringify(this.formData)); return JSON.parse(JSON.stringify(this.formData));
},
socialSecurityReadonly() {
const { relation } = this.formData.insuredUserInfo;
const { selfInfoReadonly, infoReadonly } = this;
return (relation === "1" && selfInfoReadonly) || (relation !== "1" && infoReadonly);
} }
}, },
mounted() { mounted() {
...@@ -464,6 +490,7 @@ export default { ...@@ -464,6 +490,7 @@ export default {
}, },
methods: { methods: {
...mapActions(["setAuthXyqb"]), ...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setUserInfo"]),
inputClick() { inputClick() {
if (this.showAuthXyqb === 1) { if (this.showAuthXyqb === 1) {
this.setAuthXyqb(2); this.setAuthXyqb(2);
...@@ -485,23 +512,30 @@ export default { ...@@ -485,23 +512,30 @@ export default {
relationChange(relation = this.formData.insuredUserInfo.relation) { relationChange(relation = this.formData.insuredUserInfo.relation) {
this.familyList.forEach(item => { this.familyList.forEach(item => {
const { relation, nameMask: name, idNoMask: idNo, userInfoSecId, socialSecurity } = item; const { relation, nameMask: name, idNoMask: idNo, userInfoSecId, socialSecurity } = item;
if (+relation === 0) { if (+relation === 1) {
this.formData.holderUserInfo = { this.formData.holderUserInfo = {
...this.formData.holderUserInfo, ...this.formData.holderUserInfo,
...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity ? "1" : "0" } ...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity ? "1" : "0" }
}; };
this.selfInfoReadonly = true;
} }
}); });
const userArray = this.familyList.filter(item => item.relation === +relation); const userArray = this.familyList.filter(
item => item.relation === +relation && item.relation !== 1
);
let [name, idNo, userInfoSecId, socialSecurity] = ["", "", "", "0"]; let [name, idNo, userInfoSecId, socialSecurity] = ["", "", "", "0"];
if (userArray.length) { if (userArray.length) {
let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0]; let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0];
[name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss]; [name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss];
this.infoReadonly = true;
} else {
this.infoReadonly = false;
} }
this.formData.insuredUserInfo = { this.formData.insuredUserInfo = {
...this.formData.insuredUserInfo, ...this.formData.insuredUserInfo,
...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity ? "1" : "0" } ...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity }
}; };
this.$forceUpdate();
}, },
openIframePupop(index) { openIframePupop(index) {
this.currentPupopIndex = index; this.currentPupopIndex = index;
...@@ -535,10 +569,21 @@ export default { ...@@ -535,10 +569,21 @@ export default {
} }
}, },
async getFamilyList() { async getFamilyList() {
if (!this.mongoToken) return;
this.setUserInfo();
const res = await getFamilyList(); const res = await getFamilyList();
if (res) { if (res) {
this.familyList = res; this.familyList = res;
this.showAuthXyqb === -1 && this.relationChange(); if (this.hasAutoSaveData(AUTO_SAVE_KEY)) {
this.getSaveInfoHandler(AUTO_SAVE_KEY, AUTO_SAVE_TARGET);
} else {
const queryId = this.$route.query.userInfoSecId;
let relation = this.formData.insuredUserInfo.relation;
if (queryId) {
relation = this.familyList.filter(item => item.userInfoSecId === queryId)[0].relation;
}
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
}
} }
}, },
async calFee() { async calFee() {
...@@ -551,7 +596,7 @@ export default { ...@@ -551,7 +596,7 @@ export default {
} = this.formData.productItem; } = this.formData.productItem;
let idNo = ""; let idNo = "";
const { socialSecurity } = this.formData.insuredUserInfo; const { socialSecurity } = this.formData.insuredUserInfo;
if (this.formData.insuredUserInfo.relation !== "0") { if (this.formData.insuredUserInfo.relation !== "1") {
idNo = this.formData.insuredUserInfo.idNo; idNo = this.formData.insuredUserInfo.idNo;
} else { } else {
idNo = this.formData.holderUserInfo.idNo; idNo = this.formData.holderUserInfo.idNo;
......
...@@ -137,8 +137,8 @@ export default { ...@@ -137,8 +137,8 @@ export default {
orderNo: item?.orderNo orderNo: item?.orderNo
}; };
this.goPay(); this.goPay();
} else if (text === "联系客服") { // eslint-disable-next-line
} } else if (text === "联系客服") {}
}, },
goDetail(orderNo) { goDetail(orderNo) {
const policy = this.list.find(v => v.orderNo === orderNo); const policy = this.list.find(v => v.orderNo === orderNo);
......
...@@ -886,10 +886,10 @@ ...@@ -886,10 +886,10 @@
resolved "http://npmprivate.quantgroups.com/@nodelib%2ffs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" resolved "http://npmprivate.quantgroups.com/@nodelib%2ffs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
"@qg/cherry-ui@^1.1.2": "@qg/cherry-ui@^1.2.1":
version "1.1.2" version "1.2.1"
resolved "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-1.1.2.tgz#9019e409b3cf66ebf634b1090c5a8321cb78a05d" resolved "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-1.2.1.tgz#5f59ebf0ed677c6d3f41dd04e3b9f6a43811936b"
integrity sha512-P2bFNNcoFNF1xgBO5p0XSejulyriIAtsYCK0KICUXq5nRhP+zCOCPZPVghbVtZvmEDCFibNgGZFzqFn0rkjEfg== integrity sha512-icj5WLUCJswPLF02YtCdppdfSDwQQrFoLxhRFCie2SFffIKVZSMEtSVVuEh2nZv2khPd/cvEISGpmzwDcBS7tw==
"@qg/qg-scroll@^1.4.2": "@qg/qg-scroll@^1.4.2":
version "1.4.2" version "1.4.2"
......
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