diff --git a/pages.json b/pages.json index 0eff7e13..76638528 100644 --- a/pages.json +++ b/pages.json @@ -306,6 +306,13 @@ "enablePullDownRefresh": false, "navigationBarTitleText": "" } + }, + { + "path": "pages/password/password", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "" + } } ], "subPackages": [{ diff --git a/pages/login/login.vue b/pages/login/login.vue index 551b3066..9f7f3049 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -37,6 +37,25 @@ + +
+ + + {{ user.nickname }} + + + + + + + + + + + {{ $t('login.login.483nho') }} + +
+
@@ -71,7 +90,7 @@ - + @@ -461,7 +480,7 @@ // #ifdef APP // 获取app第三方登录通道设置 - this.provider_action() + this.provider_action(); //#endif // 多语言 @@ -537,7 +556,7 @@ reg_email: this.$t('login.login.jc0w0o'), forget: this.$t('login.login.8tmyuc'), success: this.$t('login.login.5p23c6'), - } + }, }); }, @@ -633,9 +652,9 @@ // #ifdef APP // app第三方登录通道隔离 var thirdpartylogin = this.plugins_thirdpartylogin_data || {}; - if(Object.keys(thirdpartylogin).length) { + if (Object.keys(thirdpartylogin).length) { var temp_thirdpartylogin = Object.keys(thirdpartylogin).reduce((pre, cur) => { - if(this.app_login_provider_list.includes(cur)) { + if (this.app_login_provider_list.includes(cur)) { pre[cur] = thirdpartylogin[cur]; } return pre; @@ -788,7 +807,7 @@ } } // 邮箱验证:邮箱登录、邮箱注册 - if (this.current_opt_type == 'login_email' || this.current_opt_type == 'reg_email') { + if (this.current_opt_type == 'login_email' || this.current_opt_type == 'reg_email' || this.current_opt_type == 'bind_email') { if ((this.form_input_email_value || null) == null) { app.globalData.showToast(this.$t('login.login.xak8g1')); return false; @@ -800,7 +819,7 @@ return false; } // 是否开启图片验证码、绑定操作不使用图片验证码 - if (this.current_opt_form != 'bind' && this.current_opt_form != 'bind_verify') { + if (this.current_opt_form != 'bind' && this.current_opt_form != 'bind_verify' && this.current_opt_form != 'bind_email') { if (this.common_img_verify_state == 1) { this.setData({ popup_image_verify_status: true, @@ -816,7 +835,7 @@ // 短信验证码发送处理 verify_send_handle() { // 是否开启图片验证码 - if (this.current_opt_form != 'bind' && this.current_opt_form != 'bind_verify') { + if (this.current_opt_form != 'bind' && this.current_opt_form != 'bind_verify' && this.current_opt_form != 'bind_email') { if (this.common_img_verify_state == 1) { if ((this.form_input_image_verify_value || null) == null || this.form_input_image_verify_value.length < 4) { app.globalData.showToast(this.$t('login.login.7r5h37')); @@ -828,15 +847,26 @@ // 请求数据 var action = ''; var image_verify_type = ''; - if (this.current_opt_form == 'bind' || this.current_opt_form == 'bind_verify') { - action = 'appmobilebindverifysend'; + if (this.current_opt_form == 'bind' || this.current_opt_form == 'bind_email' || this.current_opt_form == 'bind_verify') { image_verify_type = 'user_bind'; - var post_data = { - mobile: this.form_input_mobile_value || '', - }; - if ((post_data.mobile || null) == null) { - app.globalData.showToast(this.$t('login.login.4c5n8o')); - return false; + if (this.current_opt_form == 'bind_email') { + action = 'appemailbindverifysend'; + var post_data = { + email: this.form_input_email_value || '', + }; + if ((post_data.email || null) == null) { + app.globalData.showToast(this.$t('login.login.xak8g1')); + return false; + } + } else if (this.current_opt_form == 'bind_verify') { + action = 'appmobilebindverifysend'; + var post_data = { + mobile: this.form_input_mobile_value || '', + }; + if ((post_data.mobile || null) == null) { + app.globalData.showToast(this.$t('login.login.4c5n8o')); + return false; + } } } else { if (this.current_opt_form == 'login') { @@ -929,9 +959,25 @@ }, }); }, - + formBindMobile(e) { + // 数据验证 + var validation = [ + { fields: 'mobile', msg: this.$t('login.login.4c5n8o') }, + { fields: 'verify', msg: this.$t('login.login.01xmab') }, + ]; + this.formBind(e, validation, app.globalData.get_request_url('appmobilebind', 'user')); + }, // 绑定手机表单提交 - formBind(e) { + formBindEmail(e) { + // 数据验证 + var validation = [ + { fields: 'email', msg: this.$t('login.login.xak8g1') }, + { fields: 'verify', msg: this.$t('login.login.01xmab') }, + ]; + this.formBind(e, validation, app.globalData.get_request_url('appemailbind', 'user')); + }, + // 绑定表单提交 + formBind(e, validation, url) { // 其他数据 var client_type = app.globalData.application_client_type(); var user = this.user || this.plugins_thirdpartylogin_user || app.globalData.get_login_cache_info() || {}; @@ -967,7 +1013,7 @@ // 网络请求 uni.request({ - url: app.globalData.get_request_url('appmobilebind', 'user'), + url: url, method: 'POST', data: e.detail.value, dataType: 'json', @@ -1465,20 +1511,26 @@ // #ifdef APP let self = this; - switch(type) { + switch (type) { // 微信、QQ、谷歌 - case 'weixin' : - case 'qq' : - case 'google' : + case 'weixin': + case 'qq': + case 'google': uni.login({ provider: type, - success: function(res) { + success: function (res) { let auth_result = res.authResult; - self.app_login_bind_handle({...auth_result, ...{ - platform: type, - openid: auth_result.openid, - access_token: auth_result.access_token, - }}, auth_result); + self.app_login_bind_handle( + { + ...auth_result, + ...{ + platform: type, + openid: auth_result.openid, + access_token: auth_result.access_token, + }, + }, + auth_result + ); }, fail: function (error) { app.globalData.showToast(error.errMsg || this.$t('login.login.4835p5')); @@ -1487,16 +1539,22 @@ break; // 苹果 - case 'apple' : + case 'apple': uni.login({ provider: type, - success: function(res) { + success: function (res) { let auth_result = res.appleInfo || res.userInfo; - self.app_login_bind_handle({...auth_result, ...{ - platform: type, - openid: auth_result.openId || auth_result.user, - access_token: auth_result.access_token || '' - }}, auth_result); + self.app_login_bind_handle( + { + ...auth_result, + ...{ + platform: type, + openid: auth_result.openId || auth_result.user, + access_token: auth_result.access_token || '', + }, + }, + auth_result + ); }, fail: function (error) { app.globalData.showToast(error.errMsg || this.$t('login.login.4835p5')); @@ -1504,8 +1562,8 @@ }); break; - default : - app.globalData.showToast(type+this.$t('login.login.li9573')); + default: + app.globalData.showToast(type + this.$t('login.login.li9573')); } // #endif }, @@ -1523,16 +1581,16 @@ success: (res) => { uni.hideLoading(); if (res.data.code == 0) { - var user = {...auth_result, ...res.data.data}; + var user = { ...auth_result, ...res.data.data }; // 设置当前第三方登录用户数据 this.setData({ - plugins_thirdpartylogin_user: user + plugins_thirdpartylogin_user: user, }); // 不需要绑定账号、则成功 if ((user.is_force_bind_user || 0) != 1) { this.setData({ - user: user + user: user, }); // 缓存当前用户数据 @@ -1631,7 +1689,7 @@ popup_login_status: false, }); }, - + // 获取app第三方登录通道 provider_action() { uni.getProvider({ @@ -1641,9 +1699,9 @@ app_login_provider_list: result.provider || [], }); }, - fail: (error) => {} + fail: (error) => {}, }); - } + }, }, }; diff --git a/pages/password/password.css b/pages/password/password.css new file mode 100644 index 00000000..355c87a4 --- /dev/null +++ b/pages/password/password.css @@ -0,0 +1,18 @@ +.password { + height: 100vh; + background: #fff; +} + +.password .form-item { + height: 100rpx; + line-height: 100rpx; + background: #F9F9F9; + border-radius: 50rpx; + border: 0; +} + +.password .form-item ::v-deep .input-placeholder, +.password .form-item ::v-deep .uni-input-input { + padding: 0 36rpx; + font-size: 30rpx; +} \ No newline at end of file diff --git a/pages/password/password.vue b/pages/password/password.vue new file mode 100644 index 00000000..c2cbdab9 --- /dev/null +++ b/pages/password/password.vue @@ -0,0 +1,137 @@ + + + diff --git a/pages/setup/setup.vue b/pages/setup/setup.vue index eec91669..7f8f6fb7 100644 --- a/pages/setup/setup.vue +++ b/pages/setup/setup.vue @@ -14,6 +14,14 @@ {{ $t('setup.setup.x81v6d') }} {{ user.mobile_security || '' }} {{ $t('setup.setup.j6skqh') }} + + 更换密码 + {{ $t('setup.setup.j6skqh') }} + + + 更换邮箱 + {{ user.email_security || '' }} {{ $t('setup.setup.j6skqh') }} + {{ $t('setup.setup.r7jz13') }} {{ language }} @@ -70,9 +78,10 @@ - - - + + + +