提交 57405b69 编写于 作者: L linju

123

上级 a3d70aad
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
console.log(e); console.log(e);
} }
}); });
uni.preloadPage({
url: "uni_modules/uni-login-page/pages/index/index",
complete:e=>{
console.log(e);
}
});
// #ifdef APP-PLUS // #ifdef APP-PLUS
//预加载一键登录 //预加载一键登录
plus.oauth.getServices(oauthServices=>{ plus.oauth.getServices(oauthServices=>{
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"needLogin":[ "needLogin":[
"/pages/ucenter/edit/edit", "/pages/ucenter/edit/edit",
"/uni_modules/uni-login-page/pages/index/pwd-retrieve" "/uni_modules/uni-login-page/pages/index/pwd-retrieve"
] ],
"login":["univerify","password","weixin","apple","code"]
}, },
"about":{ "about":{
"appName":"base-app", "appName":"base-app",
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
"title":"隐私政策", "title":"隐私政策",
"url":"https://uniapp.dcloud.io/" "url":"https://uniapp.dcloud.io/"
} }
] ],
"下载地址":""
} }
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ export default function() { ...@@ -9,7 +9,7 @@ export default function() {
initAppVersion(); initAppVersion();
//自定义路由拦截 //自定义路由拦截
const {"router":{needLogin}} = baseappConfig //需要登陆的页面 const {"router":{needLogin,login}} = baseappConfig //需要登陆的页面
// changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], { // changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], {
// before_action: e => { // before_action: e => {
...@@ -33,9 +33,11 @@ export default function() { ...@@ -33,9 +33,11 @@ export default function() {
list.forEach(item=>{ list.forEach(item=>{
uni.addInterceptor(item,{ uni.addInterceptor(item,{
invoke(e){// 调用前拦截 invoke(e){// 调用前拦截
//console.log(e); console.log(e);
let token = uni.getStorageSync('uni-id-token') const token = uni.getStorageSync('uni_id_token')
let url = e.url.split('?')[0] console.log(token);
const url = e.url.split('?')[0]
//拦截强制登陆页面
if (needLogin.includes(url) && token == '') { if (needLogin.includes(url) && token == '') {
console.log('该页面需要登陆,即将跳转到login页面'); console.log('该页面需要登陆,即将跳转到login页面');
uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'}) uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'})
...@@ -44,9 +46,34 @@ export default function() { ...@@ -44,9 +46,34 @@ export default function() {
}) })
return false return false
} }
//控制登陆优先级
if(url=='/uni_modules/uni-login-page/pages/index/index'){
//一键登录(univerify)、密码登陆(password)、快捷登录&验证码登陆(!univerify&password)
if(login[0]=='univerify'){
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"
}else{
//默认即是
}
}
return true return true
},
success(){ // 成功回调拦截
},
fail(){ // 失败回调拦截
},
complete(e){ // 完成回调拦截
console.log(e);
},
returnValue(){// 返回结果拦截
} }
}) })// 移除拦截器API removeInterceptor('request')
}) })
......
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
"appid" : "wxffdd8fa6ec4ef2a0", "appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "", "appsecret" : "",
"UniversalLinks" : "" "UniversalLinks" : ""
} },
"apple" : {}
}, },
"ad" : {}, "ad" : {},
"share" : { "share" : {
...@@ -71,7 +72,8 @@ ...@@ -71,7 +72,8 @@
"unipush" : {} "unipush" : {}
} }
} }
} },
"nvueLaunchMode" : ""
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp" : {},
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"animationType": "none", "animationType": "none",
"popGesture": "none" "popGesture": "none",
"navigationStyle": "custom",
"backgroundColor": "transparent"
// "titleNView": { // "titleNView": {
// "buttons": [{ // "buttons": [{
// "text": "帮助", // "text": "帮助",
...@@ -213,17 +215,20 @@ ...@@ -213,17 +215,20 @@
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
// "condition": { "condition": {
// "list": [ "list": [
// { {
// "path": "uni_modules/uni-login-page/pages/index/index" "path": "uni_modules/uni-login-page/pages/index/index"
// }, },
// { {
// "path": "pages/test/test" "path": "pages/test/test"
// } },
// ], {
// "current":0 "path":"pages/ucenter/settings/settings"
// }, }
],
"current":2
},
"tabBar": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",
"selectedColor": "#007AFF", "selectedColor": "#007AFF",
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
}, },
tapGrid(index) { tapGrid(index) {
uni.showToast({ uni.showToast({
title: '你点击了,第' + index + '', title: '你点击了,第' + (index+1) + '',
icon: 'none' icon: 'none'
}); });
} }
......
...@@ -33,20 +33,13 @@ page { ...@@ -33,20 +33,13 @@ page {
/* #endif */ /* #endif */
width: 630rpx; width: 630rpx;
flex-direction: column; flex-direction: column;
} }
.content-top-title { .content-top-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
padding-top: 50rpx; padding-top: 50rpx;
}
/* #ifndef APP-NVUE */
.hidden,
page {
background-color: transparent;
} }
/* #endif */
.login-iknow { .login-iknow {
padding-top: 24rpx; padding-top: 24rpx;
......
<template> <template>
<view class="wrap"> <view class="wrap">
<!-- <uni-nav-bar left-icon="back" left-text="返回" right-text="菜单" title="导航栏组件"></uni-nav-bar> -->
<view class="wrap-content"> <view class="wrap-content">
<view class="content"> <view class="content">
<!-- 顶部文字 --> <!-- 顶部文字 -->
...@@ -38,8 +39,8 @@ ...@@ -38,8 +39,8 @@
</view> </view>
</template> </template>
<script> <script>
const univerify_first = true var univerify_first,currentWebview;//是否一键登陆优先
import mixin from '../../common/loginPage.mixin.js'; import mixin from '../../common/loginPage.mixin.js';
var currentPage; var currentPage;
export default { export default {
...@@ -48,17 +49,15 @@ const univerify_first = true ...@@ -48,17 +49,15 @@ const univerify_first = true
return { return {
phoneArea: ['+86'], phoneArea: ['+86'],
currenPhoneArea: '+86', currenPhoneArea: '+86',
} }
}, },
onLoad() { onLoad(e) {
univerify_first = e.univerify_first
//#ifdef APP-PLUS //#ifdef APP-PLUS
if(univerify_first){ if(univerify_first){
let pages = getCurrentPages(); const pages = getCurrentPages();
currentPage = pages[pages.length - 1]; currentWebview = pages[pages.length - 1].$getAppWebview();
currentPage.$getAppWebview().setStyle({ currentWebview.hide();
top:"1000px"
})
} }
//#endif //#endif
}, },
...@@ -67,9 +66,13 @@ const univerify_first = true ...@@ -67,9 +66,13 @@ const univerify_first = true
if(univerify_first){ if(univerify_first){
this.$refs.uniQuickLogin.login('univerify') this.$refs.uniQuickLogin.login('univerify')
setTimeout(() => { setTimeout(() => {
currentPage.$getAppWebview().setStyle({ currentWebview.setStyle({
top:"0" titleNView:{
autoBackButton:true,
backgroundColor:"#FFFFFF"
}
}) })
currentWebview.show()
}, 1500); }, 1500);
} }
//#endif //#endif
......
...@@ -384,10 +384,11 @@ ...@@ -384,10 +384,11 @@
left: 0; left: 0;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(0, 0, 0, .65); background-color:rgba(0,0,0,.65);
} }
.botton-radius { .botton-radius {
border-bottom-left-radius: 30rpx; border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx; border-bottom-right-radius: 30rpx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册