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

Merge branch 'feature/goods' into 'master'

Feature/goods

See merge request !37
parents e9d11fea e0213ac4
......@@ -20,6 +20,11 @@ export const getCulsuggestion = param => {
return req.get("consultant/suggestion/detail", param);
};
// 创建顾问订单-查询顾问信息
export const getCulInfo = param => {
return req.post("consultant/info", param);
};
// 查询顾问订单信息
export const getCulOrder = param => {
return req.get("consultant/order/query", param);
......
......@@ -69,10 +69,10 @@ export default {
{ label: "无社保", value: "0" }
],
insuredOptions: [
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
],
medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
......
......@@ -82,10 +82,10 @@ export default {
{ label: "10万", value: "100000" }
],
insuredOptions: [
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
],
paywayOptions: [
{ label: "月缴<small style='color: #999;font-size: 11px'>(12期)</small>", value: "1" },
......
......@@ -71,10 +71,10 @@ export default {
],
planTipOptions: ["不限社保", "报销自费药", "额外400万特定赔付"],
insuredOptions: [
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
],
medicalOptions: [
{ label: "有<small style='color: #999;font-size: 11px'>(含新农合)</small>", value: "1" },
......
......@@ -4,7 +4,7 @@
* @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37
* @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";
......@@ -100,10 +100,10 @@ export default {
{ label: "10万", value: "100000" }
],
insuredOptions: [
{ label: "本人", value: "0" },
{ label: "配偶", value: "1" },
{ label: "父母", value: "2" },
{ label: "子女", value: "3" }
{ label: "本人", value: "1" },
{ label: "配偶", value: "2" },
{ label: "父母", value: "3" },
{ label: "子女", value: "4" }
],
noticeCellInfo: {
"1000000": [
......
......@@ -58,12 +58,32 @@ export default [
],
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",
itype: "cii",
scope: [1, 3],
img: good02,
url: "http://www.baidu.com",
url: "",
title: "百年康惠保(2.0)重大疾病险",
sub: "终身保障155种重疾,最多赔付6次",
glory: "",
......@@ -82,26 +102,6 @@ export default [
{ 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",
itype: "li",
......
This diff is collapsed.
......@@ -5,11 +5,20 @@ export const list = param => {
return req.get("product/list", param);
};
// 产品详情
export const detail = param => {
return req.get("product/detail", param);
// 获取产品H5链接
export const getLink = () => {
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 => {
return req.post("product/price/trail", param);
......@@ -27,6 +36,8 @@ export const placeOrder = {
},
// 轮询支付结果
polling: params => {
return req.get("pay/result", params);
return req.get("pay/result", {
params
});
}
};
......@@ -3,5 +3,17 @@ export default {
serviceHours: "9:00-21:00",
sobot: "",
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 => {
// 信用钱包用户自动登录
export const authByxyqb = param => {
return req.get("xyqb_user_info", param);
return req.get("user/info/xyqb", {
params: param
});
};
// 微信用户获取openid
......
<template>
<cr-radio-group v-model="radioVal" class="radio-btn">
<cr-radio-group v-model="radioVal" class="radio-btn" :class="{ readonly }">
<cr-radio
:name="item.value"
:class="{ checked: value === item.value }"
......@@ -26,6 +26,10 @@ export default {
return [];
}
},
readonly: {
type: Boolean,
default: false
},
value: null
},
watch: {
......@@ -51,6 +55,21 @@ export default {
justify-content: space-around;
align-items: center;
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 {
margin-right: 10px;
flex: 1;
......
......@@ -92,9 +92,9 @@ export default {
if (res) {
this.$notify({ type: "success", message: "登录成功" });
this.setIsShowLogin(false);
// localStorage.setItem("mongoToken", res.token);
localStorage.setItem("mongoToken", res.token);
// TODO 开发目前使用这个token
localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
// localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
}
},
async getCode() {
......
......@@ -6,7 +6,7 @@
get-container="body"
close-icon="close"
class="panel-wrap"
@close="onClose"
@closed="onClose"
>
<div class="panel">
<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 @@
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<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>
</div>
</template>
<script>
import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import { parseTime } from "@/service/utils";
export default {
name: "PopupDatePicker",
mixins: [popupPickerMixin],
data() {
return {
refName: "datepicker"
refName: "datepicker",
initVal: parseTime("", "{y}-{m}-{d}")
};
},
methods: {
......
export default {
basicHost: "http://yapi.quantgroups.com/mock/329/",
// basicHost: "http://192.168.29.100:8964/",
// basicHost: "http://192.168.29.211:8964/",
wxAppId: "wx514de17b23d53a20"
};
export default {
basicHost: "http://192.168.29.211:80/",
basicHost: "http://192.168.29.211:8964/",
// basicHost: "http://127.0.0.1:8964/",
// basicHost: "https://hathaway-mg.liangkebang.net/",
wxAppId: "wx514de17b23d53a20"
......
......@@ -5,7 +5,7 @@ import router from "./router";
import store from "./store";
import "./style/index.less";
import "amfe-flexible";
// import vConsole from "vconsole";
import vConsole from "vconsole";
import "@/assets/icons/index";
import "@/service/cherry-ui";
......@@ -18,5 +18,5 @@ new Vue({
// 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 @@
* @Description: PopupPicker mixin
* @Date: 2020-07-28 19:46:31
* @LastEditors: gzw
* @LastEditTime: 2020-07-28 20:33:52
* @LastEditTime: 2020-08-16 21:21:05
*/
// TODO 默认值需要处理
......@@ -33,7 +33,7 @@ export default {
},
watch: {
show(val) {
if (val && !this.refreshed) {
if (val && !this.refreshed && this.$refs[this.refName]) {
this.refreshed = true;
this.$refs[this.refName].refreshColumns();
}
......
......@@ -42,7 +42,6 @@ async function getAuthInfo(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(() => {});
......
......@@ -2,12 +2,12 @@
* @Description: 支付微信h5, jsapi, 第三方收银台,跳转)
* @Date: 2020-07-28 15:03:52
* @LastEditors: gzw
* @LastEditTime: 2020-08-12 17:59:02
* @LastEditTime: 2020-08-13 14:14:32
*/
import cherry from "@qg/cherry-ui";
import qs from "qs";
const { Notify } = cherry;
// import cherry from "@qg/cherry-ui";
// import qs from "qs";
// const { Notify } = cherry;
/**
* payByWeixinJsapi
......@@ -22,17 +22,18 @@ function payByWeixinJsapi(info = {}, callback) {
// eslint-disable-next-line no-undef
WeixinJSBridge.invoke("getBrandWCPayRequest", info, function(res) {
console.log(res);
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
callback("ok");
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
// 支付取消
callback("cancel");
} else {
// 支付失败
callback("fail");
}
callback();
// if (res.err_msg == "get_brand_wcpay_request:ok") {
// // 使用以上方式判断前端返回,微信团队郑重提示:
// //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") {
......@@ -54,12 +55,12 @@ function payByWeixinJsapi(info = {}, callback) {
* @param {type}
* @return:
*/
function payByWeixinH5(info) {
if (info.url) return;
const currentPath = encodeURIComponent(
window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
);
window.location.href = `${info.url}&redirect_url=${currentPath}`;
function payByWeixinH5() {
// if (info.url) return;
// const currentPath = encodeURIComponent(
// window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
// );
// window.location.href = `${info.url}&redirect_url=${currentPath}`;
}
/**
......@@ -70,12 +71,12 @@ function payByWeixinH5(info) {
* @param {type}
* @return:
*/
function payByThirdPartyCashier(info) {
if (info.url) return;
const currentPath = encodeURIComponent(
window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
);
window.location.href = `${info.url}&redirect_uri=${currentPath}`;
function payByThirdPartyCashier() {
// if (info.url) return;
// const currentPath = encodeURIComponent(
// window.location.href + qs.stringify(info.params, { encode: true, addQueryPrefix: true })
// );
// window.location.href = `${info.url}&redirect_uri=${currentPath}`;
}
/**
......@@ -88,13 +89,13 @@ function payByThirdPartyCashier(info) {
export function payByWay(type = "THIRD", payInfo) {
return new Promise(resolve => {
if (type === "JSAPI") {
payByWeixinJsapi(payInfo, function(e) {
if (e === "ok") {
Notify({ type: "success", message: "支付成功" });
} else {
Notify({ type: "warning", message: "支付失败" });
}
resolve(e);
payByWeixinJsapi(payInfo, function() {
// if (e === "ok") {
// Notify({ type: "success", message: "支付成功" });
// } else {
// Notify({ type: "warning", message: "支付失败" });
// }
resolve();
});
} else if (type === "MWEB") {
payByWeixinH5(payInfo);
......
......@@ -4,7 +4,6 @@ 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);
export default new Vuex.Store({
......@@ -12,7 +11,7 @@ export default new Vuex.Store({
activeIdx: 0,
isLoading: 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: {
setActiveIdx(state, value) {
......
......@@ -88,6 +88,7 @@ import { create, goPay } from "@/api/consultant";
import Card from "@/components/Card";
import Collapse from "@/components/Collapse";
import CpsQa from "../../Goods/Detail/modules/CpsQA";
export default {
name: "ConsultantBuy",
components: {
......@@ -105,7 +106,7 @@ export default {
data() {
return {
isLogin: localStorage.get("mongoToken"),
remain: 126,
remain: 0,
price: [0.99, 199],
consultantOrderNo: "",
tradeType: isXyqb ? "MWEB" : "JSAPI",
......@@ -205,13 +206,17 @@ export default {
},
watch: {
isShowLogin(val) {
console.log(111);
if (!val) {
this.isLogin = localStorage.get("mongoToken");
}
},
isLogin() {
this.checkLogin();
}
},
mounted() {},
mounted() {
this.updateRemain();
},
methods: {
...mapActions(["setIsShowLogin"]),
checkLogin() {
......@@ -225,10 +230,21 @@ export default {
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() {
const res = await create();
if (res) {
this.consultantOrderNo = res.consultantOrderNo;
this.updateRemain(true);
this.goPay();
}
},
......
......@@ -6,7 +6,7 @@
<h1>{{ info.name }}</h1>
<cr-tag><svg-icon icon-class="medal" />{{ info.role }}</cr-tag>
<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>
<cr-image
class="cul-hd-img"
......@@ -21,7 +21,7 @@
<div class="cul-entry-title">
<h3>您的专属保险方案</h3>
<small>CAPTIVE INSURANC</small>
<cr-tag>自己</cr-tag>
<cr-tag v-if="relation">{{ relation }}</cr-tag>
</div>
<svg-icon icon-class="arrow-right" />
</router-link>
......@@ -84,6 +84,10 @@
<script>
import copyright from "@/components/Copyright";
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 {
name: "ConsultantExclusive",
components: {
......@@ -98,16 +102,9 @@ export default {
},
data() {
return {
relation: "",
info: {
name: "李玉婷",
role: "金牌保险顾问",
id: "20192000000080002020003828",
qrcode: "",
avator: "",
serveNum: 38100,
rate: "99.8%",
tel: "13888888888",
date: "9:00 ~ 21:00"
...consultant
},
oddsInsureList: [
{
......@@ -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>
<style lang="less" src="./index.less" scoped></style>
......@@ -2,20 +2,18 @@
<div class="container">
<div class="cul-hd">
<div class="cul-hd-rec">
<small class="cul-hd-rec-sub">
HI,{{ baseInfo.userName }}{{ baseInfo.sex === 1 ? "先生" : "女士" }}
</small>
<h4 class="cul-hd-rec-title">以下是您本人的专属保险方案</h4>
<small class="cul-hd-rec-sub"> HI,{{ goodInfo.name || "-" }}</small>
<h4 class="cul-hd-rec-title">以下是您{{ goodInfo.relation || "-" }}的专属保险方案</h4>
</div>
<card title="1">
<h5 class="cul-hd-card-title" slot="header">
总保费:
<strong>{{ goodInfo.totalAmount }}</strong>
{{ baseInfo.unit }}
<strong>{{ goodInfo.totalAmount || "-" }}</strong>
元/年
</h5>
<p class="cul-hd-card-content">
推荐理由:
{{ goodInfo.remarks }}
{{ goodInfo.remarks || "-" }}
</p>
</card>
</div>
......@@ -106,13 +104,6 @@ export default {
goodInfo: {
ensure: []
},
baseInfo: {
userName: "王斌",
sex: 1,
amount: 10425,
unit: "元/年",
reason: "推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由推荐理由"
},
distList: [
{ title: "医疗险", price: "500万" },
{ title: "重疾险", price: "50万" },
......
......@@ -169,9 +169,9 @@ export default {
formData: {
birthday: "",
socialSecurity: "",
annualIncome: "",
loan: "",
addressCode: "111,111,11",
annualIncome: "10万",
loan: "无房贷",
addressCode: "北京市,北京市",
questionType: "",
userName: "",
gender: "",
......@@ -306,12 +306,16 @@ export default {
if (type === "annualIncome" || type === "loan") {
value = value[0];
}
// if (type === "area") {}
if (type === "addressCode") {
value = value.map(item => item.name).join(",");
}
this.formData[type] = value;
},
async onSubmit() {
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) {
setTimeout(() => {
this.showSubState = false;
......
......@@ -36,14 +36,14 @@ export default {
orderInfo: [
{
consultantOrderNo: "",
state: 0
state: -1
}
]
};
},
computed: {
orderState() {
return this.orderInfo[0].state;
return this.orderInfo[0] ? this.orderInfo[0].state : -1;
},
...mapState(["isShowLogin"])
},
......@@ -51,6 +51,7 @@ export default {
isShowLogin(val) {
if (!val) {
this.isLogin = localStorage.get("mongoToken");
this.getOrderInfo();
}
}
},
......
<template>
<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" />
<div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
......@@ -9,7 +9,11 @@
<plan-tip :tip-list="planTipOptions" />
</card>
<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
v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo"
......@@ -39,7 +43,11 @@
</div>
<detail-footer :company-info="companyInfo" />
<copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" />
<good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe
v-model="popupShow"
:title="pupopData.title"
......@@ -125,12 +133,12 @@ export default {
goodBuyModalInfo: [],
popupShow: false,
currentPupopIndex: null,
goodActionShow: false,
calTimer: null,
formData: {
name: "",
idNo: "",
socialSecurity: "1",
relation: "0",
relation: "1",
payType: "1",
amountInsured: "1000000",
autoRenewPolicy: false,
......@@ -203,10 +211,16 @@ export default {
this.popupShow = true;
},
onSubmit() {
if (localStorage.get("mongoToken")) {
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(Object.assign(this.formData, { productNo: this.goodId }))
......@@ -214,6 +228,9 @@ export default {
},
onFailed(errorInfo) {
const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message });
},
nextStep() {
......@@ -221,7 +238,37 @@ export default {
this.generateOrder();
},
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() {
this.goodId = this.$route.query.id;
......@@ -237,13 +284,14 @@ export default {
},
async calFee() {
let { price } = this.headerInfo;
const { idNo, amountInsured } = this.formData;
const { idNo, amountInsured, userInfoSecId } = this.formData;
if (!idNo || !amountInsured) return;
const _param = {
productNo: this.goodId,
productUserInfo: {
userInfo: {
idNo
idNo,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
amountInsured
......
<template>
<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" />
<div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
......@@ -9,7 +9,11 @@
<plan-tip :tip-list="planTipOptions" />
</card>
<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
v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo"
......@@ -38,7 +42,11 @@
</div>
<detail-footer :company-info="companyInfo" />
<copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" />
<good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe
v-model="popupShow"
:title="pupopData.title"
......@@ -122,12 +130,12 @@ export default {
goodActionInfo: {},
goodBuyModalInfo: [],
popupShow: false,
goodActionShow: false,
currentPupopIndex: null,
formData: {
name: "",
idNo: "",
socialSecurity: "1",
relation: "0",
relation: "1",
payType: "1",
amountInsured: "300000",
autoRenewPolicy: false,
......@@ -160,6 +168,12 @@ export default {
}
const { idNo, payType } = val;
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;
this.calTimer = setTimeout(() => {
this.calFee();
......@@ -206,17 +220,22 @@ export default {
this.popupShow = true;
},
onSubmit() {
if (localStorage.get("mongoToken")) {
this.goInsureState = true;
this.$refs.insureForm.getFamilyList();
} else {
const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true;
sessionStorage.setItem(
"policyFormData",
JSON.stringify(Object.assign(this.formData, { productNo: this.goodId }))
);
this.$refs.insureForm.getFamilyList();
});
}
},
onFailed(errorInfo) {
const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message });
},
nextStep() {
......@@ -245,7 +264,7 @@ export default {
userInfo: {
idNo,
socialSecurity: !!Number(socialSecurity),
userInfoSecId: userInfoSecId ?? null
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
payType,
......
<template>
<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">
<div class="li-header">
<plan-tip :tip-list="planTipOptions" />
......@@ -71,6 +71,11 @@
</div>
<detail-footer :company-info="companyInfo" />
<copyright />
<good-action
:content="goodActionInfo"
:class="{ 'cal-fee': currentPupopIndex === 6 }"
v-show="goodActionShow"
/>
<good-action :content="goodActionInfo" :class="{ 'cal-fee': currentPupopIndex === 6 }" />
<popup-with-iframe
v-model="popupShow"
......@@ -138,6 +143,7 @@ export default {
goodId: "",
calTimer: null,
goodActionInfo: {},
goodActionShow: false,
popupShow: false,
currentPupopIndex: null,
formData: {},
......@@ -198,6 +204,9 @@ export default {
},
onFailed(errorInfo) {
const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message });
},
nextStep() {
......
<template>
<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" />
<div class="det-body">
<card title="保险计划" :option="['查看详情']" @option-click="openIframePupop(4)">
......@@ -8,7 +8,11 @@
<plan-tip :tip-list="planTipOptions" />
</card>
<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
v-model="formData.autoRenewPolicy"
:cell-data="autoCellInfo"
......@@ -37,7 +41,11 @@
</div>
<detail-footer :company-info="companyInfo" />
<copyright />
<good-action @leftClick="goInsureState = true" :content="goodActionInfo" />
<good-action
@leftClick="goInsureState = true"
:content="goodActionInfo"
v-show="goodActionShow"
/>
<popup-with-iframe
v-model="popupShow"
:title="pupopData.title"
......@@ -86,6 +94,7 @@ import detailPayMixin from "./modules/detailPay.mixin";
import detailLoginMixin from "./modules/detailLogin.mixin";
import { trail, list } from "@/api/product";
import localStorage from "@/service/localStorage";
import Detail from "@/api/detail.taikang.yiliaobaozhang";
export default {
......@@ -128,12 +137,13 @@ export default {
name: "",
idNo: "",
socialSecurity: "1",
relation: "0",
relation: "1",
payType: "1",
planValue: "3",
autoRenewPolicy: false,
read: true
},
goodActionShow: false,
goInsureState: false
};
},
......@@ -198,14 +208,23 @@ export default {
this.popupShow = true;
},
onSubmit() {
if (localStorage.get("mongoToken")) {
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));
},
onFailed(errorInfo) {
const { errors } = errorInfo;
setTimeout(() => {
this.$refs.navTab.showNavBar = false;
}, 0);
this.$notify({ type: "warning", message: errors[0].message });
},
nextStep() {
......@@ -219,7 +238,7 @@ export default {
idNo,
relation,
socialSecurity,
// selfSocialSecurity,
selfSocialSecurity,
selfName,
selfIdNo,
selfPhone,
......@@ -228,26 +247,31 @@ export default {
autoRenewPolicy
} = this.formData;
this.subFromData = {
insuredUserInfo: {
userInfoSecId: userInfoSecId ?? null,
name,
idNo,
relation,
socialSecurity: !!Number(socialSecurity)
},
productNo: this.goodId,
holderUserInfo: {
phoneNo: selfPhone,
userInfoSecId: selfSecId ?? null,
userInfoSecId: selfSecId ? selfSecId : null,
name: selfName,
idNo: selfIdNo
// socialSecurity: selfSocialSecurity ? !!Number(selfSocialSecurity) : null
},
productItem: {
payType
},
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() {
this.goodId = this.$route.query.id;
......@@ -272,7 +296,7 @@ export default {
userInfo: {
idNo,
socialSecurity: !!Number(socialSecurity),
userInfoSecId: userInfoSecId ?? null
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
payType
......
......@@ -4,6 +4,7 @@
<mi-detail v-if="detailType === 'mi'" />
<ai-detail v-if="detailType === 'ai'" />
<li-detail v-if="detailType === 'li'" />
<advisor-rec-dialog :value="showRec" @close="pageBack" />
</div>
</template>
......@@ -12,22 +13,57 @@ import ciiDetail from "./CIIDetail";
import miDetail from "./MIDetail";
import liDetail from "./LIDetail";
import aiDetail from "./AIDetail";
import AdvisorRecDialog from "./modules/AdvisorRecDialog";
import { getCulOrder } from "@/api/consultant";
import localStorage from "@/service/localStorage";
export default {
name: "GoodsDetail",
components: {
ciiDetail,
miDetail,
aiDetail,
liDetail
liDetail,
AdvisorRecDialog
},
data() {
return {
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() {
this.getOrderInfo();
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>
<template>
<modal
v-model="show"
:value="show"
:closeable="true"
cancel-btn=""
confirm-btn="0.99元聘请"
@confirm="go"
@close="onClose"
class="rec"
>
<div class="rec-title" slot="title">
......@@ -31,7 +32,8 @@
<script>
import Modal from "@/components/Modal";
const DIALOG_CHANGE_EVENT = "input";
const DIALOG_CLOSE_EVENT = "close";
export default {
name: "AdvisorRecDialog",
components: {
......@@ -51,14 +53,14 @@ export default {
handler(val) {
this.show = val;
}
},
show(val) {
this.$emit(DIALOG_CHANGE_EVENT, val);
}
},
methods: {
onClose() {
this.$emit(DIALOG_CLOSE_EVENT, 1);
},
go() {
this.$router.push("/goods/inform");
this.$emit(DIALOG_CLOSE_EVENT, 2);
}
}
};
......
<template>
<div>
<card title="请填写投保信息" class="insure-card">
<h6 class="insure-form-title">本人信息</h6>
<cr-cell-group class="insure-form">
......@@ -7,6 +8,7 @@
v-model="formData.selfName"
placeholder="请输入投保人姓名"
label="姓名"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入姓名' }]"
@click.native="inputClick"
/>
......@@ -15,6 +17,7 @@
v-model="formData.selfIdNo"
placeholder="信息保密,仅用于投保"
label="身份证号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入身份证号' }]"
@click.native="inputClick"
/>
......@@ -23,13 +26,14 @@
v-model="formData.selfPhone"
placeholder="请输入您的手机号码"
label="手机号码"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入手机号码' }]"
@click.native="inputClick"
/>
<cr-field
name="selfCode"
v-model="formData.selfCode"
v-if="xyqbAuthState !== 4 || !mongoToken"
v-if="(!!xyqbAuthState && xyqbAuthState !== 4) || !mongoToken"
placeholder="请输入短信验证码"
label="验证码"
:rules="[{ required: true, message: '请输入验证码' }]"
......@@ -50,24 +54,30 @@
<cr-cell-group class="insure-form">
<cr-field
name="relativeName"
v-if="formData.relation !== '0'"
v-if="formData.relation !== '1'"
v-model="formData.name"
placeholder="请输入被保人姓名"
:readonly="infoReadonly"
label="姓名"
:rules="[{ required: true, message: '请输入姓名' }]"
/>
<cr-field
name="relativeIdNo"
v-if="formData.relation !== '0'"
v-if="formData.relation !== '1'"
v-model="formData.idNo"
placeholder="信息保密,仅用于投保"
:readonly="infoReadonly"
label="身份证号"
:rules="[{ required: true, message: '请输入身份证号' }]"
/>
<cr-cell class="insure-form-item_nobg" v-if="radioOptions.medicalOptions">
<template slot="title">
<span>有无医保</span>
<cr-icon type="question-o" color="#ccc" />
<svg-icon
icon-class="doubt"
@click.native="question = true"
class-name="Ffr-title-svg"
/>
</template>
<cr-radio-btn
name="socialSecurity"
......@@ -84,22 +94,40 @@
</cr-cell>
</cr-cell-group>
</card>
<Modal
class="insured-modal"
v-model="question"
:closeable="false"
@confirm="question = false"
cancel-btn=""
content="常见的社保包括农村合作医疗(新农合)、城镇居民社保、城镇职工医保、少儿医保等政府主导的基本医疗保障项目,满足最基本的医疗保障要求。"
title="我们常说的社保都包括哪些?"
confirm-btn="我知道了"
/>
</div>
</template>
<script>
import Card from "@/components/Card";
import Modal from "@/components/Modal";
import { mapState, mapActions } from "vuex";
import { getFamilyList, getCaptchaSms } from "@/api/user";
import { isPhone } from "@/service/validation";
import localStorage from "@/service/localStorage";
import CrRadioBtn from "@/components/CrRadioBtn";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
const AUTO_SAVE_KEY = "DetailFormData";
const AUTO_SAVE_TARGET = "formData";
const DATA_CHANGE_EVENT = "input";
export default {
name: "InsurePersonForm",
components: {
CrRadioBtn,
Card
Card,
Modal
},
mixins: [autoSaveForm],
props: {
value: {
type: Object,
......@@ -122,7 +150,10 @@ export default {
count: "",
timer: null,
mongoToken: localStorage.get("mongoToken"),
xyqbAuthState: localStorage.get("xyqbAuthState")
xyqbAuthState: localStorage.get("xyqbAuthState"),
selfInfoReadonly: false,
infoReadonly: false,
question: false
};
},
watch: {
......@@ -133,10 +164,19 @@ export default {
this.formData = val;
}
},
userInfo: {
immediate: true,
deep: true,
handler(val) {
this.formData.selfPhone =
val.phoneNoMask && val.phoneNoMask !== "点击登录" ? val.phoneNoMask : "";
}
},
formData: {
immediate: true,
deep: true,
handler(val) {
this.autoSaveHandler(AUTO_SAVE_TARGET, AUTO_SAVE_KEY);
this.$emit(DATA_CHANGE_EVENT, val);
this.$forceUpdate();
}
......@@ -144,12 +184,13 @@ export default {
showAuthXyqb: {
immediate: true,
handler(val) {
if (val === 4) {
if (val === 4 && this.userInfo.phoneNoMask === "点击登录") {
const xyqbUserInfo = localStorage.get("xyqbUserInfo");
this.formData.selfName = xyqbUserInfo.nameMask;
this.formData.selfIdNo = xyqbUserInfo.idNoMask;
this.formData.selfPhone = xyqbUserInfo.phoneNoMask;
this.xyqbAuthState = localStorage.get("xyqbAuthState");
this.selfInfoReadonly = true;
this.$forceUpdate();
}
}
......@@ -160,13 +201,19 @@ export default {
},
computed: {
...mapState(["showAuthXyqb"]),
...mapState("user", ["userInfo"])
...mapState("user", ["userInfo"]),
socialSecurityReadonly() {
const { relation } = this.formData;
const { selfInfoReadonly, infoReadonly } = this;
return (relation === "1" && selfInfoReadonly) || (relation !== "1" && infoReadonly);
}
},
mounted() {
this.getFamilyList();
},
methods: {
...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setUserInfo"]),
inputClick() {
if (this.showAuthXyqb === 1) {
this.setAuthXyqb(2);
......@@ -181,18 +228,17 @@ export default {
userInfoSecId: selfSecId,
socialSecurity
} = item;
if (relation === 0) {
const { phoneNoMask: selfPhone } = this.userInfo;
if (relation === 1) {
this.formData = {
...this.formData,
...{
selfName,
selfIdNo,
selfSecId,
selfPhone: selfPhone !== "phoneNoMask" ? selfPhone : "",
selfSocialSecurity: socialSecurity ? "1" : "0"
}
};
this.selfInfoReadonly = true;
}
});
const userArray = this.familyList.filter(item => item.relation === +relation);
......@@ -200,6 +246,9 @@ export default {
if (userArray.length) {
let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0];
[name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss];
this.infoReadonly = true;
} else {
this.infoReadonly = false;
}
this.formData = {
...this.formData,
......@@ -207,12 +256,25 @@ export default {
};
},
async getFamilyList() {
this.mongoToken = localStorage.get("mongoToken");
if (!this.mongoToken) return;
this.setUserInfo();
const res = await getFamilyList();
if (res) {
this.familyList = res;
(this.showAuthXyqb || this.mongoToken) && 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.relation;
if (queryId) {
relation = this.familyList.filter(item => item.userInfoSecId === queryId)[0].relation;
}
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
}
}
},
// TODO 倒计时未回显
async getCode() {
const TIME_COUNT = 60;
const { selfPhone } = this.formData;
......@@ -234,6 +296,8 @@ export default {
this.timer = null;
}
}, 1000);
} else {
this.$notify({ type: "warning", message: "获取短信验证码失败,请稍后重试" });
}
}
}
......@@ -297,4 +361,15 @@ export default {
.insured {
margin-bottom: 20px;
}
.insured-modal {
@{deep} .panel-body {
font-size: 16px;
font-weight: 400;
color: #666666;
line-height: 28px;
}
}
.Ffr-title-svg {
margin-left: 5px;
}
</style>
......@@ -10,6 +10,7 @@
<script>
const SCROLL_ACHOR_CHANGE_EVENT = "input";
const SCROLL_SHOW_EVENT = "show";
export default {
name: "NavTab",
props: {
......@@ -71,6 +72,7 @@ export default {
}
this.active = navIndex;
this.showNavBar = scrollTop > 300;
this.$emit(SCROLL_SHOW_EVENT, this.showNavBar);
},
// 跳转到指定索引的元素
scrollTo(index) {
......
......@@ -16,8 +16,10 @@ export default {
},
methods: {
...mapActions(["setIsShowLogin"]),
...mapActions("user", ["setUserInfo"]),
showLoginPopup() {
if (localStorage.get("mongoToken")) {
this.setUserInfo();
this.nextStep();
} else {
this.setIsShowLogin(true);
......@@ -37,10 +39,11 @@ export default {
};
const res = await loginByPhone(formData);
if (res) {
this.$notify("登录成功");
// localStorage.setItem("mongoToken", res.token);
this.setUserInfo();
this.$notify({ type: "success", message: "登录成功" });
localStorage.set("mongoToken", res.token);
// TODO 开发目前使用这个token
localStorage.set("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
// localStorage.set("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
}
return new Promise(resolve => {
resolve();
......
import { payByWay } from "@/service/pay";
import { isXyqb, isWeixinBrower } from "@/service/validation";
import { placeOrder } from "@/api/product";
import localStorage from "@/service/localStorage";
import { mapActions } from "vuex";
export default {
data() {
return {
subFromData: {}, // 组装好的数据
orderInfo: {},
tradeType: ""
openId: localStorage.get("openId"),
tradeType: "",
payTimer: null
// customTradeType: ""
};
},
......@@ -15,6 +19,7 @@ export default {
this.tradeType = this.customTradeType ?? (isXyqb ? "MWEB" : isWeixinBrower ? "JSAPI" : "MWEB");
},
methods: {
...mapActions(["setIsLoading"]),
async generateOrder() {
const res = await placeOrder.create({
...this.subFromData
......@@ -25,13 +30,21 @@ export default {
}
},
async goPay() {
const { tradeType, orderInfo } = this;
const { payOrderNo, payType, orderNo } = orderInfo;
const { tradeType, orderInfo, openId } = this;
const { payOrderNo, payType } = orderInfo;
if (!payOrderNo) {
this.$toast("请先生成订单");
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) {
let payInfo = {
mock: true,
......@@ -46,9 +59,23 @@ export default {
payInfo = res.payInfo;
}
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 @@
<script>
import goodsList from "@/api/goodsList.mock";
import { list } from "@/api/product";
import { list, getLink } from "@/api/product";
import AiTestTip from "./modules/AiTestTip";
import GoodList from "@/components/GoodList/index";
......@@ -59,12 +59,13 @@ export default {
return {
active: 0,
showLayer: false,
goodsList: []
goodsList: [],
goodsLink: ""
};
},
computed: {
list() {
const { active } = this;
const { active, goodsLink } = this;
const _catList = JSON.parse(JSON.stringify(categoryList));
this.goodsList.forEach(item => {
switch (item.itype) {
......@@ -72,6 +73,9 @@ export default {
_catList[0].children.push(item);
break;
case "cii":
if (item.id === "BNZJX001") {
item.url = goodsLink;
}
(item.scope.includes(active) || active === 0) && _catList[1].children.push(item);
break;
case "ai":
......@@ -89,6 +93,7 @@ export default {
},
mounted() {
this.getList();
this.getGoodsLink();
},
methods: {
async getList() {
......@@ -106,6 +111,12 @@ export default {
});
this.goodsList = goodsList;
}
},
async getGoodsLink() {
const res = await getLink();
if (res) {
this.goodsLink = res.url;
}
}
}
};
......
......@@ -121,11 +121,10 @@ export default {
if (!this.isLogin) {
return "去投票";
}
return "";
}
},
created() {
},
created() {},
methods: {
gameStart() {
this.$nextTick(() => {
......
......@@ -251,6 +251,10 @@
font-size: 16px;
color: #999999;
line-height: 19px;
a {
font-size: 16px;
color: #999999;
}
}
p:last-child {
......
......@@ -87,7 +87,9 @@
</a>
</div>
<div class="home-phone">
<p>客服电话:{{ tel }}</p>
<p>
客服电话:<a :href="`tel:${tel}`">{{ tel }}</a>
</p>
<p>服务时间:{{ serviceHours }}</p>
</div>
<copyright :logo="true" />
......@@ -98,7 +100,7 @@
import GoodList from "@/components/GoodList/index";
import Tabbar from "@/components/Tabbar";
import Copyright from "@/components/Copyright";
import { list } from "@/api/product";
import { list, getLink } from "@/api/product";
import goodsList from "@/api/goodsList.mock";
import settings from "@/api/settings";
......@@ -151,6 +153,13 @@ export default {
});
});
this.goodsList = goodsList;
this.getGoodsLink();
}
},
async getGoodsLink() {
const res = await getLink();
if (res) {
this.goodsList[3].url = res.url;
}
}
}
......
......@@ -16,6 +16,7 @@
name="holderUserInfo_name"
label="姓名"
placeholder="请输入投保人姓名"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入投保人姓名' }]"
@click.native="inputClick"
/>
......@@ -24,6 +25,7 @@
name="holderUserInfo_idNo"
label="身份证号"
placeholder="请填写投保人身份证号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请填写投保人身份证号' }]"
@click.native="inputClick"
/>
......@@ -33,6 +35,7 @@
type="tel"
label="手机号"
placeholder="请填写投保人手机号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请填写投保人手机号' }]"
@click.native="inputClick"
/>
......@@ -79,11 +82,7 @@
:rules="[{ required: true, message: '请选择投保人职业' }]"
>
<template #input>
<popup-picker
:picker-data="['老师', '工人']"
v-model="formData.holderUserInfo.occupation"
placeholder="请选择投保人职业"
/>
<popup-cascade />
</template>
</cr-field>
<cr-field
......@@ -160,12 +159,13 @@
>
<div class="form-unit" slot="button">公斤</div>
</cr-field>
<template v-if="formData.insuredUserInfo.relation !== '0'">
<template v-if="formData.insuredUserInfo.relation !== '1'">
<cr-field
v-model="formData.insuredUserInfo.name"
name="insuredUserInfo_name"
label="姓名"
placeholder="请输入投保人姓名"
:readonly="infoReadonly"
:rules="[{ required: true, message: '请输入投保人姓名' }]"
/>
<cr-field
......@@ -173,6 +173,7 @@
name="insuredUserInfo_idNo"
label="身份证号"
placeholder="请填写投保人身份证号"
:readonly="infoReadonly"
:rules="[{ required: true, message: '请填写投保人身份证号' }]"
/>
<cr-field
......@@ -343,9 +344,11 @@ import PopupPicker from "@/components/PopupPicker";
import PopupAreaPicker from "@/components/PopupAreaPicker";
import PopupDatePicker from "@/components/PopupDatePicker";
import PopupWithIframe from "@/components/PopupWithIframe";
import PopupCascade from "@/components/PopupCascade";
import Stepper from "@/components/Stepper";
import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog";
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import localStorage from "@/service/localStorage";
import { mapState, mapActions } from "vuex";
......@@ -353,6 +356,9 @@ import Detail from "@/api/detail.huagui.shouxian";
import { list, trail } from "@/api/product";
import { getFamilyList } from "@/api/user";
import { parseTime } from "@/service/utils";
const AUTO_SAVE_KEY = "PolicyFormData";
const AUTO_SAVE_TARGET = "formData";
const {
headerInfo,
popupArray,
......@@ -366,7 +372,7 @@ const {
} = Detail;
export default {
name: "AddPolicy",
mixins: [detailPayMixin],
mixins: [detailPayMixin, autoSaveForm],
components: {
GoodAction,
CrRadioBtn,
......@@ -375,6 +381,7 @@ export default {
PopupAreaPicker,
PopupDatePicker,
PopupWithIframe,
PopupCascade,
Stepper
},
data() {
......@@ -387,10 +394,11 @@ export default {
currentPupopIndex: null,
goodActionInfo: {},
goodBuyModalInfo: [],
mongoToken: localStorage.get("mongoToken"),
policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
formData: {
insuredUserInfo: {
relation: "0"
relation: "1"
},
holderUserInfo: {},
productItem: {
......@@ -406,13 +414,23 @@ export default {
termOptions,
paywayOptions,
benefitOptions,
insuredAmountOptions
insuredAmountOptions,
selfInfoReadonly: false,
infoReadonly: false
};
},
watch: {
popupShow(val) {
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: {
deep: true,
handler(val) {
......@@ -426,6 +444,7 @@ export default {
formDataCpu: {
deep: true,
handler() {
this.autoSaveHandler(AUTO_SAVE_TARGET, AUTO_SAVE_KEY);
if (this.calTimer) {
clearTimeout(this.calTimer);
}
......@@ -442,6 +461,7 @@ export default {
this.formData.holderUserInfo.name = xyqbUserInfo.nameMask;
this.formData.holderUserInfo.idNo = xyqbUserInfo.idNoMask;
this.formData.holderUserInfo.phoneNo = xyqbUserInfo.phoneNoMask;
this.selfInfoReadonly = true;
this.$forceUpdate();
}
}
......@@ -449,12 +469,18 @@ export default {
},
computed: {
...mapState(["showAuthXyqb"]),
...mapState("user", ["userInfo"]),
pupopData() {
const { popupArray, currentPupopIndex } = this;
return popupArray[currentPupopIndex] || {};
},
formDataCpu() {
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() {
......@@ -464,6 +490,7 @@ export default {
},
methods: {
...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setUserInfo"]),
inputClick() {
if (this.showAuthXyqb === 1) {
this.setAuthXyqb(2);
......@@ -485,23 +512,30 @@ export default {
relationChange(relation = this.formData.insuredUserInfo.relation) {
this.familyList.forEach(item => {
const { relation, nameMask: name, idNoMask: idNo, userInfoSecId, socialSecurity } = item;
if (+relation === 0) {
if (+relation === 1) {
this.formData.holderUserInfo = {
...this.formData.holderUserInfo,
...{ 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"];
if (userArray.length) {
let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0];
[name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss];
this.infoReadonly = true;
} else {
this.infoReadonly = false;
}
this.formData.insuredUserInfo = {
...this.formData.insuredUserInfo,
...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity ? "1" : "0" }
...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity }
};
this.$forceUpdate();
},
openIframePupop(index) {
this.currentPupopIndex = index;
......@@ -535,10 +569,21 @@ export default {
}
},
async getFamilyList() {
if (!this.mongoToken) return;
this.setUserInfo();
const res = await getFamilyList();
if (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() {
......@@ -551,7 +596,7 @@ export default {
} = this.formData.productItem;
let idNo = "";
const { socialSecurity } = this.formData.insuredUserInfo;
if (this.formData.insuredUserInfo.relation !== "0") {
if (this.formData.insuredUserInfo.relation !== "1") {
idNo = this.formData.insuredUserInfo.idNo;
} else {
idNo = this.formData.holderUserInfo.idNo;
......
......@@ -137,8 +137,8 @@ export default {
orderNo: item?.orderNo
};
this.goPay();
} else if (text === "联系客服") {
}
// eslint-disable-next-line
} else if (text === "联系客服") {}
},
goDetail(orderNo) {
const policy = this.list.find(v => v.orderNo === orderNo);
......
......@@ -886,10 +886,10 @@
resolved "http://npmprivate.quantgroups.com/@nodelib%2ffs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
"@qg/cherry-ui@^1.1.2":
version "1.1.2"
resolved "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-1.1.2.tgz#9019e409b3cf66ebf634b1090c5a8321cb78a05d"
integrity sha512-P2bFNNcoFNF1xgBO5p0XSejulyriIAtsYCK0KICUXq5nRhP+zCOCPZPVghbVtZvmEDCFibNgGZFzqFn0rkjEfg==
"@qg/cherry-ui@^1.2.1":
version "1.2.1"
resolved "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-1.2.1.tgz#5f59ebf0ed677c6d3f41dd04e3b9f6a43811936b"
integrity sha512-icj5WLUCJswPLF02YtCdppdfSDwQQrFoLxhRFCie2SFffIKVZSMEtSVVuEh2nZv2khPd/cvEISGpmzwDcBS7tw==
"@qg/qg-scroll@^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