提交 f3fed494 编写于 作者: 芊里

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

......@@ -20,28 +20,26 @@
}, {
"path": "uni_modules/uni-login-page/pages/index/index",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
// "backgroundColor": "transparent",
"backgroundColor": "transparent",
"app-plus": {
"animationType": "fade-in",
"background": "transparent",
"popGesture": "none",
"titleNView":false
// "navigationBarTitleText": "",
// "navigationBarBackgroundColor": "#FFFFFF",
// "app-plus": {
// "titleNView": {
// "buttons": [{
// "text": "帮助",
// "type": "none",
// "fontSize": "16px",
// "width": "60px"
// }]
// }
"background": "transparent",
"popGesture": "none"
}
}
// "navigationBarTitleText": "",
// "navigationBarBackgroundColor": "#FFFFFF",
// "app-plus": {
// "titleNView": {
// "buttons": [{
// "text": "帮助",
// "type": "none",
// "fontSize": "16px",
// "width": "60px"
// }]
// }
}, {
"path": "pages/search/search",
"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>
<view class="wrap" :class="{'hidden':!isShow}">
<uni-nav-bar left-icon="back" right-text="帮助" :statusBar="true" :border="false"></uni-nav-bar>
<view v-if="isShow" class="wrap-content">
<view class="wrap" v-show="isShow">
<uni-nav-bar @clickLeft="back" left-icon="back" right-text="帮助" :statusBar="true" :border="false"></uni-nav-bar>
<view class="wrap-content">
<view class="content">
<!-- 顶部文字 -->
<text class="content-top-title">登陆后即可展示自己</text>
......@@ -34,7 +34,7 @@
</view>
<!-- 登录按钮弹窗 -->
<login-action-sheet ref="loginActionSheet"></login-action-sheet>
<uni-quick-login @univerifyEnd="isShow = 1"></uni-quick-login>
<uni-quick-login></uni-quick-login>
</view>
</template>
......@@ -42,7 +42,7 @@
export default {
data() {
return {
isShow:true,
isShow:false,
link: [{
text: '用户协议',
to: '/baidu.com'
......@@ -54,6 +54,11 @@
currenPhoneArea: '+86',
phoneNumber: ''
}
},
onReady() {
setTimeout(()=>{
this.isShow = true
},1500);
},
computed: {
canGetShortMsg() {
......@@ -81,17 +86,76 @@
},
openLoginList() {
this.$refs.loginActionSheet.open();
},
back(){
uni.navigateBack()
}
}
}
</script>
<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");
>>>>>>> 4102167b2d3d22ebf4994a07a5b8421d8539345c
.content-top-title{
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{
>>>>>>> 4102167b2d3d22ebf4994a07a5b8421d8539345c
justify-content: center;
}
</style>
\ No newline at end of file
<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)">
<image class="logo" :src="logo" mode="widthFix"></image>
<text class="login-title">{{text}}</text>
......@@ -11,7 +11,6 @@
export default {
data() {
return {
isShow:false,
config: {
"weixin": {
"text": "微信登陆",
......@@ -78,8 +77,6 @@
console.log(err);
if(err.errCode===30002){
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.
先完成此消息的编辑!
想要评论请 注册