54b51ce0 by joe

修复部分BUG

1 parent fab542fb
......@@ -165,7 +165,7 @@ module.exports = {
service: "Service Network",
qrcode: "Official Accounts",
qrcodeBot: "Official WeChat Account",
copyright: "版權所有 © 中國平安保險(集團)股份有限公司未經許可不得復制、轉載或摘編,違者必究!"
copyright: "Copyright © China Ping An Life Insurance (Hong Kong) Company Limited  All rights reserved."
},
login: {
title: "PingAn One Connect Member Service",
......@@ -196,7 +196,7 @@ module.exports = {
oe1: "Please get SMS verification code first",
oe2: "Please enter the picture verification code",
oe3: "Please enter the picture verification code",
oe4: "Invalidate SMS verification code, please re-enter",
oe4: "Your verify code is not correct. Please try again",
}
},
session: {
......@@ -391,7 +391,9 @@ module.exports = {
errorTips: {
e1: "Please fill in this item",
e2: "Please fill in the correct contact information",
e3: "Please fill in the correct policy number"
e3: "Please fill in the correct policy number",
e4: "請填寫正確的聯繫電話",
e5: "請填寫正確的電郵地址",
},
success: "Thank you for your comments"
},
......@@ -419,8 +421,11 @@ module.exports = {
submitBtn: 'Confirm',
errorTips: {
e1: "Please fill in this item",
e2: "Please fill in the correct contact information",
e3: "You have submitted the appointment information, please do not repeat the appointment"
e2: "Please fill in the correct contact mobile no.",
e3: "You have submitted the appointment information, please do not repeat the appointment",
e4: "Please fill in the valid date",
e4: "Please fill in the correct mobile no.",
e5: "Please fill in the correct email",
}
},
paymentType: {
......
......@@ -167,7 +167,7 @@ module.exports = {
service: "服務網絡",
qrcode: "社交媒體",
qrcodeBot: "官方公眾號",
copyright: "版權所有 © 中國平安保險(集團)股份有限公司未經許可不得復制、轉載或摘編,違者必究!"
copyright: "版權 © 中國平安人壽(香港)有限公司 版權所有"
},
login: {
title: "平安一賬通",
......@@ -198,7 +198,7 @@ module.exports = {
oe1: "請先獲取短信驗證碼",
oe2: "請輸入圖片驗證碼",
oe3: "請輸入短信驗證碼",
oe4: "短信驗證碼不正確",
oe4: "驗證碼錯誤,請重試",
},
},
register: {
......@@ -391,7 +391,9 @@ module.exports = {
errorTips: {
e1: "請填寫該項內容",
e2: "請填寫正確的聯繫方式",
e3 : "請填寫正確的保單號"
e3: "請填寫正確的保單號",
e4: "請填寫正確的聯繫電話",
e5: "請填寫正確的電郵地址",
},
success: "感謝您的寶貴意見"
},
......@@ -420,7 +422,8 @@ module.exports = {
errorTips: {
e1: "請填寫該項內容",
e2: "請填寫正確的聯繫方式",
e3: "您已經提交了預約信息,請不要重複預約"
e3: "您已經提交了預約信息,請不要重複預約",
e4: "請填寫有效的日期"
}
},
paymentType: {
......@@ -792,8 +795,8 @@ module.exports = {
goto: "跳轉",
per: "第",
page: "頁",
total : "共",
unit : "條"
total: "共",
unit: "條"
},
newsDetail: {
back: "回到列表頁",
......
......@@ -167,7 +167,7 @@ module.exports = {
service: "服务网络",
qrcode: "社交媒体",
qrcodeBot: "官方公众号",
copyright: "版权所有 © 中国平安保险(集团)股份有限公司未经许可不得复制、转载或摘编,违者必究!"
copyright: "版权 © 中国平安人寿(香港)有限公司  版权所有"
},
login: {
title: "平安一账通",
......@@ -198,7 +198,7 @@ module.exports = {
oe1: "请先获取短信验证码",
oe2: "请输入图片验证码",
oe3: "请输入短信验证码",
oe4: "短信验证码不正确",
oe4: "验证码错误,请重试",
}
},
session: {
......@@ -391,7 +391,9 @@ module.exports = {
errorTips: {
e1: "请填写该项内容",
e2: "请填写正确的联系方式",
e3: "请填写正确的保单号"
e3: "请填写正确的保单号",
e4: "请填写正确的联系电话",
e5: "请填写正确的电邮地址",
},
success: "感谢您的宝贵意见"
},
......@@ -419,8 +421,9 @@ module.exports = {
submitBtn: '确认',
errorTips: {
e1: "请填写该项内容",
e2: "请填写正确的联系方式",
e3: "您已经提交了预约信息,请不要重复预约"
e2: "请填写正确的联系电话",
e3: "您已经提交了预约信息,请不要重复预约",
e4: "请填写有效的日期"
}
},
paymentType: {
......
......@@ -375,6 +375,9 @@ export default {
disable = true;
}
});
if(!disable){
disable = !/^((?!0000)[0-9]{4}-((0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-8])|(0[13-9]|1[0-2])-(29|30)|(0[13578]|1[02])-31)|([0-9]{2}(0[48]|[2468][048]|[13579][26])|(0[48]|[2468][048]|[13579][26])00)-02-29)$/.test(dateValue);
}
let result = {
dateValue: this.dateValue,
disable: disable
......
......@@ -23,6 +23,7 @@ export default {
contactIconShow: "",
contactTypeShow: "",
contactPlaceHolderShow: "",
contactDateError: false,
data: {
name: "",
contactType: "",
......@@ -68,10 +69,18 @@ export default {
let b3 = this.data.name ? false : true;
let b4 = this.checkContactMethod() ? true : false;
let b5 = this.data.complain ? false : true;
return b1 || b2 || b3 || b4 || b5;
let b6 = this.contactDateError;
let b7 = this.data.policyNumber && !policyNumberCheck(this.data.policyNumber);
return b1 || b2 || b3 || b4 || b5 || b6 || b7;
}
},
methods: {
checkDate(data) {
this.contactDateError = data.disable;
if (this.contactDateError) {
this.errorTips.contactDateErr = this.i18n.reservation.errorTips.e4;
}
},
showModal(content, icon) {
icon = !icon || typeof icon === "undefined" ? "succ" : icon;
this.modalIcon = icon;
......@@ -94,14 +103,13 @@ export default {
if (b3) {
this.errorTips.contactMethodErr = b3;
}
let b1 = this.checkName();
let b2 = this.checkContactType();
let b4 = this.checkComplain();
let b5 = this.checkPolicyNumber();
let b6 = this.checkContactDate();
let b = b1 & b2 & !b3 & b4 & b5 & b6;
this.checkName();
this.checkContactType();
this.checkComplain();
this.checkPolicyNumber();
this.checkContactDate();
if (b) {
if (!submitBtnDisabled) {
this.isSubmit = true;
httpPost({
url: api.saveComplain,
......@@ -145,12 +153,12 @@ export default {
let hkMobile = contactMethodCheck('hkmobile', this.data.contactMethod);
let zhMobile = contactMethodCheck('mobile', this.data.contactMethod);
if (!hkMobile && !zhMobile) {
return this.i18n.complaintAcceptance.errorTips.e2;
return this.i18n.complaintAcceptance.errorTips.e4;
}
} else {
let emailCheck = contactMethodCheck('email', this.data.contactMethod);
if (!emailCheck) {
return this.i18n.complaintAcceptance.errorTips.e2;
return this.i18n.complaintAcceptance.errorTips.e5;
}
}
return "";
......@@ -175,6 +183,9 @@ export default {
this.errorTips.contactDateErr = this.i18n.complaintAcceptance.errorTips.e1;
return false;
}
if (this.contactDateError) {
return false;
}
return true;
},
userLogin(uinfo) {
......@@ -201,7 +212,12 @@ export default {
this.contactPlaceHolderShow = this.contactTypes[val - 1].placeholder;
},
'data.contactMethod': function () {
let b3 = this.checkContactMethod();
if (b3) {
this.errorTips.contactMethodErr = b3;
} else {
this.errorTips.contactMethodErr = "";
}
},
'data.complain': function () {
this.errorTips.complainErr = "";
......
......@@ -84,7 +84,7 @@
</div>
<div class="ipt-wrap ipt-wrap2">
<!-- <input class="ipt" type="date" :class="{err:errorTips.contactDateErr.length>0}" v-model="data.contactDate"> -->
<date-picker v-model="data.contactDate"></date-picker>
<date-picker v-model="data.contactDate" :check="checkDate"></date-picker>
</div>
<div class="validator" v-if="errorTips.contactDateErr.length > 0">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.contactDateErr}}
......
......@@ -20,6 +20,7 @@ export default {
key: 'value',
isHkCus: true,
checked: false,
contactDateError: false,
data: {
name: "",
contactType: "",
......@@ -39,7 +40,6 @@ export default {
e7: "",
e8: ""
},
modalSimpleVisiable: false,
modalVisiable: false,
targetPath: "",
......@@ -70,13 +70,17 @@ export default {
let b2 = this.data.contactDate ? false : true;
let b3 = this.data.name ? false : true;
let b4 = this.checkContactMethod() ? true : false;
return b1 || b2 || b3 || b4;
let b5 = this.contactDateError;
return b1 || b2 || b3 || b4 || b5;
}
},
methods: {
// 校验日期,日期变更后触发,包含点击和文本输入
checkDate(data){
console.log("checkDate data:", data);
checkDate(data) {
this.contactDateError = data.disable;
if (this.contactDateError) {
this.errorTips.e7 = this.i18n.reservation.errorTips.e4;
}
},
showModal(content, icon) {
icon = !icon || typeof icon === "undefined" ? "succ" : icon;
......@@ -100,12 +104,13 @@ export default {
this.errorTips.e3 = err;
return;
}
let b1 = this.checkName();
let b3 = this.checkInstruction();
let b4 = this.checkContactDate();
let b = b1 & b3 & b4;
this.checkName();
this.checkInstruction();
this.checkContactDate();
if (this.submitBtnDisabled) {
return;
}
if (b) {
this.isSubmit = true;
this.data.hkCustomer = this.isHkCus ? 1 : 0;
httpPost({
......@@ -117,13 +122,11 @@ export default {
}).catch(e => {
switch (e.code) {
case 3001:
console.log(1111);
this.errorTips.e8 = this.i18n.reservation.errorTips.e3;
break;
}
this.isSubmit = false;
})
}
});
},
showSubmitSuccess() {
this.showModal(this.i18n.reservation.success);
......@@ -162,6 +165,9 @@ export default {
this.errorTips.e7 = message;
return false;
}
if (this.contactDateError) {
return false;
}
return true;
},
userLogin(uinfo) {
......@@ -179,18 +185,28 @@ export default {
},
watch: {
'data.name': function () {
this.errorTips.e8 = "";
this.errorTips.e1 = "";
},
'data.contactMethod': function () {
this.errorTips.e8 = "";
let b = this.checkContactMethod();
if (b) {
this.errorTips.e3 = b;
} else {
this.errorTips.e3 = "";
}
},
'data.instruction': function () {
this.errorTips.e8 = "";
this.errorTips.e5 = "";
},
'data.reservationType': function () {
this.errorTips.e8 = "";
},
'data.contactDate': function () {
this.errorTips.e8 = "";
this.errorTips.e7 = "";
}
},
......
......@@ -82,7 +82,7 @@
<div class="label">
<div class="icon"><img src="@/assets/images/reservation/icon-re-calendar.png"></div>{{$t('reservation.contactTime')}}
</div>
<div class="ipt-wrap">
<div class="ipt-wrap" :class="{err:errorTips.e7.length>0}">
<!-- <input class="ipt" type="date" v-model="data.contactDate" :class="{err : errorTips.e7.length > 0}"> -->
<date-picker v-model="data.contactDate" :check="checkDate"></date-picker>
</div>
......
......@@ -182,6 +182,14 @@ export default {
this.errorModel = 2;
});
},
testUpdateUserInfo() {
let userInfo = JSON.parse(JSON.stringify(this.userInfo));
userInfo.hadFullInfo = 1;
userInfo.name = this.information.lastName + this.information.firstName;
this.$store.commit("SET_USER_INFO", userInfo);
},
updateInformation() {
// 仅更新5项基本信息
if (this.loading) {
......
......@@ -11,7 +11,7 @@ import {
} from '@/api/fetch-api.js'
import { contactMethodCheck } from '@utils/utils.js';
import { contactMethodCheck ,checkVerifyCode} from '@utils/utils.js';
import modalComp from '@/components/modal-comp/modal-comp.vue';
import modalSimpleComp from '@/components/modal-simple-comp/modal-simple-comp.vue';
......@@ -116,7 +116,7 @@ export default {
otpLoginDisabled() {
let b1 = !this.loginCheck.agreeProtocol;
let b2 = !this.loginForm.mobileNo;
let b3 = !this.loginForm.otp;
let b3 = !checkVerifyCode(this.loginForm.otp);
let b4 = !this.values.token;
let b5 = this.values.vcodeuuid && !this.loginForm.imageValue;
return b1 || b2 || b3 || b4 || b5;
......@@ -340,7 +340,7 @@ export default {
_checkOptParams() {
return new Promise((resolve, reject) => {
this._checkMobileLegal().then(() => {
if (!this.loginForm.otp) {
if (!checkVerifyCode(this.loginForm.otp)) {
this._showOtpEmptyTips();
return;
}
......
......@@ -4,6 +4,8 @@ import {
httpPost
} from '@/api/fetch-api.js'
import { checkVerifyCode } from '@utils/utils.js';
import modalComp from '@/components/modal-comp/modal-comp.vue';
import modalSimpleComp from '@/components/modal-simple-comp/modal-simple-comp.vue';
import { passwordEncrypt } from '@/utils/encrypt.js';
......@@ -57,7 +59,7 @@ export default {
return b1;
},
s3BtnDisabled() {
let b1 = !this.step3.otp ? true : false;
let b1 = !checkVerifyCode(this.step3.otp) ? true : false;
return b1;
},
s4BtnDisabled() {
......@@ -117,7 +119,7 @@ export default {
// }
this.type = 3;
}
}).catch(err=>{
}).catch(err => {
this.loading = false;
});
},
......@@ -161,7 +163,7 @@ export default {
return;
}
// 发送验证码
if (!this.step3.otp) {
if (!checkVerifyCode(this.step3.otp)) {
this.step3.error = this.i18n().passwordReset.type2.error1;
return;
}
......@@ -186,7 +188,7 @@ export default {
return;
}
}
}).catch(err=>{
}).catch(err => {
this.loading = false;
})
},
......@@ -225,7 +227,8 @@ export default {
break
default:
message = this.i18n().passwordCheck.error4;
this.showModal(message, "info");
this.step4.error2 = message;
// this.showModal(message, "info");
break;
}
}
......
......@@ -113,7 +113,8 @@ export default {
case "COMMON_ERROR_E0":
message = this.i18n().session.sidExpire;
this.targetPath = "/login?callback=/password/reset";
this.showModal(message, "info");
this.step.error2 = message;
// this.showModal(message, "info");
break;
default:
this.step.error0 = this.i18n().passwordCheck.error5;
......@@ -124,7 +125,8 @@ export default {
this.loading = false;
let message = this.i18n().session.sidExpire;
this.targetPath = "/login?callback=/password/reset";
this.showModal(message, "info");
this.step.error2 = message;
// this.showModal(message, "info");
});
},
checkPassword(password) {
......
......@@ -6,7 +6,7 @@ import {
httpPost
} from '@/api/fetch-api.js'
import { contactMethodCheck } from '@utils/utils.js';
import { contactMethodCheck,checkVerifyCode } from '@utils/utils.js';
import modalComp from '@/components/modal-comp/modal-comp.vue';
import modalSimpleComp from '@/components/modal-simple-comp/modal-simple-comp.vue';
......@@ -84,7 +84,7 @@ export default {
let b1 = !this.registerCheck.agreeProtocol;
let b2 = !this.values.token;
let b3 = this.values.vcodeuuid && !this.registerForm.imageValue;
let b4 = !this.registerForm.opt;
let b4 = !checkVerifyCode(this.registerForm.opt);
return b1 || b2 || b3 || b4;
},
submitDisabled() {
......@@ -311,7 +311,7 @@ export default {
this._showImageValueTip();
return;
}
if (!this.registerForm.opt) {
if (!checkVerifyCode(this.registerForm.opt)) {
this._showOTPTip();
return;
}
......
......@@ -272,5 +272,9 @@ export function contactMethodCheck(type, value) {
}
export function policyNumberCheck(policyNumber) {
return /^P(0001|0002)\d{11}$/.test(policyNumber);
return /^(P|p)(0001|0002)\d{11}$/.test(policyNumber);
}
export function checkVerifyCode(verifyCode) {
return /^\d{6}$/.test(verifyCode)
}
\ No newline at end of file
......