|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view>
|
|
<view>
|
|
|
<en-nav @navHeight="setNavHeight" ></en-nav>
|
|
<en-nav @navHeight="setNavHeight" ></en-nav>
|
|
|
- <view class="login-box" v-show="false" :style="{'height':'calc(100vh - '+navHeight+'px)'}">
|
|
|
|
|
|
|
+ <view class="login-box" v-show="isWap" :style="{'height':'calc(100vh - '+navHeight+'px)'}">
|
|
|
<view class="login-top">
|
|
<view class="login-top">
|
|
|
<view class="login-title">
|
|
<view class="login-title">
|
|
|
<text class="title-item sys-color-black sys-weight-600">登录/注册</text>
|
|
<text class="title-item sys-color-black sys-weight-600">登录/注册</text>
|
|
@@ -9,7 +9,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="local-txt sys-color-gray-9">本机号码登录</view>
|
|
<view class="local-txt sys-color-gray-9">本机号码登录</view>
|
|
|
<view class="local-phone sys-color-black sys-weight-400">188****4188</view>
|
|
<view class="local-phone sys-color-black sys-weight-400">188****4188</view>
|
|
|
- <view class="login-but sys-color-white sys-background-black" >一键登录</view>
|
|
|
|
|
|
|
+ <view class="login-but sys-color-white sys-background-black" @click="oneClickLogin('13900139001')">一键登录</view>
|
|
|
<view @click="goToOther" class="other-phone sys-color-gray-6">其他手机号登录</view>
|
|
<view @click="goToOther" class="other-phone sys-color-gray-6">其他手机号登录</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="login-bottom">
|
|
<view class="login-bottom">
|
|
@@ -31,14 +31,24 @@ export default {
|
|
|
components: {OtherLogin, LoginAgreement, EnNav},
|
|
components: {OtherLogin, LoginAgreement, EnNav},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- navHeight:40
|
|
|
|
|
|
|
+ navHeight:40,
|
|
|
|
|
+ isWap:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(query) {
|
|
onLoad(query) {
|
|
|
- this.getPhoneNum()
|
|
|
|
|
|
|
+ //#ifdef APP-NVUE
|
|
|
|
|
+ this.getPhoneNum()
|
|
|
|
|
+ //#endif
|
|
|
|
|
+
|
|
|
|
|
+ //#ifndef APP-NVUE
|
|
|
|
|
+ this.isWap=true
|
|
|
|
|
+ //#endif
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getPhoneNum(){
|
|
getPhoneNum(){
|
|
|
|
|
+ //#ifdef APP-NVUE
|
|
|
let that=this
|
|
let that=this
|
|
|
uni.login({
|
|
uni.login({
|
|
|
provider: 'univerify',
|
|
provider: 'univerify',
|
|
@@ -104,29 +114,11 @@ export default {
|
|
|
that.goToOther()
|
|
that.goToOther()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+ //#endif
|
|
|
},
|
|
},
|
|
|
cloudGetPhoneNum(authResult){
|
|
cloudGetPhoneNum(authResult){
|
|
|
console.log('-------------')
|
|
console.log('-------------')
|
|
|
- tools.showLoading()
|
|
|
|
|
- // uniCloud.getPhoneNumber({
|
|
|
|
|
- // provider: 'univerify',
|
|
|
|
|
- // appid: '__UNI__1B420CB', // 客户端callFunction时携带的AppId信息
|
|
|
|
|
- // apiKey: 'f904a759f52a6981744ed39813894cfc', // 在开发者中心开通服务并获取apiKey
|
|
|
|
|
- // apiSecret: 'ae475f1ed69608e527047f83c380303a', // 在开发者中心开通服务并获取apiSecret
|
|
|
|
|
- // access_token: authResult.access_token,
|
|
|
|
|
- // openid: authResult.openid
|
|
|
|
|
- // }).then(res => {
|
|
|
|
|
- // tools.hideLoading()
|
|
|
|
|
- // console.log(res)
|
|
|
|
|
- // }).catch(err=>{
|
|
|
|
|
- // tools.hideLoading()
|
|
|
|
|
- // tools.error('手机号码获取失败')
|
|
|
|
|
- // console.log(err)
|
|
|
|
|
- // setTimeout(()=>{
|
|
|
|
|
- // // this.goToOther()
|
|
|
|
|
- // },1500)
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ //#ifdef APP-NVUE
|
|
|
uniCloud.callFunction({
|
|
uniCloud.callFunction({
|
|
|
name: 'getPhoneNumber', // 你的云函数名称
|
|
name: 'getPhoneNumber', // 你的云函数名称
|
|
|
data: {
|
|
data: {
|
|
@@ -134,7 +126,6 @@ export default {
|
|
|
'openid': authResult.openid
|
|
'openid': authResult.openid
|
|
|
}
|
|
}
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
- tools.hideLoading()
|
|
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
if(res.result.data.phoneNumber!==undefined){
|
|
if(res.result.data.phoneNumber!==undefined){
|
|
|
uni.setStorageSync('mobile', res.result.data.phoneNumber)
|
|
uni.setStorageSync('mobile', res.result.data.phoneNumber)
|
|
@@ -153,6 +144,7 @@ export default {
|
|
|
this.goToOther()
|
|
this.goToOther()
|
|
|
},1500)
|
|
},1500)
|
|
|
})
|
|
})
|
|
|
|
|
+ //#endif
|
|
|
},
|
|
},
|
|
|
oneClickLogin(mobile){
|
|
oneClickLogin(mobile){
|
|
|
login({'mobile':mobile}).then((res)=>{
|
|
login({'mobile':mobile}).then((res)=>{
|
|
@@ -160,8 +152,11 @@ export default {
|
|
|
if(res.code===0){
|
|
if(res.code===0){
|
|
|
tools.setLoginData(res.data)
|
|
tools.setLoginData(res.data)
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
- uni.switchTab({
|
|
|
|
|
- 'url':'/pages/index/index'
|
|
|
|
|
|
|
+ // uni.switchTab({
|
|
|
|
|
+ // 'url':'/pages/index/index'
|
|
|
|
|
+ // })
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ 'url':'/pages/perfect/sexAndAge'
|
|
|
})
|
|
})
|
|
|
},1500)
|
|
},1500)
|
|
|
}else{
|
|
}else{
|