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

fix: 授权弹框;文案修改;

parent c7a61d8e
...@@ -12,18 +12,27 @@ ...@@ -12,18 +12,27 @@
<login-modal /> <login-modal />
<auth-from-xyqb v-if="showAuthXyqb !== -1" /> <auth-from-xyqb v-if="showAuthXyqb !== -1" />
<net-error /> <net-error />
<public-popup
:value="isShowPublicPopup"
:title="publicPupopData.title"
:content="publicPupopData.content"
:url="publicPupopData.url"
@input="onClose"
/>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import LoginModal from "@/components/LoginModal"; import LoginModal from "@/components/LoginModal";
import AuthFromXyqb from "@/components/AuthFromXyqb"; import AuthFromXyqb from "@/components/AuthFromXyqb";
import PopupWithIframe from "@/components/PopupWithIframe";
import NetError from "@/components/NetError"; import NetError from "@/components/NetError";
export default { export default {
components: { components: {
LoginModal, LoginModal,
AuthFromXyqb, AuthFromXyqb,
NetError NetError,
PublicPopup: PopupWithIframe
}, },
data() { data() {
return { return {
...@@ -31,7 +40,7 @@ export default { ...@@ -31,7 +40,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapState(["isLoading", "showAuthXyqb", "isPayWait"]) ...mapState(["isLoading", "showAuthXyqb", "isPayWait", "isShowPublicPopup", "publicPupopData"])
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
...@@ -48,7 +57,12 @@ export default { ...@@ -48,7 +57,12 @@ export default {
} }
}, },
methods: { methods: {
...mapActions(["setIsLoading"]) ...mapActions(["setIsLoading", "setPublicPopup"]),
onClose(e) {
if (!e) {
this.setPublicPopup({});
}
}
} }
}; };
</script> </script>
......
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
autoCellInfo: [ autoCellInfo: [
{ title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" }, { title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" },
{ title: "【放心】开通自动续保后,可随时取消", value: "" }, { title: "【放心】开通自动续保后,可随时取消", value: "" },
{ title: "【安心】自动续保按费率可自动扣费", value: "" }, { title: "【安心】续保保费按续保时对应的保费自动扣款", value: "" },
{ {
title: { title: {
needSlot: true, needSlot: true,
......
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
autoCellInfo: [ autoCellInfo: [
{ title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" }, { title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" },
{ title: "【放心】开通自动续保后,可随时取消", value: "" }, { title: "【放心】开通自动续保后,可随时取消", value: "" },
{ title: "【安心】自动续保按费率可自动扣费", value: "" }, { title: "【安心】续保保费按续保时对应的保费自动扣款", value: "" },
{ {
title: { title: {
needSlot: true, needSlot: true,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Description: 泰康600万医疗保障 * @Description: 泰康600万医疗保障
* @Date: 2020-07-27 15:46:37 * @Date: 2020-07-27 15:46:37
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2020-08-27 15:53:03 * @LastEditTime: 2020-08-27 16:44:36
*/ */
import goodsBg from "@/assets/images/goods/detail/yiliaoxian/bg.png"; import goodsBg from "@/assets/images/goods/detail/yiliaoxian/bg.png";
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
autoCellInfo: [ autoCellInfo: [
{ title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" }, { title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" },
{ title: "【放心】开通自动续保后,可随时取消", value: "" }, { title: "【放心】开通自动续保后,可随时取消", value: "" },
{ title: "【安心】自动续保按费率可自动扣费", value: "" }, { title: "【安心】续保保费按续保时对应的保费自动扣款", value: "" },
{ {
title: { title: {
needSlot: true, needSlot: true,
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
popupArray: [ popupArray: [
{ {
title: "保险条款", title: "保险条款",
url: "https://mangguo-mg.liangkebang.net/user" url: "http://mangguo-contract.qthbx.com/tai-kang-bai-mo-yi-liao-bao-xian-tiao-kuan-v1/"
}, },
{ {
title: "健康告知", title: "健康告知",
......
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
autoCellInfo: [ autoCellInfo: [
{ title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" }, { title: "【省心】自动续保,不用担心续保不及时导致保障中断", value: "" },
{ title: "【放心】开通自动续保后,可随时取消", value: "" }, { title: "【放心】开通自动续保后,可随时取消", value: "" },
{ title: "【安心】自动续保按费率可自动扣费", value: "" }, { title: "【安心】续保保费按续保时对应的保费自动扣款", value: "" },
{ {
title: { title: {
needSlot: true, needSlot: true,
......
...@@ -45,25 +45,31 @@ export default { ...@@ -45,25 +45,31 @@ export default {
showAuthXyqb: { showAuthXyqb: {
immediate: true, immediate: true,
handler(val) { handler(val) {
this.showAuth = val === 2; this.showAuth = !!this.userInfo.length && val === 2;
} }
} }
}, },
created() { created() {
this.userInfo = [ Object.keys(xyqbUserInfo).forEach(key => {
{ if (key === "phoneNoMask") {
label: "手机号码", this.userInfo[0] = {
value: xyqbUserInfo.phoneNoMask label: "手机号码",
}, value: xyqbUserInfo[key]
{ };
label: "姓名",
value: xyqbUserInfo.nameMask
},
{
label: "身份证号码",
value: xyqbUserInfo.idNoMask
} }
]; if (key === "nameMask") {
this.userInfo[1] = {
label: "姓名",
value: xyqbUserInfo[key]
};
}
if (key === "idNoMask") {
this.userInfo[2] = {
label: "身份证号码",
value: xyqbUserInfo[key]
};
}
});
}, },
computed: { computed: {
...mapState(["showAuthXyqb"]) ...mapState(["showAuthXyqb"])
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
</cr-field> </cr-field>
<div class="protocol"> <div class="protocol">
确定登录即表示同意 确定登录即表示同意
<a :href="userAgreement">《用户协议》</a> <a href="javascript:;" @click="showProtocol(0)">《用户协议》</a>
<a :href="privacyPolicy">《隐私政策》</a> <a href="javascript:;" @click="showProtocol(1)">《隐私政策》</a>
</div> </div>
</cr-form> </cr-form>
</modal> </modal>
...@@ -59,7 +59,16 @@ export default { ...@@ -59,7 +59,16 @@ export default {
}, },
data() { data() {
return { return {
...protocol, protocol: [
{
title: "用户协议",
url: protocol.userAgreement
},
{
title: "隐私政策",
url: protocol.privacyPolicy
}
],
show: true, show: true,
showCount: false, showCount: false,
count: "", count: "",
...@@ -81,7 +90,10 @@ export default { ...@@ -81,7 +90,10 @@ export default {
...mapState(["isShowLogin"]) ...mapState(["isShowLogin"])
}, },
methods: { methods: {
...mapActions(["setIsShowLogin"]), ...mapActions(["setIsShowLogin", "setPublicPopup"]),
showProtocol(idx) {
this.setPublicPopup(this.protocol[idx]);
},
onFormFailed(errorInfo) { onFormFailed(errorInfo) {
const { errors } = errorInfo; const { errors } = errorInfo;
this.$notify({ type: "warning", message: errors[0].message }); this.$notify({ type: "warning", message: errors[0].message });
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
.mongo-tabbar { .mongo-tabbar {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
z-index: 100; z-index: 99;
box-sizing: border-box; box-sizing: border-box;
min-height: 49px; min-height: 49px;
padding: 5px 0 2px 0; padding: 5px 0 2px 0;
......
...@@ -50,7 +50,7 @@ async function getAuthInfo(xyqbToken) { ...@@ -50,7 +50,7 @@ async function getAuthInfo(xyqbToken) {
if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return; if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return;
const res = await authByxyqb({ xyqbToken }); const res = await authByxyqb({ xyqbToken });
if (res) { if (res) {
localStorage.set("mongoToken", res.token); // localStorage.set("mongoToken", res.token);
localStorage.set("xyqbUserInfo", res); localStorage.set("xyqbUserInfo", res);
localStorage.set("xyqbToken", xyqbToken); localStorage.set("xyqbToken", xyqbToken);
} }
......
...@@ -12,6 +12,12 @@ export default new Vuex.Store({ ...@@ -12,6 +12,12 @@ export default new Vuex.Store({
isLoading: false, isLoading: false,
isShowLogin: false, isShowLogin: false,
isPayWait: false, isPayWait: false,
isShowPublicPopup: false,
publicPupopData: {
title: "",
content: "",
url: ""
},
showAuthXyqb: isXyqb ? localStorage.get("xyqbAuthState") || 1 : -1 // 1 已获取信息未授权,2 打开授权弹框, 3 拒绝授权,4 允许授权, -1 非信用钱包环境 showAuthXyqb: isXyqb ? localStorage.get("xyqbAuthState") || 1 : -1 // 1 已获取信息未授权,2 打开授权弹框, 3 拒绝授权,4 允许授权, -1 非信用钱包环境
}, },
mutations: { mutations: {
...@@ -30,6 +36,14 @@ export default new Vuex.Store({ ...@@ -30,6 +36,14 @@ export default new Vuex.Store({
setAuthXyqb(state, value) { setAuthXyqb(state, value) {
state.showAuthXyqb = value; state.showAuthXyqb = value;
localStorage.set("xyqbAuthState", value); localStorage.set("xyqbAuthState", value);
},
setPublicPopup(state, value) {
if (value.content || value.url) {
state.publicPupopData = value;
state.isShowPublicPopup = true;
} else {
state.isShowPublicPopup = false;
}
} }
}, },
actions: { actions: {
...@@ -47,6 +61,9 @@ export default new Vuex.Store({ ...@@ -47,6 +61,9 @@ export default new Vuex.Store({
}, },
setAuthXyqb({ commit }, args) { setAuthXyqb({ commit }, args) {
commit("setAuthXyqb", args); commit("setAuthXyqb", args);
},
setPublicPopup({ commit }, args) {
commit("setPublicPopup", args);
} }
}, },
modules: { modules: {
......
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
formData: { formData: {
name: "", name: "",
idNo: "", idNo: "",
relation: "", relation: "1",
payType: "1", payType: "1",
amountInsured: "1000000", amountInsured: "1000000",
autoRenewPolicy: false, autoRenewPolicy: false,
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
formData: { formData: {
name: "", name: "",
idNo: "", idNo: "",
relation: "", relation: "1",
payType: "1", payType: "1",
amountInsured: "300000", amountInsured: "300000",
autoRenewPolicy: false, autoRenewPolicy: false,
...@@ -229,7 +229,9 @@ export default { ...@@ -229,7 +229,9 @@ export default {
} }
sessionStorage.setItem("policyFormData", JSON.stringify(subFormDataCache)); sessionStorage.setItem("policyFormData", JSON.stringify(subFormDataCache));
} }
this.isCalPrice = this.checkAgeInRange();
if ( if (
!this.isCalPrice ||
!relation || !relation ||
!idNoWho || !idNoWho ||
(idNoWho.indexOf("************") === -1 && (idNoWho.indexOf("************") === -1 &&
...@@ -372,9 +374,12 @@ export default { ...@@ -372,9 +374,12 @@ export default {
selfIdNo, selfIdNo,
payType, payType,
amountInsured, amountInsured,
userInfoSecId userInfoSecId,
selfSecId
} = this.formData; } = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo; let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let idWho = !relation || relation === "1" ? selfSecId : userInfoSecId;
idWho = idNoWho.indexOf("**") > -1 ? idWho || undefined : undefined;
this.isCalPrice = this.checkAgeInRange(); this.isCalPrice = this.checkAgeInRange();
if (!idNoWho || !payType || !this.isCalPrice) return; if (!idNoWho || !payType || !this.isCalPrice) return;
const _param = { const _param = {
...@@ -383,7 +388,7 @@ export default { ...@@ -383,7 +388,7 @@ export default {
insuredUserInfo: { insuredUserInfo: {
idNo: idNoWho, idNo: idNoWho,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined, socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined userInfoSecId: idWho
}, },
productItem: { productItem: {
payType: payType || undefined, payType: payType || undefined,
......
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
name: "", name: "",
idNo: "", idNo: "",
socialSecurity: "", socialSecurity: "",
relation: "", relation: "1",
payType: "1", payType: "1",
planValue: "3", planValue: "3",
autoRenewPolicy: false, autoRenewPolicy: false,
...@@ -175,7 +175,9 @@ export default { ...@@ -175,7 +175,9 @@ export default {
const { idNo: oldidNo, selfIdNo: oldselfIdNo } = oldVal; const { idNo: oldidNo, selfIdNo: oldselfIdNo } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo; let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo; let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
this.isCalPrice = this.checkAgeInRange();
if ( if (
!this.isCalPrice ||
!relation || !relation ||
!idNoWho || !idNoWho ||
(idNoWho.indexOf("************") === -1 && !isIdNo(idNoWho) && idNoWho === oldidNoWho) (idNoWho.indexOf("************") === -1 && !isIdNo(idNoWho) && idNoWho === oldidNoWho)
...@@ -354,8 +356,18 @@ export default { ...@@ -354,8 +356,18 @@ export default {
}, },
async calFee() { async calFee() {
let { price, subPrice } = this.headerInfo; let { price, subPrice } = this.headerInfo;
const { idNo, socialSecurity, payType, userInfoSecId, relation, selfIdNo } = this.formData; const {
idNo,
socialSecurity,
payType,
userInfoSecId,
selfSecId,
relation,
selfIdNo
} = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo; let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let idWho = !relation || relation === "1" ? selfSecId : userInfoSecId;
idWho = idNoWho.indexOf("**") > -1 ? idWho || undefined : undefined;
this.isCalPrice = this.checkAgeInRange(); this.isCalPrice = this.checkAgeInRange();
if (!idNoWho || !payType || !socialSecurity || !this.isCalPrice) return; if (!idNoWho || !payType || !socialSecurity || !this.isCalPrice) return;
const _param = { const _param = {
...@@ -364,7 +376,7 @@ export default { ...@@ -364,7 +376,7 @@ export default {
insuredUserInfo: { insuredUserInfo: {
idNo: idNoWho, idNo: idNoWho,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined, socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined userInfoSecId: idWho
}, },
productItem: { productItem: {
payType: payType || undefined, payType: payType || undefined,
......
...@@ -428,6 +428,8 @@ export default { ...@@ -428,6 +428,8 @@ export default {
item => item.relation === +this.formData.relation item => item.relation === +this.formData.relation
); );
this.relationList = userArray.length > 1 ? userArray : []; this.relationList = userArray.length > 1 ? userArray : [];
} else {
this.formData.relation = "1";
} }
if (!this.formData.selfName) { if (!this.formData.selfName) {
const selfInfo = this.familyList.find(item => item.relation === 1); const selfInfo = this.familyList.find(item => item.relation === 1);
...@@ -453,7 +455,7 @@ export default { ...@@ -453,7 +455,7 @@ export default {
this.selfInfoReadonly = true; this.selfInfoReadonly = true;
} }
} else { } else {
let relation = this.formData.relation; let relation = this.formData.relation || "1";
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation); (this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
} }
} }
......
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