From bdbdacc1f30fa1aa1a59b5142fb31e750763e21a Mon Sep 17 00:00:00 2001 From: linju-json Date: Wed, 21 Apr 2021 17:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=BA=86=E6=97=A0=E8=81=8A=E7=9A=84this.loginSuccess()=20=20?= =?UTF-8?q?=E5=92=8C=E6=B3=A8=E5=86=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增了合并了无聊的this.loginSuccess() 和注册功能 --- common/appInit.js | 67 ------------ pages.json | 8 +- template.h5.html | 18 ++-- .../uni-login-page/common/loginPage.css | 4 +- .../uni-login-page/common/loginPage.mixin.js | 22 +++- .../uni-quick-login/uni-quick-login.vue | 20 +--- .../js_sdk/validator/uni-id-users.js | 102 ------------------ .../pages/phone-code/phone-code.vue | 14 +-- .../pages/pwd-login/pwd-login.vue | 35 +++--- .../pages/register/register.vue | 57 ++++------ .../pages/register/validator.js | 61 +++++++++++ .../cloudfunctions/user-center/index.js | 17 ++- 12 files changed, 150 insertions(+), 275 deletions(-) delete mode 100644 uni_modules/uni-login-page/js_sdk/validator/uni-id-users.js create mode 100644 uni_modules/uni-login-page/pages/register/validator.js diff --git a/common/appInit.js b/common/appInit.js index e4c8d06..4ab33a6 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -4,31 +4,12 @@ import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version'; // #endif export default function() { - // 初始化appVersion(仅app生效) initAppVersion(); //自定义路由拦截 const {"router":{needLogin,login}} = baseappConfig //需要登陆的页面 - - // changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], { - // before_action: e => { - // let token = uni.getStorageSync('uni-id-token') - // let url = e.url.split('?')[0] - // if (needLogin.includes(url) && token == '') { - // console.log('该页面需要登陆,即将跳转到login页面'); - // uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'}) - // uni.navigateTo({ - // url:"/uni_modules/uni-login-page/pages/index/index" - // }) - // return false - // } - // return true - // } - // }) - //uni.addInterceptor的写法 - let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]; list.forEach(item=>{ uni.addInterceptor(item,{ @@ -76,35 +57,14 @@ export default function() { })// 移除拦截器API removeInterceptor('request') }) - //提示网络变化 eventListenerNetwork() - - /* 当某个权限调用失败 1.先检测手机的该模块是否打开 2.检测当前应用是否被授权了该模块对应的权限 提示,并点击跳转到设置 */ - // #ifndef H5 - // changeAction('chooseImage', { - // after_action: e => { - // console.log('changeAction', e); - // if(e.errCode === 11){ - // uni.showModal({ - // content: '无权限', - // confirmText:"前往设置", - // success(e) { - // if(e.confirm){ - // permision.gotoAppPermissionSetting() - // } - // } - // }); - // } - // } - // }) - // #endif } /** * // 初始化appVersion @@ -166,31 +126,4 @@ function eventListenerNetwork () { }); } }); -} - - -function changeAction(actions, {before_action,after_action}) { - if(typeof actions == 'string'){ - actions = [actions] - } - if (!before_action) { - before_action = () => true - } - actions.forEach(action=>{ - let old_action = uni[action] - uni[action] = e => { - if (before_action(e)) { - // console.log(after_action); - if (after_action) { - var compose = function(f, g) { - return function(x) { - return f(x,g(x)); - }; - }; - e.complete = compose(e.complete,after_action) - } - old_action(e) - } - } - }) } \ No newline at end of file diff --git a/pages.json b/pages.json index 79777c7..0ee9a94 100644 --- a/pages.json +++ b/pages.json @@ -211,11 +211,7 @@ "condition": { "list": [ { - "path": "pages/list/list", - "style": { - "navigationStyle": "custom", - "enablePullDownRefresh": true - } + "path": "pages/list/list" }, { "path": "uni_modules/uni-login-page/pages/index/index" @@ -227,7 +223,7 @@ "path":"pages/ucenter/settings/settings" } ], - "current":0 + "current":1 }, "tabBar": { "color": "#7A7E83", diff --git a/template.h5.html b/template.h5.html index a9de5db..49ab5da 100644 --- a/template.h5.html +++ b/template.h5.html @@ -36,13 +36,13 @@ // document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px' // }) - setTimeout(()=>{ - document.querySelector('#gg').addEventListener('click',e=>{ - console.log(e); - alert(12) - window.location.href = "https://m3w.cn/uniapp" - }) - },1000) + // setTimeout(()=>{ + // document.querySelector('#gg').addEventListener('click',e=>{ + // console.log(e); + // alert(12) + // window.location.href = "https://m3w.cn/uniapp" + // }) + // },1000) @@ -54,8 +54,8 @@ -
下载app
+
@@ -142,5 +137,9 @@ } .login-text-sub { color: #8a8f8b; + } + .toRegister{ + margin-top: 80px; + width: 600rpx; } diff --git a/uni_modules/uni-login-page/pages/register/register.vue b/uni_modules/uni-login-page/pages/register/register.vue index 5802955..4adc869 100644 --- a/uni_modules/uni-login-page/pages/register/register.vue +++ b/uni_modules/uni-login-page/pages/register/register.vue @@ -1,17 +1,17 @@ -