提交 f3fed494 编写于 作者: 芊里

Merge branch 'master' of https://gitee.com/dcloud/base-app

...@@ -20,15 +20,14 @@ ...@@ -20,15 +20,14 @@
}, { }, {
"path": "uni_modules/uni-login-page/pages/index/index", "path": "uni_modules/uni-login-page/pages/index/index",
"style": { "style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom", "navigationStyle": "custom",
// "backgroundColor": "transparent", "backgroundColor": "transparent",
"app-plus": { "app-plus": {
"animationType": "fade-in", "animationType": "fade-in",
"background": "transparent", "background": "transparent",
"popGesture": "none", "popGesture": "none"
"titleNView":false }
}
// "navigationBarTitleText": "", // "navigationBarTitleText": "",
// "navigationBarBackgroundColor": "#FFFFFF", // "navigationBarBackgroundColor": "#FFFFFF",
// "app-plus": { // "app-plus": {
...@@ -40,8 +39,7 @@ ...@@ -40,8 +39,7 @@
// "width": "60px" // "width": "60px"
// }] // }]
// } // }
}
}
}, { }, {
"path": "pages/search/search", "path": "pages/search/search",
"style": { "style": {
......
<template>
<view class="content">
<view class="quick-login-box">
<view class="item" v-for="({text,logo,name},index) in providerList" :key="index" @click="login(name)">
<image class="logo" :src="logo" mode="widthFix"></image>
<text class="login-title">{{text}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
config: {
"weixin": {
"text": "微信登陆",
"logo": "../../static/login/img/weixin.png"
},
"qq": {
"text": "QQ登陆",
"logo": "../../static/login/img/qq.png"
},
"apple": {
"text": "苹果登陆",
"logo": "../../static/login/img/apple.png"
},
"sinaweibo": {
"text": "微博登录",
"logo": "../../static/login/img/sinaweibo.png"
},
"univerify": {
"text": "一键登陆",
"logo": "../../static/login/img/univerify.png"
}
},
providerList: [],
univerifyStyle: {
"fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
}
}
},
onLoad() {
uni.getProvider({
"service": "oauth",
success: res => {
this.providerList = res.provider.map((name) => {
return {...this.config[name],name}
})
},
fail: (err) => {
console.error('获取服务供应商失败:' + JSON.stringify(err));
}
})
},
methods: {
login(type) {
uni.login({
"provider": type,
"univerifyStyle":this.univerifyStyle,
success: e => {
console.log(e);
this.quickLogin(e.authResult,type)
},
fail: (err) => {
console.log(err);
if(err.errCode===30002){
}
}
});
},
quickLogin(authResult,type){
//请勿直接使用authResult中的unionid或openid直接用于登陆,前端的数据都是不可靠的
console.log({...authResult,type});
uniCloud.callFunction({//联网验证登陆
"name": "user",
"data": {
"action": "quickLogin",
"params": {...authResult,type}
},
success: (e) => {
console.log(e.result);
uni.showModal({
content: JSON.stringify(e.result),
showCancel: false
});
if(type=='univerify'){
uni.closeAuthView()
}
},
fail: (err) => {
console.log(err);
if(err.errCode===30002){
}
}
})
}
}
}
</script>
<style scoped>
.quick-login-box {
flex-direction: row;
width: 750rpx;
justify-content: space-around;
}
.item {
flex-direction: column;
justify-content: center;
align-items: center;
height: 200rpx;
}
.logo {
width: 60rpx;
height: 60rpx;
}
.login-title {
font-size: 26rpx;
}
</style>
\ No newline at end of file
<template> <template>
<view class="wrap" :class="{'hidden':!isShow}"> <view class="wrap" v-show="isShow">
<uni-nav-bar left-icon="back" right-text="帮助" :statusBar="true" :border="false"></uni-nav-bar> <uni-nav-bar @clickLeft="back" left-icon="back" right-text="帮助" :statusBar="true" :border="false"></uni-nav-bar>
<view v-if="isShow" class="wrap-content"> <view class="wrap-content">
<view class="content"> <view class="content">
<!-- 顶部文字 --> <!-- 顶部文字 -->
<text class="content-top-title">登陆后即可展示自己</text> <text class="content-top-title">登陆后即可展示自己</text>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</view> </view>
<!-- 登录按钮弹窗 --> <!-- 登录按钮弹窗 -->
<login-action-sheet ref="loginActionSheet"></login-action-sheet> <login-action-sheet ref="loginActionSheet"></login-action-sheet>
<uni-quick-login @univerifyEnd="isShow = 1"></uni-quick-login> <uni-quick-login></uni-quick-login>
</view> </view>
</template> </template>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
export default { export default {
data() { data() {
return { return {
isShow:true, isShow:false,
link: [{ link: [{
text: '用户协议', text: '用户协议',
to: '/baidu.com' to: '/baidu.com'
...@@ -55,6 +55,11 @@ ...@@ -55,6 +55,11 @@
phoneNumber: '' phoneNumber: ''
} }
}, },
onReady() {
setTimeout(()=>{
this.isShow = true
},1500);
},
computed: { computed: {
canGetShortMsg() { canGetShortMsg() {
let reg = /^1\d{10}$/; let reg = /^1\d{10}$/;
...@@ -81,17 +86,76 @@ ...@@ -81,17 +86,76 @@
}, },
openLoginList() { openLoginList() {
this.$refs.loginActionSheet.open(); this.$refs.loginActionSheet.open();
},
back(){
uni.navigateBack()
} }
} }
} }
</script> </script>
<style> <style>
<<<<<<< HEAD
page {
background: transparent;
}
/* #ifndef APP-NVUE */
page{
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
/* #endif */
.wrap{
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex:1;
width: 750rpx;
background-color: #fff;
}
.wrap-content{
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.content{
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 630rpx;
flex-direction: column;
}
=======
@import url("../../common/loginPage.css"); @import url("../../common/loginPage.css");
>>>>>>> 4102167b2d3d22ebf4994a07a5b8421d8539345c
.content-top-title{ .content-top-title{
text-align: center; text-align: center;
} }
<<<<<<< HEAD
@import url("../../common/myStyle.css");
.lgnin-iknow {
padding-top: 24rpx;
padding-bottom: 48rpx;
}
.phone-input-box {
height: 85rpx;
background-color: #f9f9f9;
border-radius: 6rpx;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
=======
.login-iknow{ .login-iknow{
>>>>>>> 4102167b2d3d22ebf4994a07a5b8421d8539345c
justify-content: center; justify-content: center;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view class="quick-login-box" v-if="isShow"> <view class="quick-login-box">
<view class="item" v-for="({text,logo,name},index) in providerList" :key="index" @click="login(name)"> <view class="item" v-for="({text,logo,name},index) in providerList" :key="index" @click="login(name)">
<image class="logo" :src="logo" mode="widthFix"></image> <image class="logo" :src="logo" mode="widthFix"></image>
<text class="login-title">{{text}}</text> <text class="login-title">{{text}}</text>
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
export default { export default {
data() { data() {
return { return {
isShow:false,
config: { config: {
"weixin": { "weixin": {
"text": "微信登陆", "text": "微信登陆",
...@@ -78,8 +77,6 @@ ...@@ -78,8 +77,6 @@
console.log(err); console.log(err);
if(err.errCode===30002){ if(err.errCode===30002){
console.log('你手动关闭了,一键登陆'); console.log('你手动关闭了,一键登陆');
this.isShow = 1
this.$emit('univerifyEnd')
} }
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册