|
@@ -495,50 +495,49 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
getPhoneNumber(e) {
|
|
|
- tool.isLogin().then(res => {
|
|
|
- console.log(res)
|
|
|
- if (e.detail.errMsg == "getPhoneNumber:ok") {
|
|
|
- wx.request({
|
|
|
- url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
|
|
|
- header: {
|
|
|
- 'content-type': 'application/x-www-form-urlencoded',
|
|
|
- },
|
|
|
- data: {
|
|
|
- sessionKey: this.data.sessionkey,
|
|
|
- signature: res.signature,
|
|
|
- rawData: res.rawData,
|
|
|
- encryptedData: e.detail.encryptedData,
|
|
|
- iv: e.detail.iv
|
|
|
- },
|
|
|
- method: "POST",
|
|
|
- success: (res) => {
|
|
|
- console.log(res, '我是解析的手号');
|
|
|
- let tel = 'form.tel'
|
|
|
- if (res.data.phoneNumber) {
|
|
|
- this.setData({
|
|
|
- [tel]: res.data.phoneNumber
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.setData({
|
|
|
- [tel]: 0
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- wx.showModal({
|
|
|
- title: '您还未登录',
|
|
|
- showCancel: false,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/personal/personal',
|
|
|
+ console.log(e,'000000000')
|
|
|
+ if (e.detail.errMsg == "getPhoneNumber:ok") {
|
|
|
+ wx.getSetting({
|
|
|
+ success: res => {
|
|
|
+ console.log(res,'111111')
|
|
|
+ if (res.authSetting['scope.userInfo']) {
|
|
|
+ wx.getUserInfo({
|
|
|
+ success: res2 => {
|
|
|
+ console.log(JSON.parse(res2.rawData),'222222222222')
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded',
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ sessionKey: this.data.sessionkey,
|
|
|
+ signature: res2.signature,
|
|
|
+ rawData: res2.rawData,
|
|
|
+ encryptedData: e.detail.encryptedData,
|
|
|
+ iv: e.detail.iv
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, '我是解析的手号');
|
|
|
+ let tel = 'form.tel'
|
|
|
+ if (res.data.phoneNumber) {
|
|
|
+ this.setData({
|
|
|
+ [tel]: res.data.phoneNumber
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ [tel]: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 表单提交事件
|
|
|
formSubmit(e) {
|
|
@@ -623,11 +622,22 @@ Page({
|
|
|
},
|
|
|
onShow() {
|
|
|
tool.isLogin().then(res => {
|
|
|
- console.log(res,'7777777777777')
|
|
|
- this.setData({
|
|
|
- userInfo: JSON.parse(res.rawData)
|
|
|
- })
|
|
|
- // this.getInfos()
|
|
|
+ // this.setData({
|
|
|
+ // userInfo: JSON.parse(res.rawData)
|
|
|
+ // })
|
|
|
+ // wx.getSetting({
|
|
|
+ // success: res => {
|
|
|
+ // if (res.authSetting['scope.userInfo']) {
|
|
|
+ // wx.getUserInfo({
|
|
|
+ // success: res => {
|
|
|
+ // this.setData({
|
|
|
+ // userInfo:JSON.parse(res.rawData)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}).catch(err => {
|
|
|
wx.showModal({
|
|
|
title: '您还未登录',
|