|
|
@@ -10,17 +10,17 @@
|
|
|
<text style="margin-left: 10%;">{{userName}}</text>
|
|
|
<text style="margin-left: 10%;font-size: 28rpx;" v-if="isAuthPhone">{{userPhone}} </text>
|
|
|
<button type="primary" class="authPhone" open-type="getPhoneNumber" style="font-size: 12px;"
|
|
|
- bindgetphonenumber="getPhoneNumber" v-else>手机号码授权</button>
|
|
|
+ @getphonenumber="getPhoneNumber" v-else>手机号码授权</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="self-content">
|
|
|
<view>
|
|
|
- <text>13982</text>
|
|
|
+ <text>{{userInfoObj.scorenumber || '0'}}</text>
|
|
|
<text style="font-size: 28rpx;">我的积分</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <text>127.83元</text>
|
|
|
+ <text>{{userInfoObj.num || '0'}}元</text>
|
|
|
<text style="font-size: 28rpx;">已提现</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -93,11 +93,14 @@ export default {
|
|
|
userHead:getApp().globalData.user_headUrl || '/static/logo.png',
|
|
|
userPhone:getApp().globalData.user_phone || '156****3232',
|
|
|
isAuth:getApp().globalData.isAuth,
|
|
|
- isAuthPhone:getApp().globalData.user_phone
|
|
|
+ isAuthPhone:getApp().globalData.user_phone,
|
|
|
+ userInfoObj:{}
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.getUserInfo();
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.getUserInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
getUserInfo(){
|
|
|
@@ -111,24 +114,30 @@ export default {
|
|
|
data: {
|
|
|
method: 'getUserInfo',
|
|
|
timestamp: getApp().globalData.globalTimestamp, //Date.now()
|
|
|
- uid:'1',
|
|
|
+ uid:getApp().globalData.user_id,
|
|
|
sign: md5('getUserInfo' + getApp().globalData.globalTimestamp)
|
|
|
},
|
|
|
success: res => {
|
|
|
if (res.data.code === 200) {
|
|
|
console.log(res.data.msg)
|
|
|
+ that.userInfoObj = res.data.msg
|
|
|
//that.cashOutList = res.data.msg
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
goTeamDetail(){
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/selfCenter/recommendTeam/index',
|
|
|
- success: res => {},
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- });
|
|
|
+ if(getApp().globalData.isAuth){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/selfCenter/recommendTeam/index',
|
|
|
+ success: res => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.goAuth()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
goRecommend(){
|
|
|
uni.switchTab({
|
|
|
@@ -136,20 +145,30 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
goAward(){
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/selfCenter/awardPage/index',
|
|
|
- success: res => {},
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- });
|
|
|
+ if(getApp().globalData.isAuth){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/selfCenter/awardPage/index',
|
|
|
+ success: res => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.goAuth()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
goCashOut(){
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/selfCenter/cashoutPage/index',
|
|
|
- success: res => {},
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- });
|
|
|
+ if(getApp().globalData.isAuth){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/selfCenter/cashoutPage/index',
|
|
|
+ success: res => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.goAuth()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
goHelpPage(){
|
|
|
uni.navigateTo({
|
|
|
@@ -178,13 +197,17 @@ export default {
|
|
|
},
|
|
|
getPhoneNumber(e){
|
|
|
let that = this;
|
|
|
- if (e.detail.errMsg == 'getPhoneNumber:user deny') { //用户点击拒绝
|
|
|
- that.isNeedPhone = false;
|
|
|
- } else { //允许授权执行跳转
|
|
|
- that.phoneRequest(e.detail.iv, e.detail.encryptedData, app.globalData.sessionKey)
|
|
|
+ console.log(e)
|
|
|
+ if (e.detail.errMsg == 'getPhoneNumber:ok') { //允许授权执行跳转
|
|
|
+ console.log(e.detail.iv)
|
|
|
+ that.phoneRequest(e.detail.iv, e.detail.encryptedData, getApp().globalData.session_key)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ that.isNeedPhone = false;
|
|
|
}
|
|
|
},
|
|
|
- phoneRequest(myIv,myEncryptedData,sKey){
|
|
|
+ phoneRequest(myIv,myEncryptedData,sKey){
|
|
|
+ console.log(11111)
|
|
|
let that = this;
|
|
|
uni.request({
|
|
|
url:getApp().globalData.shareUrl, //需要设置为全局
|
|
|
@@ -197,12 +220,14 @@ export default {
|
|
|
timestamp: getApp().globalData.globalTimestamp, //Date.now()
|
|
|
uid:getApp().globalData.user_id,
|
|
|
sign: md5('getPhoneNumber' + getApp().globalData.globalTimestamp),
|
|
|
- iv:that.iv,
|
|
|
- sessionKey:getApp().globalData.session_key,
|
|
|
- encryptedData:that.encryptedData,
|
|
|
+ iv:myIv,
|
|
|
+ sessionKey:sKey,
|
|
|
+ encryptedData:myEncryptedData,
|
|
|
},
|
|
|
success: res => {
|
|
|
- console.log(res)
|
|
|
+ if(res.data.code === 200){
|
|
|
+ getApp().globalData.user_phone = res.data.msg.phoneNumber;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|