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

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

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