From f763279a235f64ca497e43a6178fa58745885655 Mon Sep 17 00:00:00 2001 From: linju <8432241+linjuDcloud@user.noreply.gitee.com> Date: Mon, 19 Apr 2021 21:36:33 +0800 Subject: [PATCH] 23 --- baseapp.config.json => baseapp.config.js | 5 +- common/appInit.js | 64 +-- manifest.json | 6 +- pages.json | 43 +- pages/ucenter/about/about.vue | 2 +- .../{settings.nvue => settings--.nvue} | 22 +- pages/ucenter/settings/settings.vue | 368 ++++++++++-------- store/modules/user.js | 1 + .../uni-list-item/uni-list-item.vue | 2 +- .../uni-login-page/pages/index/index.vue | 82 ++-- .../pages/phone-code/phone-code.vue | 7 +- .../pages/pwd-login/pwd-login.vue | 10 +- .../static/login/img/smsCode.png | Bin 0 -> 5688 bytes .../static/login/img/username.png | Bin 0 -> 7010 bytes .../uni-quick-login/uni-quick-login.vue | 145 ++++--- 15 files changed, 426 insertions(+), 331 deletions(-) rename baseapp.config.json => baseapp.config.js (69%) rename pages/ucenter/settings/{settings.nvue => settings--.nvue} (90%) create mode 100644 uni_modules/uni-login-page/static/login/img/smsCode.png create mode 100644 uni_modules/uni-login-page/static/login/img/username.png diff --git a/baseapp.config.json b/baseapp.config.js similarity index 69% rename from baseapp.config.json rename to baseapp.config.js index 3f9d764..a8b719a 100644 --- a/baseapp.config.json +++ b/baseapp.config.js @@ -1,7 +1,8 @@ -{ +module.exports = { "router":{ - "needLogin":[ + "needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等 "/pages/ucenter/edit/edit", + "/pages/ucenter/settings/settings", "/uni_modules/uni-login-page/pages/index/pwd-retrieve" ], "login":["univerify","password","weixin","apple","code"] diff --git a/common/appInit.js b/common/appInit.js index 9889ad3..4dece03 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -1,12 +1,12 @@ -import baseappConfig from '@/baseapp.config.json'; +import baseappConfig from '@/baseapp.config.js'; // #ifdef APP-PLUS -import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'; +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 - initAppVersion(); +// #endif +export default function() { + + // 初始化appVersion + initAppVersion(); //自定义路由拦截 const {"router":{needLogin,login}} = baseappConfig //需要登陆的页面 @@ -50,11 +50,11 @@ export default function() { if(url=='/uni_modules/uni-login-page/pages/index/index'){ //一键登录(univerify)、密码登陆(password)、快捷登录&验证码登陆(!univerify&password) if(login[0]=='univerify'){ - console.log(e.url,url); + // console.log(e.url,url); if(e.url==url){ e.url+= '?' } e.url += "univerify_first=true" }else if(login[0]=='password'){ - e.url = "/uni_modules/uni-login-page/pages/index/pwd-login" + e.url = "/uni_modules/uni-login-page/pages/pwd-login/pwd-login" }else{ //默认即是 } @@ -64,8 +64,8 @@ export default function() { success(){ // 成功回调拦截 }, - fail(){ // 失败回调拦截 - + fail(err){ // 失败回调拦截 + console.log(err); }, complete(e){ // 完成回调拦截 //console.log(e); @@ -105,22 +105,22 @@ export default function() { // } // }) // #endif -} -/** - * // 初始化appVersion - */ -function initAppVersion() { - // #ifdef APP-PLUS - let appid = plus.runtime.appid; - plus.runtime.getProperty(appid, (wgtInfo) => { +} +/** + * // 初始化appVersion + */ +function initAppVersion() { + // #ifdef APP-PLUS + let appid = plus.runtime.appid; + plus.runtime.getProperty(appid, (wgtInfo) => { let appVersion = plus.runtime; - let currentVersion = appVersion.versionCode > wgtInfo.versionCode ? appVersion : wgtInfo; - getApp({ - allowDefault: true + let currentVersion = appVersion.versionCode > wgtInfo.versionCode ? appVersion : wgtInfo; + getApp({ + allowDefault: true }).appVersion = { - ...currentVersion, - appid, - hasNew:true + ...currentVersion, + appid, + hasNew:true } // 检查更新小红点 callCheckVersion() @@ -131,13 +131,13 @@ function initAppVersion() { allowDefault: true }).appVersion.hasNew = true; } - }) + }) }); // 检查更新 - checkUpdate(); - // #endif -} + checkUpdate(); + // #endif +} // 设备网络状态变化事件 function eventListenerNetwork () { @@ -172,9 +172,9 @@ function eventListenerNetwork () { function changeAction(actions, {before_action,after_action}) { if(typeof actions == 'string'){ actions = [actions] - } - if (!before_action) { - before_action = () => true + } + if (!before_action) { + before_action = () => true } actions.forEach(action=>{ let old_action = uni[action] diff --git a/manifest.json b/manifest.json index f775f81..0af6d83 100644 --- a/manifest.json +++ b/manifest.json @@ -7,9 +7,9 @@ "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { - "compatible": { - "ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 - }, + "compatible" : { + "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 + }, "usingComponents" : true, "nvueStyleCompiler" : "uni-app", "compilerVersion" : 3, diff --git a/pages.json b/pages.json index c871719..cc89f76 100644 --- a/pages.json +++ b/pages.json @@ -23,17 +23,9 @@ "navigationBarTitleText": "", "app-plus": { "animationType": "none", - "popGesture": "none", - "navigationStyle": "custom", - "backgroundColor": "transparent" - // "titleNView": { - // "buttons": [{ - // "text": "帮助", - // "type": "none", - // "fontSize": "16px", - // "width": "60px" - // }] - // } + "popGesture": "none" + // "navigationStyle": "custom", + // "backgroundColor": "transparent", } } }, { @@ -159,7 +151,6 @@ "navigationBarTitleText": "帮助", "enablePullDownRefresh": false } - } ,{ "path" : "pages/test/test", @@ -186,20 +177,20 @@ "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#F8F8F8" }, - // "condition": { - // "list": [ - // { - // "path": "uni_modules/uni-login-page/pages/index/index" - // }, - // { - // "path": "pages/test/test" - // }, - // { - // "path":"pages/ucenter/settings/settings" - // } - // ], - // "current":1 - // }, + "condition": { + "list": [ + { + "path": "uni_modules/uni-login-page/pages/index/index" + }, + { + "path": "pages/test/test" + }, + { + "path":"pages/ucenter/settings/settings" + } + ], + "current":0 + }, "tabBar": { "color": "#7A7E83", "selectedColor": "#007AFF", diff --git a/pages/ucenter/about/about.vue b/pages/ucenter/about/about.vue index 878761b..f0dc826 100644 --- a/pages/ucenter/about/about.vue +++ b/pages/ucenter/about/about.vue @@ -16,7 +16,7 @@