|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres1"></image> |
|
|
|
<image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres"></image> |
|
|
|
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> --> |
|
|
|
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> --> |
|
|
|
<view class="width94">{{code}}</view> |
|
|
|
<!-- <view class="width94">{{code}}</view> --> |
|
|
|
<UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope"> |
|
|
|
<UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope"> |
|
|
|
授权手机号 |
|
|
|
授权手机号 |
|
|
|
</UPButton> |
|
|
|
</UPButton> |
|
|
@ -24,7 +24,8 @@ |
|
|
|
const app = getApp(); |
|
|
|
const app = getApp(); |
|
|
|
import { |
|
|
|
import { |
|
|
|
getUserInfo, |
|
|
|
getUserInfo, |
|
|
|
GetPhoneNumber |
|
|
|
GetPhoneNumber, |
|
|
|
|
|
|
|
unionPhoneLogin |
|
|
|
} from "../../Utils/Api.js" |
|
|
|
} from "../../Utils/Api.js" |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'App', |
|
|
|
name: 'App', |
|
|
@ -33,7 +34,7 @@ |
|
|
|
user: '', |
|
|
|
user: '', |
|
|
|
scope: "scope.mobile,scope.auth", |
|
|
|
scope: "scope.mobile,scope.auth", |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imgadres: 'login.png', |
|
|
|
imgadres: 'loginunion.png', |
|
|
|
imgadres1: 'loginphone.png', |
|
|
|
imgadres1: 'loginphone.png', |
|
|
|
resinfo: '', |
|
|
|
resinfo: '', |
|
|
|
scope: "scope.mobile", |
|
|
|
scope: "scope.mobile", |
|
|
@ -45,7 +46,10 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
btnClick(result) { |
|
|
|
btnClick(result) { |
|
|
|
this.code = result.code; |
|
|
|
this.code = result.code; |
|
|
|
|
|
|
|
if(result.code){ |
|
|
|
|
|
|
|
this.unionPhoneLogin(result.code) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getuserinfo() { |
|
|
|
getuserinfo() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
@ -107,21 +111,19 @@ |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
// 微信获取手机号 |
|
|
|
// 微信获取手机号 |
|
|
|
getPhoneNumber(PhoneNumber) { |
|
|
|
unionPhoneLogin(item) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
openId: app.globalData.openId, |
|
|
|
code: item |
|
|
|
iv: PhoneNumber.detail.iv, |
|
|
|
|
|
|
|
encryptedData: PhoneNumber.detail.encryptedData |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
GetPhoneNumber(params).then(res => { |
|
|
|
unionPhoneLogin(params).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '授权成功', |
|
|
|
title: '授权成功', |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
uni.navigateBack({}) |
|
|
|
this.user = res.return_data.object.highUser; |
|
|
|
this.user = res.return_data.object.highUser; |
|
|
|
app.globalData.token = res.return_data.uniqueCode; |
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
.object |
|
|
|
.object |
|
|
|
.highUser; |
|
|
|
.highUser; |
|
|
@ -130,7 +132,12 @@ |
|
|
|
data: res.return_data |
|
|
|
data: res.return_data |
|
|
|
.object |
|
|
|
.object |
|
|
|
.highUser |
|
|
|
.highUser |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
uni.setStorage({ |
|
|
|
|
|
|
|
key: "token", |
|
|
|
|
|
|
|
data: res.return_data.uniqueCode |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
uni.navigateBack({}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|