Commit 36cfb01a authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

fix: code问题还原

See merge request !83
parents 9d363074 8eb5fdcf
...@@ -57,6 +57,7 @@ async function getAuthInfo(xyqbToken) { ...@@ -57,6 +57,7 @@ async function getAuthInfo(xyqbToken) {
} }
async function getWxOpenId(code) { async function getWxOpenId(code) {
if (localStorage.get("openId")) return;
const res = await getwxOpenId({ code, appId: cfg.wxAppId }); const res = await getwxOpenId({ code, appId: cfg.wxAppId });
if (localStorage.get("openId") && res.openId !== localStorage.get("openId")) { if (localStorage.get("openId") && res.openId !== localStorage.get("openId")) {
console.log("切换账号"); console.log("切换账号");
......
...@@ -223,13 +223,15 @@ export default { ...@@ -223,13 +223,15 @@ export default {
}, },
onSubmit() { onSubmit() {
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
} else { } else {
const { selfPhone, selfCode } = this.formData; const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => { this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
}); });
} }
// sessionStorage.setItem( // sessionStorage.setItem(
...@@ -255,6 +257,13 @@ export default { ...@@ -255,6 +257,13 @@ export default {
} }
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
getIsRead() {
if (this.formData.read) {
this.nextStep();
} else {
this.goInsureState = true;
}
},
nextStep() { nextStep() {
this.generateFormData(); this.generateFormData();
this.goInsureState = false; this.goInsureState = false;
......
...@@ -282,13 +282,15 @@ export default { ...@@ -282,13 +282,15 @@ export default {
}, },
onSubmit() { onSubmit() {
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
} else { } else {
const { selfPhone, selfCode } = this.formData; const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => { this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
}); });
} }
}, },
...@@ -310,6 +312,13 @@ export default { ...@@ -310,6 +312,13 @@ export default {
} }
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
}, },
getIsRead() {
if (this.formData.read) {
this.nextStep();
} else {
this.goInsureState = true;
}
},
nextStep() { nextStep() {
this.$router.push({ path: "/goods/inform" }); this.$router.push({ path: "/goods/inform" });
}, },
......
...@@ -219,18 +219,27 @@ export default { ...@@ -219,18 +219,27 @@ export default {
onSubmit() { onSubmit() {
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
socialSecurityCache = this.formData.socialSecurity; socialSecurityCache = this.formData.socialSecurity;
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
} else { } else {
socialSecurityCache = this.formData.socialSecurity; socialSecurityCache = this.formData.socialSecurity;
const { selfPhone, selfCode } = this.formData; const { selfPhone, selfCode } = this.formData;
this.login(selfPhone, selfCode).then(() => { this.login(selfPhone, selfCode).then(() => {
this.goInsureState = true; this.$refs.insureForm.getFamilyList_I().then(() => {
this.$refs.insureForm.getFamilyList(); this.getIsRead();
});
}); });
} }
// sessionStorage.setItem("policyFormData", JSON.stringify(this.formData)); // sessionStorage.setItem("policyFormData", JSON.stringify(this.formData));
}, },
getIsRead() {
if (this.formData.read) {
this.nextStep();
} else {
this.goInsureState = true;
}
},
onFailed(errorInfo) { onFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
const noMsgArr = [ const noMsgArr = [
......
...@@ -458,6 +458,12 @@ export default { ...@@ -458,6 +458,12 @@ export default {
} }
} }
}, },
getFamilyList_I() {
return new Promise(resolve => {
this.getFamilyList();
resolve();
});
},
// TODO 倒计时未回显 // TODO 倒计时未回显
async getCode() { async getCode() {
const TIME_COUNT = 60; const TIME_COUNT = 60;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<slot></slot> <slot></slot>
<template v-slot:footer> <template v-slot:footer>
<div class="insure-form-pact" slot="footer"> <div class="insure-form-pact" slot="footer">
<cr-field name="pact" :rules="[{ required: true, message: '请阅读协议并确认' }]"> <cr-field name="pact">
<template #input> <template #input>
<cr-checkbox shape="round" icon-size="13px" v-model="pact" checked-color="#FFC842"> <cr-checkbox shape="round" icon-size="13px" v-model="pact" checked-color="#FFC842">
投保前请阅读 投保前请阅读
......
...@@ -7301,6 +7301,11 @@ rxjs@^6.5.5, rxjs@^6.6.0: ...@@ -7301,6 +7301,11 @@ rxjs@^6.5.5, rxjs@^6.6.0:
dependencies: dependencies:
tslib "^1.9.0" tslib "^1.9.0"
sa-sdk-javascript@^1.15.16:
version "1.15.16"
resolved "http://npmprivate.quantgroups.com/sa-sdk-javascript/-/sa-sdk-javascript-1.15.16.tgz#212313eb0cc8bdbf73f0438c0b9e4314121a6117"
integrity sha512-UIFJBYk8EEcMAg6kSeUdjYAnl3IEXA8DDk/7xqS1aU4bZV3+iUXo2hT1rzGPsSWanVvcDZ/uSGUNZqojsfZaGA==
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2" version "5.1.2"
resolved "http://npmprivate.quantgroups.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" resolved "http://npmprivate.quantgroups.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
......
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