|
|
|
@ -1,8 +1,8 @@ |
|
|
|
|
<template> |
|
|
|
|
<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> --> |
|
|
|
|
<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> |
|
|
|
@ -24,7 +24,8 @@ |
|
|
|
|
const app = getApp(); |
|
|
|
|
import { |
|
|
|
|
getUserInfo, |
|
|
|
|
GetPhoneNumber |
|
|
|
|
GetPhoneNumber, |
|
|
|
|
unionPhoneLogin |
|
|
|
|
} from "../../Utils/Api.js" |
|
|
|
|
export default { |
|
|
|
|
name: 'App', |
|
|
|
@ -33,7 +34,7 @@ |
|
|
|
|
user: '', |
|
|
|
|
scope: "scope.mobile,scope.auth", |
|
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
|
imgadres: 'login.png', |
|
|
|
|
imgadres: 'loginunion.png', |
|
|
|
|
imgadres1: 'loginphone.png', |
|
|
|
|
resinfo: '', |
|
|
|
|
scope: "scope.mobile", |
|
|
|
@ -46,6 +47,9 @@ |
|
|
|
|
methods: { |
|
|
|
|
btnClick(result) { |
|
|
|
|
this.code = result.code; |
|
|
|
|
if(result.code){ |
|
|
|
|
this.unionPhoneLogin(result.code) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getuserinfo() { |
|
|
|
|
let that = this; |
|
|
|
@ -107,21 +111,19 @@ |
|
|
|
|
// }) |
|
|
|
|
// }, |
|
|
|
|
// 微信获取手机号 |
|
|
|
|
getPhoneNumber(PhoneNumber) { |
|
|
|
|
unionPhoneLogin(item) { |
|
|
|
|
let params = { |
|
|
|
|
openId: app.globalData.openId, |
|
|
|
|
iv: PhoneNumber.detail.iv, |
|
|
|
|
encryptedData: PhoneNumber.detail.encryptedData |
|
|
|
|
code: item |
|
|
|
|
} |
|
|
|
|
GetPhoneNumber(params).then(res => { |
|
|
|
|
unionPhoneLogin(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '授权成功', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
uni.navigateBack({}) |
|
|
|
|
this.user = res.return_data.object.highUser; |
|
|
|
|
app.globalData.token = res.return_data.uniqueCode; |
|
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
@ -131,6 +133,11 @@ |
|
|
|
|
.object |
|
|
|
|
.highUser |
|
|
|
|
}) |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "token", |
|
|
|
|
data: res.return_data.uniqueCode |
|
|
|
|
}) |
|
|
|
|
uni.navigateBack({}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|