03e454cc by joe

所有的alert拿掉

1 parent afc44feb
Showing 43 changed files with 366 additions and 94 deletions
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -415,4 +415,8 @@ textarea { ...@@ -415,4 +415,8 @@ textarea {
415 border-color: $cOrange !important; 415 border-color: $cOrange !important;
416 } 416 }
417 417
418 .ipt.err {
419 border-color: $cOrange !important;
420 }
421
418 </style> 422 </style>
......
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
17 // 修改密码 17 // 修改密码
18 changePassword : "/pingan_hklife_webapi/password/change", 18 changePassword : "/pingan_hklife_webapi/password/change",
19 // 短信验证码登录 19 // 短信验证码登录
20 otpLogin : "/pingan_hklife_webapi/otpLogin", 20 otpLogin : "/pingan_hklife_webapi/user/otpLogin",
21 // 找回密码:定位用户信息 21 // 找回密码:定位用户信息
22 locateUserInfo : "/pingan_hklife_webapi/reset/locateUserInfo", 22 locateUserInfo : "/pingan_hklife_webapi/reset/locateUserInfo",
23 // 找回密码:发送验证码 23 // 找回密码:发送验证码
......
...@@ -135,6 +135,18 @@ module.exports = { ...@@ -135,6 +135,18 @@ module.exports = {
135 verifyCode: "驗證碼", 135 verifyCode: "驗證碼",
136 verifyCodePlaceholder: "驗證碼", 136 verifyCodePlaceholder: "驗證碼",
137 verifyCodeGet: "獲取驗證碼", 137 verifyCodeGet: "獲取驗證碼",
138 tips : {
139 e1 : "请输入账号信息",
140 e2 : "请输入密码",
141 e3 : "请输入图像验证码",
142 e4 : "请同意《平安一账通会员服务协议》",
143 e5 : "账号/密码不正确",
144 oe0 : "请输入正确的手机号",
145 oe1 : "请先获取短信验证码",
146 oe2 : "请输入图片验证码",
147 oe3 : "请输入短信验证码",
148 oe4 : "短信验证码不正确",
149 }
138 }, 150 },
139 session: { 151 session: {
140 sidExpire: "長時間未操作,為了您賬戶的安全,請登錄後再操作", 152 sidExpire: "長時間未操作,為了您賬戶的安全,請登錄後再操作",
...@@ -165,6 +177,20 @@ module.exports = { ...@@ -165,6 +177,20 @@ module.exports = {
165 newPasswordSure: "確認密碼", 177 newPasswordSure: "確認密碼",
166 newPasswordSurePlaceholder: "輸入登錄密碼", 178 newPasswordSurePlaceholder: "輸入登錄密碼",
167 sure: "確認", 179 sure: "確認",
180 tips: {
181 e1: "手機號不正確,請輸入正確的手機號",
182 e2: "請同意《平安一賬通會員服務協議》",
183 e3: "短信驗證碼不正確",
184 e4: "請先獲取短信驗證碼",
185 e5: "手機號已經被註冊,請使用其他手機號註冊或直接登錄",
186 e6: "請輸入圖片驗證碼",
187 e7: "密碼長度不能少於8位",
188 e8: "密碼中必須包含數字、字符以及特殊號碼",
189 e9: "兩次密碼不一致,請確認後重新輸入",
190 e10: "驗證碼過期,請重新申請驗證碼",
191 e11: "註冊失敗,請聯繫工作人員",
192 e12: "註冊成功",
193 }
168 }, 194 },
169 passwordCheck: { 195 passwordCheck: {
170 error1: "密碼長度不少於8位", 196 error1: "密碼長度不少於8位",
......
...@@ -135,6 +135,18 @@ module.exports = { ...@@ -135,6 +135,18 @@ module.exports = {
135 verifyCode: "驗證碼", 135 verifyCode: "驗證碼",
136 verifyCodePlaceholder: "驗證碼", 136 verifyCodePlaceholder: "驗證碼",
137 verifyCodeGet: "獲取驗證碼", 137 verifyCodeGet: "獲取驗證碼",
138 tips: {
139 e1: "請輸入賬號信息",
140 e2: "請輸入密碼",
141 e3: "請輸入圖像驗證碼",
142 e4: "請同意《平安一賬通會員服務協議》",
143 e5: "賬號或密碼不正確",
144 oe0: "請輸入正確的手機號",
145 oe1: "請先獲取短信驗證碼",
146 oe2: "請輸入圖片驗證碼",
147 oe3: "請輸入短信驗證碼",
148 oe4: "短信驗證碼不正確",
149 },
138 }, 150 },
139 register: { 151 register: {
140 mobileOptions: [{ 152 mobileOptions: [{
...@@ -162,6 +174,20 @@ module.exports = { ...@@ -162,6 +174,20 @@ module.exports = {
162 newPasswordSure: "確認密碼", 174 newPasswordSure: "確認密碼",
163 newPasswordSurePlaceholder: "輸入登錄密碼", 175 newPasswordSurePlaceholder: "輸入登錄密碼",
164 sure: "確認", 176 sure: "確認",
177 tips: {
178 e1: "手機號不正確,請輸入正確的手機號",
179 e2: "請同意《平安一賬通會員服務協議》",
180 e3: "短信驗證碼不正確",
181 e4: "請先獲取短信驗證碼",
182 e5: "手機號已經被註冊,請使用其他手機號註冊或直接登錄",
183 e6: "請輸入圖片驗證碼",
184 e7: "密碼長度不能少於8位",
185 e8: "密碼中必須包含數字、字符以及特殊號碼",
186 e9: "兩次密碼不一致,請確認後重新輸入",
187 e10: "驗證碼過期,請重新申請驗證碼",
188 e11: "註冊失敗,請聯繫工作人員",
189 e12: "註冊成功",
190 }
165 }, 191 },
166 session: { 192 session: {
167 sidExpire: "長時間未操作,為了您賬戶的安全,請登錄後再操作", 193 sidExpire: "長時間未操作,為了您賬戶的安全,請登錄後再操作",
...@@ -170,13 +196,13 @@ module.exports = { ...@@ -170,13 +196,13 @@ module.exports = {
170 error1: "密碼長度不少於8位", 196 error1: "密碼長度不少於8位",
171 error2: "密碼中必須包含數字、字符以及特殊號碼", 197 error2: "密碼中必須包含數字、字符以及特殊號碼",
172 error3: "兩次密碼不一致,請確認後重新輸入", 198 error3: "兩次密碼不一致,請確認後重新輸入",
173 error4 : "密碼修改失敗,請稍後再試,或撥打客服電話95511解決", 199 error4: "密碼修改失敗,請稍後再試,或撥打客服電話95511解決",
174 error5 : "舊密碼不正確,請重新輸入", 200 error5: "舊密碼不正確,請重新輸入",
175 success: "密碼修改成功" 201 success: "密碼修改成功"
176 }, 202 },
177 passwordReset: { 203 passwordReset: {
178 oldPwd : "舊密碼", 204 oldPwd: "舊密碼",
179 oldPwdPlaceholde : "請輸入舊密碼", 205 oldPwdPlaceholde: "請輸入舊密碼",
180 cidExpire: "長時間未操作,為了您賬戶的安全,請重新開始", 206 cidExpire: "長時間未操作,為了您賬戶的安全,請重新開始",
181 type1: { 207 type1: {
182 title: "密碼找回", 208 title: "密碼找回",
......
...@@ -135,6 +135,18 @@ module.exports = { ...@@ -135,6 +135,18 @@ module.exports = {
135 verifyCode: "验证码", 135 verifyCode: "验证码",
136 verifyCodePlaceholder: "验证码", 136 verifyCodePlaceholder: "验证码",
137 verifyCodeGet: "获取验证码", 137 verifyCodeGet: "获取验证码",
138 tips : {
139 e1 : "请输入账号信息",
140 e2 : "请输入密码",
141 e3 : "请输入图像验证码",
142 e4 : "请同意《平安一账通会员服务协议》",
143 e5 : "账号或密码不正确",
144 oe0 : "请输入正确的手机号",
145 oe1 : "请先获取短信验证码",
146 oe2 : "请输入图片验证码",
147 oe3 : "请输入短信验证码",
148 oe4 : "短信验证码不正确",
149 }
138 }, 150 },
139 session: { 151 session: {
140 sidExpire: "长时间未操作,为了您的账户安全,请登录后再操作", 152 sidExpire: "长时间未操作,为了您的账户安全,请登录后再操作",
...@@ -165,6 +177,20 @@ module.exports = { ...@@ -165,6 +177,20 @@ module.exports = {
165 newPasswordSure: "确认密码", 177 newPasswordSure: "确认密码",
166 newPasswordSurePlaceholder: "输入登录密码", 178 newPasswordSurePlaceholder: "输入登录密码",
167 sure: "确认", 179 sure: "确认",
180 tips: {
181 e1: "手机号不正确,请输入正确的手机号",
182 e2: "请同意《平安一账通会员服务协议》",
183 e3: "短信验证码不正确",
184 e4: "请先获取短信验证码",
185 e5: "手机号已经被注册,请使用其他手机号注册或直接登录",
186 e6: "请输入图片验证码",
187 e7: "密码长度不能少于8位",
188 e8: "密码必须同时包含数字、字母、特殊字符",
189 e9: "两次输入的密码不一致",
190 e10: "验证码过期,请重新申请验证码",
191 e11: "注册失败,请联系工作人员",
192 e12: "註冊成功",
193 }
168 }, 194 },
169 passwordCheck: { 195 passwordCheck: {
170 error1: "密码长度不少于8位", 196 error1: "密码长度不少于8位",
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
8 } from '@/api/fetch-api.js' 8 } from '@/api/fetch-api.js'
9 9
10 10
11 import modalComp from '@/components/modal-comp/modal-comp.vue';
11 import { passwordEncrypt } from '@/utils/encrypt.js'; 12 import { passwordEncrypt } from '@/utils/encrypt.js';
12 13
13 14
...@@ -46,9 +47,26 @@ export default { ...@@ -46,9 +47,26 @@ export default {
46 showImageCode: false, 47 showImageCode: false,
47 agreeProtocol: false 48 agreeProtocol: false
48 }, 49 },
50 errorTips: {
51 // 账密登录页
52 e1: "",// 账号
53 e2: "",// 密码
54 e3: "",// 图像验证码
55 e4: "",// 勾选同意
56 // 短信验证码
57 oe1: "", // 账号
58 oe2: "", // 短信验证码
59 oe3: "", // 图像验证码
60 },
61 modalVisiable: false,
62 targetPath: "",
63 modalIcon: "succ",
64 modalContent: ""
49 } 65 }
50 }, 66 },
51 components: {}, 67 components: {
68 modalComp
69 },
52 computed: { 70 computed: {
53 ...mapState({ 71 ...mapState({
54 userInfo: state => state.userInfo 72 userInfo: state => state.userInfo
...@@ -61,6 +79,12 @@ export default { ...@@ -61,6 +79,12 @@ export default {
61 } 79 }
62 }, 80 },
63 methods: { 81 methods: {
82 showModal(content, icon) {
83 icon = !icon || typeof icon === "undefined" ? "succ" : "succ";
84 this.modalIcon = icon;
85 this.modalContent = content;
86 this.modalVisiable = true;
87 },
64 onCheckHandler() { 88 onCheckHandler() {
65 89
66 }, 90 },
...@@ -126,6 +150,14 @@ export default { ...@@ -126,6 +150,14 @@ export default {
126 }, 150 },
127 _passwordLogin() { 151 _passwordLogin() {
128 // 刷新图形二维码 152 // 刷新图形二维码
153 if (!this.loginForm.userId) {
154 this._showEmptyInputTips();
155 return;
156 }
157 if (!this.loginForm.password) {
158 this._showEmptyPasswordTips();
159 return;
160 }
129 this.handlerIsShowImageVcode().then(() => { 161 this.handlerIsShowImageVcode().then(() => {
130 httpPost({ 162 httpPost({
131 url: api.gsLogin, 163 url: api.gsLogin,
...@@ -142,19 +174,44 @@ export default { ...@@ -142,19 +174,44 @@ export default {
142 // 处理登录结果 174 // 处理登录结果
143 _handlerLoginResponse(response) { 175 _handlerLoginResponse(response) {
144 // let res = response.content; 176 // let res = response.content;
145 if (response.returnCode == 0 || response.resultCode == "0") { 177 if (response.returnCode == 0 || response.returnCode == "0") {
146 this.$store.commit("SET_USER_INFO", response.data); 178 this.$store.commit("SET_USER_INFO", response.data);
147 this._redirectTo(); 179 this._redirectTo();
148 } else { 180 } else {
149 let msg = response.returnMsg; 181 this._showLoginErrorMessage(response);
150 this._showLoginErrorMessage(msg);
151 } 182 }
152 }, 183 },
184 _showEmptyInputTips() {
185 let message = this.i18n.login.tips.e1;
186 this.errorTips.e1 = message;
187 },
188 _showEmptyPasswordTips() {
189 let message = this.i18n.login.tips.e2;
190 this.errorTips.e2 = message;
191 },
153 _showAgreeProtocalTips() { 192 _showAgreeProtocalTips() {
154 alert("请同意《平安一账通会员服务协议》"); 193 let message = this.i18n.login.tips.e4;
194 this.showModal(message, "info");
155 }, 195 },
156 _showLoginErrorMessage(message) { 196 _showLoginErrorMessage(response) {
157 alert(message); 197 switch (response.returnCode) {
198 case "SMS_ERROR_006":
199 // 短信验证码不正确
200 this.showModal(this.i18n.login.tips.oe4, "info");
201 break;
202 case "BIZ_ERROR_018":
203 // 账号或密码不正确
204 this.showModal(this.i18n.login.tips.e5, "info");
205 break;
206 case "BIZ_ERROR_011":
207 case "BIZ_ERROR_012":
208 // 登录错误4次、5次
209 this.showModal(response.returnMsg, "info");
210 return;
211 default:
212 this.showModal(this.i18n.login.tips.e5, "info");
213 break;
214 }
158 }, 215 },
159 _redirectTo() { 216 _redirectTo() {
160 let path = this.$route.query.callback || "/index"; 217 let path = this.$route.query.callback || "/index";
...@@ -194,13 +251,19 @@ export default { ...@@ -194,13 +251,19 @@ export default {
194 }) 251 })
195 }, 252 },
196 _showGetOptTips() { 253 _showGetOptTips() {
197 alert('请先获取短信验证码'); 254 let message = this.i18n.login.tips.oe1;
255 this.errorTips.oe2 = message;
256 // alert('请先获取短信验证码');
198 }, 257 },
199 _showImageValueTip() { 258 _showImageValueTip() {
200 alert("请输入图片验证码") 259 let message = this.i18n.login.tips.oe2;
260 this.errorTips.oe3 = message;
261 // alert("请输入图片验证码")
201 }, 262 },
202 _showOtpEmptyTips() { 263 _showOtpEmptyTips() {
203 alert('请输入短信验证码'); 264 let message = this.i18n.login.tips.oe3;
265 this.errorTips.oe2 = message;
266 // alert('请输入短信验证码');
204 }, 267 },
205 handlerStdSendOTP() { 268 handlerStdSendOTP() {
206 // 发送短信验证码 269 // 发送短信验证码
...@@ -276,7 +339,9 @@ export default { ...@@ -276,7 +339,9 @@ export default {
276 }); 339 });
277 }, 340 },
278 _showMobileNoIllegalTip() { 341 _showMobileNoIllegalTip() {
279 alert("手机号不正确"); 342 let message = this.i18n.login.tips.oe0;
343 this.errorTips.oe1 = message;
344 // alert("手机号不正确");
280 }, 345 },
281 _startStdSendOTP() { 346 _startStdSendOTP() {
282 // 正式发送OTP信号 347 // 正式发送OTP信号
...@@ -317,10 +382,33 @@ export default { ...@@ -317,10 +382,33 @@ export default {
317 } 382 }
318 return this.values.deviceId 383 return this.values.deviceId
319 }, 384 },
385 modalCallback() {
386 this.modalVisiable = false;
387 if (this.targetPath) {
388 this.$router.push({
389 "path": this.targetPath
390 });
391 }
392 }
320 }, 393 },
321 watch: { 394 watch: {
322 type() { 395 type() {
323 this.loginCheck.showImageCode = false; 396 this.loginCheck.showImageCode = false;
397 },
398 'loginForm.userId': function () {
399 this.errorTips.e1 = "";
400 },
401 'loginForm.password': function () {
402 this.errorTips.e2 = "";
403 },
404 'loginForm.mobileNo': function () {
405 this.errorTips.oe1 = "";
406 },
407 'loginForm.otp': function () {
408 this.errorTips.oe2 = "";
409 },
410 'loginForm.imageValue': function () {
411 this.errorTips.oe3 = "";
324 } 412 }
325 }, 413 },
326 mounted() { 414 mounted() {
......
1 1
2 <template> 2 <template>
3 <div class="content"> 3 <div class="content">
4 <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
4 <div class="ebg"> 5 <div class="ebg">
5 <img src="@/assets/images/common/login-bg.png"> 6 <img src="@/assets/images/common/login-bg.png">
6 </div> 7 </div>
...@@ -24,7 +25,10 @@ ...@@ -24,7 +25,10 @@
24 <img src="@/assets/images/login/icon-login-user.png"> {{$t('login.account')}} 25 <img src="@/assets/images/login/icon-login-user.png"> {{$t('login.account')}}
25 </div> 26 </div>
26 <div class="ipt-wrap"> 27 <div class="ipt-wrap">
27 <input v-model="loginForm.userId" :placeholder="$t('login.accountPlaceholder')" class="ipt" type="text"> 28 <input v-model="loginForm.userId" :placeholder="$t('login.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text">
29 </div>
30 <div class="validator" v-if="errorTips.e1.length > 0 ">
31 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
28 </div> 32 </div>
29 </div> 33 </div>
30 <div class="pure-u-1 form-item"> 34 <div class="pure-u-1 form-item">
...@@ -32,16 +36,22 @@ ...@@ -32,16 +36,22 @@
32 <img src="@/assets/images/login/icon-login-password.png"> {{$t('login.password')}} 36 <img src="@/assets/images/login/icon-login-password.png"> {{$t('login.password')}}
33 </div> 37 </div>
34 <div class="ipt-wrap"> 38 <div class="ipt-wrap">
35 <input v-model="loginForm.password" :placeholder="$t('login.passwordPlaceholder')" class="ipt" type="password"> 39 <input v-model="loginForm.password" :placeholder="$t('login.passwordPlaceholder')" class="ipt" :class="{ err : errorTips.e2.length > 0 }" type="password">
40 </div>
41 <div class="validator" v-if="errorTips.e2.length > 0 ">
42 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
36 </div> 43 </div>
37 </div> 44 </div>
38 <div class="pure-u-1 form-item" v-if="type == 1 && loginCheck.showImageCode"> 45 <div class="pure-u-1 form-item" v-if="type == 1 && loginCheck.showImageCode">
39 <div class="ipt-wrap"> 46 <div class="ipt-wrap">
40 <input :placeholder="$t('login.verifyPlaceholder')" class="ipt ipt-verify" type="text" v-model="loginForm.imageValue"> 47 <input :placeholder="$t('login.verifyPlaceholder')" class="ipt ipt-verify" :class="{ err : errorTips.e3.length > 0 }" type="text" v-model="loginForm.imageValue">
41 <div class="ipt verify-btn pointer vcode" @click="handlerRefreshImageValue"> 48 <div class="ipt verify-btn pointer vcode" @click="handlerRefreshImageValue">
42 <img :src="values.imageBase64"> 49 <img :src="values.imageBase64">
43 </div> 50 </div>
44 </div> 51 </div>
52 <div class="validator" v-if="errorTips.e3.length > 0 ">
53 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e3}}
54 </div>
45 </div> 55 </div>
46 </div> 56 </div>
47 <div class="login-protocol pointer" @click="loginCheck.agreeProtocol = !loginCheck.agreeProtocol" > 57 <div class="login-protocol pointer" @click="loginCheck.agreeProtocol = !loginCheck.agreeProtocol" >
...@@ -75,28 +85,37 @@ ...@@ -75,28 +85,37 @@
75 <img src="@/assets/images/login/icon-login-phone.png"> {{$t('login.mobile')}} 85 <img src="@/assets/images/login/icon-login-phone.png"> {{$t('login.mobile')}}
76 </div> 86 </div>
77 <div class="ipt-wrap"> 87 <div class="ipt-wrap">
78 <input :placeholder="$t('login.mobilePlaceholder')" class="ipt" type="text" v-model="loginForm.mobileNo"> 88 <input :placeholder="$t('login.mobilePlaceholder')" class="ipt" type="text" :class="{ err : errorTips.oe1.length > 0 }" v-model="loginForm.mobileNo">
89 </div>
90 <div class="validator" v-if="errorTips.oe1.length > 0 ">
91 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.oe1}}
79 </div> 92 </div>
80 </div> 93 </div>
81 <div class="pure-u-1 form-item" v-if="type == 2 && loginCheck.showImageCode"> 94 <div class="pure-u-1 form-item" v-if="type == 2 && loginCheck.showImageCode">
82 <div class="ipt-wrap"> 95 <div class="ipt-wrap">
83 <input :placeholder="$t('login.verifyPlaceholder')" class="ipt ipt-verify" type="text" v-model="loginForm.imageValue"> 96 <input :placeholder="$t('login.verifyPlaceholder')" class="ipt ipt-verify" :class="{ err : errorTips.oe3.length > 0 }" type="text" v-model="loginForm.imageValue">
84 <div class="ipt verify-btn pointer vcode" @click="handlerRefreshImageValue"> 97 <div class="ipt verify-btn pointer vcode" @click="handlerRefreshImageValue">
85 <img :src="values.imageBase64"> 98 <img :src="values.imageBase64">
86 </div> 99 </div>
87 </div> 100 </div>
101 <div class="validator" v-if="errorTips.oe3.length > 0 ">
102 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.oe3}}
103 </div>
88 </div> 104 </div>
89 <div class="pure-u-1 form-item"> 105 <div class="pure-u-1 form-item">
90 <div class="label"> 106 <div class="label">
91 <img src="@/assets/images/login/icon-login-message.png"> {{$t('login.verifyCode')}} 107 <img src="@/assets/images/login/icon-login-message.png"> {{$t('login.verifyCode')}}
92 </div> 108 </div>
93 <div class="ipt-wrap"> 109 <div class="ipt-wrap">
94 <div class="ipt ipt2"> 110 <div class="ipt ipt2" :class="{ err : errorTips.oe2.length > 0 }">
95 <input :placeholder="$t('login.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="loginForm.otp"> 111 <input :placeholder="$t('login.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="loginForm.otp">
96 <div v-if="times.remain == 0" class="veri-btn pointer" @click="handlerStdSendOTP" >{{$t('register.verifyCodeGet')}}</div> 112 <div v-if="times.remain == 0" class="veri-btn pointer" @click="handlerStdSendOTP" >{{$t('register.verifyCodeGet')}}</div>
97 <div v-else class="veri-btn-default">{{times.tip}}</div> 113 <div v-else class="veri-btn-default">{{times.tip}}</div>
98 </div> 114 </div>
99 </div> 115 </div>
116 <div class="validator" v-if="errorTips.oe2.length > 0 ">
117 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.oe2}}
118 </div>
100 </div> 119 </div>
101 </div> 120 </div>
102 <div class="login-protocol pointer" @click="loginCheck.agreeProtocol = !loginCheck.agreeProtocol" > 121 <div class="login-protocol pointer" @click="loginCheck.agreeProtocol = !loginCheck.agreeProtocol" >
......
...@@ -21,10 +21,9 @@ export default { ...@@ -21,10 +21,9 @@ export default {
21 tip: "" // 显示的文字 21 tip: "" // 显示的文字
22 }, 22 },
23 modalVisiable: false, 23 modalVisiable: false,
24 modal: { 24 targetPath: "",
25 icon: "succ", 25 modalIcon: "succ",
26 content: "", 26 modalContent: "",
27 },
28 step1: { 27 step1: {
29 userId: "", 28 userId: "",
30 error: "" 29 error: ""
...@@ -70,7 +69,7 @@ export default { ...@@ -70,7 +69,7 @@ export default {
70 uid: this.step1.userId 69 uid: this.step1.userId
71 } 70 }
72 }).then(response => { 71 }).then(response => {
73 if (response.resultCode !== "0") { 72 if (response.returnCode !== "0") {
74 this.step1.error = this.i18n().passwordReset.type1.error; 73 this.step1.error = this.i18n().passwordReset.type1.error;
75 } else { 74 } else {
76 this.values.cid = response.data.cid; 75 this.values.cid = response.data.cid;
...@@ -98,7 +97,7 @@ export default { ...@@ -98,7 +97,7 @@ export default {
98 } 97 }
99 }).then(response => { 98 }).then(response => {
100 if (this.responseHandler(response)) { 99 if (this.responseHandler(response)) {
101 switch (response.resultCode) { 100 switch (response.returnCode) {
102 case "COMMON_ERROR_E3": 101 case "COMMON_ERROR_E3":
103 this.step2.error = this.i18n().passwordReset.type2.error3; 102 this.step2.error = this.i18n().passwordReset.type2.error3;
104 return; 103 return;
...@@ -124,7 +123,7 @@ export default { ...@@ -124,7 +123,7 @@ export default {
124 } 123 }
125 }).then(response => { 124 }).then(response => {
126 if (this.responseHandler(response)) { 125 if (this.responseHandler(response)) {
127 switch (response.resultCode) { 126 switch (response.returnCode) {
128 case "0": 127 case "0":
129 this.type = 4; 128 this.type = 4;
130 return; 129 return;
...@@ -158,7 +157,7 @@ export default { ...@@ -158,7 +157,7 @@ export default {
158 if (this.responseHandler(response)) { 157 if (this.responseHandler(response)) {
159 let message = this.i18n().passwordCheck.success; 158 let message = this.i18n().passwordCheck.success;
160 this.step4.success = true; 159 this.step4.success = true;
161 switch (response.resultCode) { 160 switch (response.returnCode) {
162 case "0": 161 case "0":
163 this.showModal(message, "succ"); 162 this.showModal(message, "succ");
164 break 163 break
...@@ -208,7 +207,7 @@ export default { ...@@ -208,7 +207,7 @@ export default {
208 }, 1000); 207 }, 1000);
209 }, 208 },
210 responseHandler(response) { 209 responseHandler(response) {
211 switch (response.resultCode) { 210 switch (response.returnCode) {
212 case "COMMON_ERROR_E2": 211 case "COMMON_ERROR_E2":
213 // 身份过期了,请重新登录 212 // 身份过期了,请重新登录
214 this.values.cid = ""; 213 this.values.cid = "";
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
76 }).then(response => { 76 }).then(response => {
77 this.targetPath = ""; 77 this.targetPath = "";
78 let message = this.i18n().passwordCheck.success; 78 let message = this.i18n().passwordCheck.success;
79 switch (response.resultCode) { 79 switch (response.returnCode) {
80 case "0": 80 case "0":
81 this.targetPath = ""; 81 this.targetPath = "";
82 this.showModal(message, "succ"); 82 this.showModal(message, "succ");
......
...@@ -4,13 +4,14 @@ import { ...@@ -4,13 +4,14 @@ import {
4 httpPost 4 httpPost
5 } from '@/api/fetch-api.js' 5 } from '@/api/fetch-api.js'
6 6
7 import modalComp from '@/components/modal-comp/modal-comp.vue';
7 import { passwordEncrypt } from '@/utils/encrypt.js'; 8 import { passwordEncrypt } from '@/utils/encrypt.js';
8 9
9 export default { 10 export default {
10 data() { 11 data() {
11 return { 12 return {
12 key: 'value', 13 key: 'value',
13 type: 1, // 1:手机验证 2:输入密码 14 type: 2, // 1:手机验证 2:输入密码
14 mobileNoType: "hk",// 选择的手机好类型 15 mobileNoType: "hk",// 选择的手机好类型
15 mobileTip: {}, 16 mobileTip: {},
16 mobileOptions: [], 17 mobileOptions: [],
...@@ -38,9 +39,23 @@ export default { ...@@ -38,9 +39,23 @@ export default {
38 remain: 0, // 剩余时间 39 remain: 0, // 剩余时间
39 tip: "" // 显示的文字 40 tip: "" // 显示的文字
40 }, 41 },
42
43 errorTips: {
44 p1: "",// 手機號
45 p2: "",// 短信驗證碼
46 p3: "",// 圖像驗證碼
47 p4: "",// 密碼
48 p5: "",// 確認密碼
49 },
50 modalVisiable: false,
51 targetPath: "",
52 modalIcon: "succ",
53 modalContent: ""
41 } 54 }
42 }, 55 },
43 components: {}, 56 components: {
57 modalComp
58 },
44 computed: { 59 computed: {
45 locale() { 60 locale() {
46 return this.$i18n.locale || 'tc'; 61 return this.$i18n.locale || 'tc';
...@@ -50,6 +65,12 @@ export default { ...@@ -50,6 +65,12 @@ export default {
50 } 65 }
51 }, 66 },
52 methods: { 67 methods: {
68 showModal(content, icon) {
69 icon = !icon || typeof icon === "undefined" ? "succ" : "succ";
70 this.modalIcon = icon;
71 this.modalContent = content;
72 this.modalVisiable = true;
73 },
53 onProtocolHandler() { 74 onProtocolHandler() {
54 this.$router.push({ 75 this.$router.push({
55 path: "/protocol" 76 path: "/protocol"
...@@ -129,7 +150,9 @@ export default { ...@@ -129,7 +150,9 @@ export default {
129 }); 150 });
130 }, 151 },
131 _showMobileNoIllegalTip() { 152 _showMobileNoIllegalTip() {
132 alert("手机号不正确"); 153 let message = this.i18n.register.tips.e1;
154 this.errorTips.p1 = message;
155 // alert("手机号不正确");
133 }, 156 },
134 _startStdSendOTP() { 157 _startStdSendOTP() {
135 // 正式发送OTP信号 158 // 正式发送OTP信号
...@@ -223,48 +246,65 @@ export default { ...@@ -223,48 +246,65 @@ export default {
223 }, 246 },
224 _checkParams() { 247 _checkParams() {
225 return new Promise((resolve, reject) => { 248 return new Promise((resolve, reject) => {
226 if (!this.registerCheck.agreeProtocol) {
227 this._showAgreeProtocolTip();
228 return;
229 }
230 if (!this.values.token) {
231 this._showTokenTip();
232 return;
233 }
234 if (this.values.vcodeuuid && !this.registerForm.imageValue) {
235 this._showImageValueTip();
236 return;
237 }
238 if (!this.registerForm.opt) {
239 this._showOTPTip();
240 return;
241 }
242 this._checkMobileLegal().then(() => { 249 this._checkMobileLegal().then(() => {
250 if (!this.registerCheck.agreeProtocol) {
251 this._showAgreeProtocolTip();
252 return;
253 }
254 if (!this.values.token) {
255 this._showTokenTip();
256 return;
257 }
258 if (this.values.vcodeuuid && !this.registerForm.imageValue) {
259 this._showImageValueTip();
260 return;
261 }
262 if (!this.registerForm.opt) {
263 this._showOTPTip();
264 return;
265 }
243 resolve(); 266 resolve();
244 }) 267 })
245 }); 268 });
246 }, 269 },
247 270
248 _showAgreeProtocolTip() { 271 _showAgreeProtocolTip() {
249 alert("请同意协议") 272 let message = this.i18n.register.tips.e2;
273 this.showModal(message, "info");
274
275 // alert("请同意协议")
250 }, 276 },
251 _showOTPTip() { 277 _showOTPTip() {
252 alert("请填写短信验证码") 278 let message = this.i18n.register.tips.e3;
279 this.errorTips.p2 = message;
280 // alert("请填写短信验证码")
253 }, 281 },
254 _showTokenTip() { 282 _showTokenTip() {
255 alert("请先请求短信验证码") 283 let message = this.i18n.register.tips.e4;
284 this.errorTips.p2 = message;
285 // alert("请先请求短信验证码")
256 }, 286 },
257 _showDuplicateRegistrationTip() { 287 _showDuplicateRegistrationTip() {
258 alert("手机号已经被注册,请使用其他手机号重新注册") 288 let message = this.i18n.register.tips.e5;
289 this.showModal(message, "info");
290 // alert("手机号已经被注册,请使用其他手机号重新注册")
259 }, 291 },
260 _showImageValueTip() { 292 _showImageValueTip() {
261 alert("请输入图片验证码") 293 let message = this.i18n.register.tips.e5;
294 this.errorTips.p3 = message;
295
296 // alert("请输入图片验证码")
262 }, 297 },
263 _showCheckOTPErrTip(msg) { 298 _showCheckOTPErrTip(msg) {
264 alert(msg); 299 this.showModal(msg, "info");
300 // alert(msg);
265 }, 301 },
266 onRegisterHandler() { 302 onRegisterHandler() {
267 this._checkPassword().then(() => { 303 let c = this.checkPassword();
304 if (c) {
305 this.errorTips.p4 = c;
306 } else {
307 this.errorTips.p4 = "";
268 let data = { 308 let data = {
269 token: this.values.token, 309 token: this.values.token,
270 mobileNo: this.registerForm.mobileNo, 310 mobileNo: this.registerForm.mobileNo,
...@@ -279,56 +319,54 @@ export default { ...@@ -279,56 +319,54 @@ export default {
279 this.type = 1; 319 this.type = 1;
280 } else { 320 } else {
281 this._showSuccessMessage(); 321 this._showSuccessMessage();
282 this.$router.push({
283 path: "/login"
284 });
285 } 322 }
286 }) 323 })
287 }); 324 }
288 }, 325 },
289 _checkPassword() { 326 checkPassword(password) {
290 return new Promise((resolve, reject) => { 327 if (password.length < 8) {
291 let password = this.values.password; 328 return this.i18n.register.tips.e7;
292 if (password.length < 8) { 329 }
293 this._showPasswordLenthNotEnouth(); 330 // 匹配字母
294 return; 331 let m1 = /([a-z])+/.test(password);
295 } 332 let m2 = /([A-Z])+/.test(password);
296 // 匹配字母 333 // 匹配数字
297 let m1 = /([a-z])+/.test(password); 334 let m3 = /([0-9])+/.test(password);
298 let m2 = /([A-Z])+/.test(password); 335 // 匹配特殊字符
299 // 匹配数字 336 let m4 = /[^a-zA-Z0-9]+/.test(password);
300 let m3 = /([0-9])+/.test(password); 337 if ((m1 | m2) & m3 & m4) {
301 // 匹配特殊字符 338 return "";
302 let m4 = /[^a-zA-Z0-9]+/.test(password); 339 } else {
303 console.log(m1, m2, m3, m4) 340 return this.i18n.register.tips.e8;
304 if ((m1 | m2) & m3 & m4) { 341 }
305 if (password != this.values.passwordRepeat) {
306 this._showPasswordNotTheSameTips();
307 } else {
308 resolve();
309 }
310 } else {
311 this._showPasswordComplexityTips();
312 }
313 });
314 }, 342 },
315 _showPasswordLenthNotEnouth() { 343 _showPasswordLenthNotEnouth() {
316 alert("密码长度不能少于8位") 344 let message = this.i18n.register.tips.e7;
345 this.errorTips.p4 = message;
346 // alert("密码长度不能少于8位")
317 }, 347 },
318 _showPasswordComplexityTips() { 348 _showPasswordComplexityTips() {
319 alert("密码必须同时包含数字、字母、特殊字符") 349 let message = this.i18n.register.tips.e8;
350 this.errorTips.p4 = message;
351 // alert("密码必须同时包含数字、字母、特殊字符")
320 }, 352 },
321 _showPasswordNotTheSameTips() { 353 _showPasswordNotTheSameTips() {
322 alert("两次输入的密码不一致") 354 let message = this.i18n.register.tips.e9;
355 this.errorTips.p5 = message;
356 // alert("两次输入的密码不一致")
323 }, 357 },
324 _showRegisterFailure(response) { 358 _showRegisterFailure(response) {
325 if ("COMMON_ERROR_052" == response.returnCode) { 359 if ("COMMON_ERROR_052" == response.returnCode) {
326 this._resetRegisterParam(); 360 this._resetRegisterParam();
327 this.handlerRefreshImageVcode(); 361 this.handlerRefreshImageVcode();
328 alert("验证码过期,请重新申请验证码"); 362 let message = this.i18n.register.tips.e10;
363 // alert("验证码过期,请重新申请验证码");
364 this.showModal(message, "info");
329 } else { 365 } else {
330 this._resetAllParams(); 366 this._resetAllParams();
331 alert("注册失败,请联系工作人员"); 367 let message = this.i18n.register.tips.e11;
368 // alert("注册失败,请联系工作人员");
369 this.showModal(message, "info");
332 } 370 }
333 }, 371 },
334 _resetAllParams() { 372 _resetAllParams() {
...@@ -367,7 +405,10 @@ export default { ...@@ -367,7 +405,10 @@ export default {
367 } 405 }
368 }, 406 },
369 _showSuccessMessage() { 407 _showSuccessMessage() {
370 alert("注册成功") 408 let message = this.i18n.register.tips.e12;
409 this.showModal(message, "succ");
410 this.targetPath = "/login";
411 // alert("注册成功")
371 }, 412 },
372 onForgetHandler() { 413 onForgetHandler() {
373 414
...@@ -380,6 +421,14 @@ export default { ...@@ -380,6 +421,14 @@ export default {
380 let mobileOptions = JSON.parse(JSON.stringify(i18n.register.mobileOptions)); 421 let mobileOptions = JSON.parse(JSON.stringify(i18n.register.mobileOptions));
381 this.mobileOptions = mobileOptions; 422 this.mobileOptions = mobileOptions;
382 this.mobileTip = this.mobileOptions[0]; 423 this.mobileTip = this.mobileOptions[0];
424 },
425 modalCallback() {
426 this.modalVisiable = false;
427 if (this.targetPath) {
428 this.$router.push({
429 "path": this.targetPath
430 });
431 }
383 } 432 }
384 }, 433 },
385 mounted() { }, 434 mounted() { },
...@@ -390,7 +439,26 @@ export default { ...@@ -390,7 +439,26 @@ export default {
390 this.$set(this, 'mobileTip', element); 439 this.$set(this, 'mobileTip', element);
391 } 440 }
392 }) 441 })
393 } 442 },
443 'registerForm.mobileNo': function () {
444 this.errorTips.p1 = "";
445 },
446 'registerForm.opt': function () {
447 this.errorTips.p2 = "";
448 },
449 'registerForm.imageValue': function () {
450 this.errorTips.p3 = "";
451 },
452 'values.password': function () {
453 this.$set(this.errorTips, 'p4', this.checkPassword(this.values.password));
454 },
455 'values.passwordRepeat': function () {
456 if (this.values.password != this.values.passwordRepeat) {
457 this._showPasswordNotTheSameTips();
458 } else {
459 this.errorTips.p5 = "";
460 }
461 },
394 }, 462 },
395 created() { 463 created() {
396 this.initData(); 464 this.initData();
......
1 1
2 <template> 2 <template>
3 <div class="content"> 3 <div class="content">
4 <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
4 <div class="ebg"> 5 <div class="ebg">
5 <img src="@/assets/images/common/login-bg.png"> 6 <img src="@/assets/images/common/login-bg.png">
6 </div> 7 </div>
...@@ -29,6 +30,9 @@ ...@@ -29,6 +30,9 @@
29 <input :placeholder="mobileTip.placeHolder" class="ipt-tel" type="text" v-model="registerForm.mobileNo"> 30 <input :placeholder="mobileTip.placeHolder" class="ipt-tel" type="text" v-model="registerForm.mobileNo">
30 </div> 31 </div>
31 </div> 32 </div>
33 <div class="validator" v-if="errorTips.p1.length > 0 ">
34 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p1}}
35 </div>
32 </div> 36 </div>
33 37
34 <div class="pure-u-1 form-item" v-if="registerCheck.showImageCode"> 38 <div class="pure-u-1 form-item" v-if="registerCheck.showImageCode">
...@@ -38,6 +42,9 @@ ...@@ -38,6 +42,9 @@
38 <img :src="values.imageBase64"> 42 <img :src="values.imageBase64">
39 </div> 43 </div>
40 </div> 44 </div>
45 <div class="validator" v-if="errorTips.p3.length > 0 ">
46 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p3}}
47 </div>
41 </div> 48 </div>
42 <div class="pure-u-1 form-item"> 49 <div class="pure-u-1 form-item">
43 <div class="ipt-wrap"> 50 <div class="ipt-wrap">
...@@ -47,6 +54,9 @@ ...@@ -47,6 +54,9 @@
47 <div v-else class="veri-btn-default">{{times.tip}}</div> 54 <div v-else class="veri-btn-default">{{times.tip}}</div>
48 </div> 55 </div>
49 </div> 56 </div>
57 <div class="validator" v-if="errorTips.p2.length > 0 ">
58 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p2}}
59 </div>
50 </div> 60 </div>
51 </div> 61 </div>
52 62
...@@ -68,6 +78,9 @@ ...@@ -68,6 +78,9 @@
68 <div class="ipt-wrap"> 78 <div class="ipt-wrap">
69 <input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" type="password" v-model="values.password"> 79 <input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" type="password" v-model="values.password">
70 </div> 80 </div>
81 <div class="validator" v-if="errorTips.p4.length > 0 ">
82 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p4}}
83 </div>
71 </div> 84 </div>
72 <div class="pure-u-1 form-item"> 85 <div class="pure-u-1 form-item">
73 <div class="label"> 86 <div class="label">
...@@ -76,6 +89,9 @@ ...@@ -76,6 +89,9 @@
76 <div class="ipt-wrap"> 89 <div class="ipt-wrap">
77 <input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" type="password" v-model="values.passwordRepeat"> 90 <input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" type="password" v-model="values.passwordRepeat">
78 </div> 91 </div>
92 <div class="validator" v-if="errorTips.p5.length > 0 ">
93 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p5}}
94 </div>
79 </div> 95 </div>
80 </div> 96 </div>
81 <div @click="onRegisterHandler()" class="login-submit pointer">{{$t('register.sure')}}</div> 97 <div @click="onRegisterHandler()" class="login-submit pointer">{{$t('register.sure')}}</div>
......