Commit 14f99061 authored by 郭志伟's avatar 郭志伟

feat: 下单追加channel

parent b54b4230
......@@ -100,7 +100,8 @@ export default {
this.$notify({ type: "warning", message: errors[0].message });
},
async login() {
this.formData.loginChannel = isWeixinBrower ? 1 : 2;
const xyqbToken = localStorage.get("xyqbToken");
this.formData.loginChannel = isWeixinBrower && xyqbToken ? 3 : isWeixinBrower ? 1 : 2;
this.formData.openId = localStorage.get("openId") || null;
const res = await loginByPhone(this.formData);
if (res) {
......
......@@ -37,6 +37,7 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
const urlParams = parseSearch(window.location.href);
setTitle(to.meta.title, to.path, to.query);
setChannelId(urlParams);
if (isXyqb) getAuthInfo(urlParams.vccToken || urlParams.token);
if (isWeixinBrower) {
getWxOpenId(urlParams.code);
......@@ -99,4 +100,10 @@ function setTitle(title, path, query) {
}
}
function setChannelId(params) {
if (params.channelId) {
localStorage.set("channelId", params.channelId);
}
}
export default router;
......@@ -292,6 +292,7 @@ export default {
this.generateOrder("ai");
},
generateFormData() {
const channel = localStorage.get("channelId");
const {
userInfoSecId,
name,
......@@ -321,6 +322,7 @@ export default {
productItem: {
amountInsured
},
channel: channel ? channel : undefined,
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
......
......@@ -301,6 +301,7 @@ export default {
},
generateFormData() {
const subFormData = JSON.parse(JSON.stringify(this.formData));
const channel = localStorage.get("channelId");
const {
userInfoSecId,
name,
......@@ -328,6 +329,7 @@ export default {
payType,
amountInsured
},
channel: channel ? channel : undefined,
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
......
......@@ -287,6 +287,7 @@ export default {
if (!this.formData.socialSecurity) {
this.formData.socialSecurity = socialSecurityCache;
}
const channel = localStorage.get("channelId");
const subFormData = JSON.parse(JSON.stringify(this.formData));
const {
userInfoSecId,
......@@ -313,6 +314,7 @@ export default {
productItem: {
payType
},
channel: channel ? channel : undefined,
autoRenewPolicy: autoRenewPolicy
};
if (relation === "1") {
......
......@@ -815,10 +815,12 @@ export default {
},
nextStep() {
this.subFormData = JSON.parse(JSON.stringify(this.formData));
const channel = localStorage.get("channelId");
const { socialSecurity, longTerm, relation } = this.subFormData.insuredUserInfo;
this.subFormData.insuredUserInfo.socialSecurity = socialSecurity === "1" ? true : false;
this.subFormData.insuredUserInfo.longTerm = longTerm === "2" ? true : false;
this.subFormData.holderUserInfo.longTerm = longTerm === "2" ? true : false;
this.subFormData.channel = channel ? channel : undefined;
if (relation === "1") {
const selfInfo = this.familyList.find(item => item.relation === 1);
const { weight, height, socialSecurity } = this.subFormData.insuredUserInfo;
......
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