From 948370a81a303b2724adf3db25616bae9a7162a9 Mon Sep 17 00:00:00 2001 From: linju-json Date: Sun, 25 Apr 2021 21:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baseapp.config.js | 2 +- common/extiLogin.js | 25 +++ components/send-sms-code/send-sms-code.vue | 4 +- components/uni-agreements/uni-agreements.vue | 46 +++++ .../uni-quick-login/uni-quick-login.vue | 9 +- js_sdk/request.js | 2 +- pages.json | 35 ++-- .../agree-list.nvue | 0 .../privacy/privacy.html | 0 .../privacy/privacy.vue | 0 .../service/service.html | 0 .../service/service.vue | 0 .../ucenter/edit/bind-mobile/bind-mobile.vue | 2 +- pages/ucenter/edit/edit.vue | 2 +- .../ucenter/login-page/common/login-page.css | 43 +++++ .../login-page/common/login-page.mixin.js | 15 ++ pages/ucenter/login-page/common/loginPage.css | 4 - .../ucenter/login-page/common/loginSuccess.js | 6 +- pages/ucenter/login-page/index/index copy.vue | 153 +++++++++++++++++ pages/ucenter/login-page/index/index.vue | 123 ++++---------- .../login-page/phone-code/phone-code.vue | 123 +++++--------- .../login-page/pwd-login/pwd-login copy.vue | 146 ++++++++++++++++ .../login-page/pwd-login/pwd-login.vue | 158 ++++++------------ .../login-page/pwd-retrieve/pwd-retrieve.vue | 87 +++++----- .../ucenter/login-page/register/register.vue | 32 +--- 25 files changed, 639 insertions(+), 378 deletions(-) create mode 100644 common/extiLogin.js create mode 100644 components/uni-agreements/uni-agreements.vue rename pages/ucenter/{agree-list => ----agree-list}/agree-list.nvue (100%) rename pages/ucenter/{agree-list => ----agree-list}/privacy/privacy.html (100%) rename pages/ucenter/{agree-list => ----agree-list}/privacy/privacy.vue (100%) rename pages/ucenter/{agree-list => ----agree-list}/service/service.html (100%) rename pages/ucenter/{agree-list => ----agree-list}/service/service.vue (100%) create mode 100644 pages/ucenter/login-page/common/login-page.css create mode 100644 pages/ucenter/login-page/common/login-page.mixin.js create mode 100644 pages/ucenter/login-page/index/index copy.vue create mode 100644 pages/ucenter/login-page/pwd-login/pwd-login copy.vue diff --git a/baseapp.config.js b/baseapp.config.js index 706a2744..43d68646 100644 --- a/baseapp.config.js +++ b/baseapp.config.js @@ -18,7 +18,7 @@ module.exports = { "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list", "/pages/ucenter/edit/uploadCutImageToUnicloud" ], - "login": ["univerify", "smsCode", "username", "weixin", "apple"] //默认就是短信验证码登陆 + "login": [ "smsCode","univerify", "username", "weixin", "apple"] //默认就是短信验证码登陆 }, "about": { "appName": "base-app", diff --git a/common/extiLogin.js b/common/extiLogin.js new file mode 100644 index 00000000..17ab4c3d --- /dev/null +++ b/common/extiLogin.js @@ -0,0 +1,25 @@ +export default function(result){ + uni.showToast({ + title: '登陆成功', + icon: 'none' + }); + console.log('登陆成功',result); + uni.setStorageSync('uni_id_uid', result.uid) + uni.setStorageSync('uni_id_token', result.token) + uni.setStorageSync('uni_id_token_expired', result.tokenExpired) + //delete result.userInfo.token + // this.setUserInfo(result.userInfo) + + var delta = 0//判断需要返回几层 + let pages = getCurrentPages(); + // console.log(pages); + pages.forEach((page,index)=>{ + // console.log(pages[pages.length-index-1].route.split('/')[2]); + pages[pages.length-index-1].route.split('/') + if(pages[pages.length-index-1].route.split('/')[2] == 'login-page'){ + delta ++ + } + }) + // console.log('判断需要返回几层',delta); + uni.navigateBack({delta}) +} \ No newline at end of file diff --git a/components/send-sms-code/send-sms-code.vue b/components/send-sms-code/send-sms-code.vue index 9c56d173..41947e35 100644 --- a/components/send-sms-code/send-sms-code.vue +++ b/components/send-sms-code/send-sms-code.vue @@ -79,8 +79,8 @@ { "mobile": this.phone, "type": this.codeType - },(data,result)=>{ - console.log(data,result); + },result=>{ + console.log(result); uni.showToast({ title: "短信验证码发送成功", icon: 'none' diff --git a/components/uni-agreements/uni-agreements.vue b/components/uni-agreements/uni-agreements.vue new file mode 100644 index 00000000..200f1f5f --- /dev/null +++ b/components/uni-agreements/uni-agreements.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/components/uni-quick-login/uni-quick-login.vue b/components/uni-quick-login/uni-quick-login.vue index 077a8df4..aa2c7904 100644 --- a/components/uni-quick-login/uni-quick-login.vue +++ b/components/uni-quick-login/uni-quick-login.vue @@ -120,7 +120,7 @@ }), getRoute(n = 0) { let pages = getCurrentPages(); - console.log('route-pages-length', pages.length); + // console.log('route-pages-length', pages.length); if (n > pages.length) { return '' } @@ -211,7 +211,7 @@ }, quickLogin(params, type) { //联网验证登陆 console.log(params, type); - this.request('user-center/login_by_' + type, params, (data, result) => { + this.request('user-center/login_by_' + type, params, result => { console.log(result); if (result.code === 0) { if (type == 'univerify') { @@ -251,7 +251,10 @@ .quick-login-box { flex-direction: row; width: 750rpx; - justify-content: space-around; + justify-content: space-around; + position: fixed; + bottom: 10rpx; + left: 0; } .item { diff --git a/js_sdk/request.js b/js_sdk/request.js index ffadc8ff..06e79c1e 100644 --- a/js_sdk/request.js +++ b/js_sdk/request.js @@ -23,7 +23,7 @@ export default function request(name,params,callback=false,{showLoading=false,lo const {result:{data,code}} = e console.log(data,code); resolve(e) - return callback(data,e.result,e) + return callback(e.result,e) }, fail(err){ reject(err) diff --git a/pages.json b/pages.json index f4098a88..cc705931 100644 --- a/pages.json +++ b/pages.json @@ -100,25 +100,26 @@ // #endif } - }, { - "path": "pages/ucenter/agree-list/agree-list", - "style": { - "navigationBarTitleText": "政策与协议" - } - - }, { - "path": "pages/ucenter/agree-list/privacy/privacy", - "style": { - "navigationBarTitleText": "隐私政策" - } + }, + // { + // "path": "pages/ucenter/agree-list/agree-list", + // "style": { + // "navigationBarTitleText": "政策与协议" + // } - }, { - "path": "pages/ucenter/agree-list/service/service", - "style": { - "navigationBarTitleText": "服务协议" - } + // }, { + // "path": "pages/ucenter/agree-list/privacy/privacy", + // "style": { + // "navigationBarTitleText": "隐私政策" + // } - }, { + // }, { + // "path": "pages/ucenter/agree-list/service/service", + // "style": { + // "navigationBarTitleText": "服务协议" + // } + // }, + { "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "style": { "disableScroll": true, diff --git a/pages/ucenter/agree-list/agree-list.nvue b/pages/ucenter/----agree-list/agree-list.nvue similarity index 100% rename from pages/ucenter/agree-list/agree-list.nvue rename to pages/ucenter/----agree-list/agree-list.nvue diff --git a/pages/ucenter/agree-list/privacy/privacy.html b/pages/ucenter/----agree-list/privacy/privacy.html similarity index 100% rename from pages/ucenter/agree-list/privacy/privacy.html rename to pages/ucenter/----agree-list/privacy/privacy.html diff --git a/pages/ucenter/agree-list/privacy/privacy.vue b/pages/ucenter/----agree-list/privacy/privacy.vue similarity index 100% rename from pages/ucenter/agree-list/privacy/privacy.vue rename to pages/ucenter/----agree-list/privacy/privacy.vue diff --git a/pages/ucenter/agree-list/service/service.html b/pages/ucenter/----agree-list/service/service.html similarity index 100% rename from pages/ucenter/agree-list/service/service.html rename to pages/ucenter/----agree-list/service/service.html diff --git a/pages/ucenter/agree-list/service/service.vue b/pages/ucenter/----agree-list/service/service.vue similarity index 100% rename from pages/ucenter/agree-list/service/service.vue rename to pages/ucenter/----agree-list/service/service.vue diff --git a/pages/ucenter/edit/bind-mobile/bind-mobile.vue b/pages/ucenter/edit/bind-mobile/bind-mobile.vue index 0cc472a6..dfcc7a71 100644 --- a/pages/ucenter/edit/bind-mobile/bind-mobile.vue +++ b/pages/ucenter/edit/bind-mobile/bind-mobile.vue @@ -51,7 +51,7 @@ this.request('user-center/bind_mobile_by_sms', { "mobile": this.formData.phone, "code": this.formData.code - }, (data, result) => { + }, result=> { console.log(result); this.setUserInfo({"mobile":result.mobile}) uni.showToast({ diff --git a/pages/ucenter/edit/edit.vue b/pages/ucenter/edit/edit.vue index 5a16f7ee..ecd12b6a 100644 --- a/pages/ucenter/edit/edit.vue +++ b/pages/ucenter/edit/edit.vue @@ -71,7 +71,7 @@ console.log(e.authResult); this.request('user-center/bind_mobile_by_univerify', e.authResult, - (data, result) => + result=> { console.log(result); if(result.code===0){ diff --git a/pages/ucenter/login-page/common/login-page.css b/pages/ucenter/login-page/common/login-page.css new file mode 100644 index 00000000..8b0b1367 --- /dev/null +++ b/pages/ucenter/login-page/common/login-page.css @@ -0,0 +1,43 @@ +.content{ + padding:0 50rpx; + width: 750rpx; + flex: 1; +} +.input-box{ + padding:0 15px; + margin-top: 15px; + background-color: #F8F8F8; + border-radius: 6px; + font-size: 28rpx; +} +.get-code{ + margin: 0; + margin-top:15px; + background-color: #007aff; + color: #FFFFFF; +} +.input-box,.get-code{ + height: 50px; + line-height: 50px; +} +.title{ + text-align: center; + padding-bottom: 5px; +} +.tip{ + color: #666666; + font-size: 26rpx; + margin: 6px 0; +} +.easyinput{ + background-color: #F8F8F8; +} +.send-btn{ + height: 85rpx; + width: 100%; + margin-top:15px; + border-radius: 6rpx; +} +.link{ + color: #04498c; +} \ No newline at end of file diff --git a/pages/ucenter/login-page/common/login-page.mixin.js b/pages/ucenter/login-page/common/login-page.mixin.js new file mode 100644 index 00000000..6b161253 --- /dev/null +++ b/pages/ucenter/login-page/common/login-page.mixin.js @@ -0,0 +1,15 @@ +import {mapMutations} from 'vuex'; +import loginSuccess from './loginSuccess.js'; +let mixin = { + methods:{ + ...mapMutations({ + setUserInfo: 'user/login' + }), + loginSuccess(result){ + loginSuccess(result) + delete result.userInfo.token + this.setUserInfo(result.userInfo) + } + } +} +export default mixin \ No newline at end of file diff --git a/pages/ucenter/login-page/common/loginPage.css b/pages/ucenter/login-page/common/loginPage.css index bf95a2ff..4cb2d43e 100644 --- a/pages/ucenter/login-page/common/loginPage.css +++ b/pages/ucenter/login-page/common/loginPage.css @@ -27,10 +27,6 @@ page { } .content { - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - width: 630rpx; flex-direction: column; } diff --git a/pages/ucenter/login-page/common/loginSuccess.js b/pages/ucenter/login-page/common/loginSuccess.js index f94c54a9..17ab4c3d 100644 --- a/pages/ucenter/login-page/common/loginSuccess.js +++ b/pages/ucenter/login-page/common/loginSuccess.js @@ -12,14 +12,14 @@ export default function(result){ var delta = 0//判断需要返回几层 let pages = getCurrentPages(); - console.log(pages); + // console.log(pages); pages.forEach((page,index)=>{ - console.log(pages[pages.length-index-1].route.split('/')[2]); + // console.log(pages[pages.length-index-1].route.split('/')[2]); pages[pages.length-index-1].route.split('/') if(pages[pages.length-index-1].route.split('/')[2] == 'login-page'){ delta ++ } }) - console.log('判断需要返回几层',delta); + // console.log('判断需要返回几层',delta); uni.navigateBack({delta}) } \ No newline at end of file diff --git a/pages/ucenter/login-page/index/index copy.vue b/pages/ucenter/login-page/index/index copy.vue new file mode 100644 index 00000000..f311ad6f --- /dev/null +++ b/pages/ucenter/login-page/index/index copy.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/pages/ucenter/login-page/index/index.vue b/pages/ucenter/login-page/index/index.vue index 46860591..a80c2710 100644 --- a/pages/ucenter/login-page/index/index.vue +++ b/pages/ucenter/login-page/index/index.vue @@ -1,66 +1,40 @@ - diff --git a/pages/ucenter/login-page/phone-code/phone-code.vue b/pages/ucenter/login-page/phone-code/phone-code.vue index 9a65636d..c38e21ba 100644 --- a/pages/ucenter/login-page/phone-code/phone-code.vue +++ b/pages/ucenter/login-page/phone-code/phone-code.vue @@ -1,108 +1,61 @@ - - - diff --git a/pages/ucenter/login-page/pwd-login/pwd-login copy.vue b/pages/ucenter/login-page/pwd-login/pwd-login copy.vue new file mode 100644 index 00000000..1b766952 --- /dev/null +++ b/pages/ucenter/login-page/pwd-login/pwd-login copy.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/pages/ucenter/login-page/pwd-login/pwd-login.vue b/pages/ucenter/login-page/pwd-login/pwd-login.vue index 1b766952..3cf7958d 100644 --- a/pages/ucenter/login-page/pwd-login/pwd-login.vue +++ b/pages/ucenter/login-page/pwd-login/pwd-login.vue @@ -1,120 +1,71 @@ -