Commit e71cf276 authored by 郭志伟's avatar 郭志伟

Merge branch 'orderChannel' into 'master'

feat: 下单追加channel

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