1234
This commit is contained in:
@@ -56,5 +56,55 @@ Page({
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: "" + t.globalData.servicetel
|
||||
});
|
||||
},
|
||||
updateUserAvatar: function() {
|
||||
var that = this;
|
||||
wx.getUserProfile({
|
||||
desc: '用于更新您的头像',
|
||||
success: function(res) {
|
||||
var userInfo = res.userInfo;
|
||||
e.request('miniprogram/user/update', {
|
||||
avatar: userInfo.avatarUrl
|
||||
}, true).then(function(res) {
|
||||
if (res.code == 200) {
|
||||
that.getContent();
|
||||
wx.showToast({
|
||||
title: '头像更新成功',
|
||||
icon: 'success'
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
updateUserNickname: function() {
|
||||
var that = this;
|
||||
wx.getUserProfile({
|
||||
desc: '用于更新您的昵称',
|
||||
success: function(res) {
|
||||
var userInfo = res.userInfo;
|
||||
e.request('miniprogram/user/update', {
|
||||
nickname: userInfo.nickName
|
||||
}, true).then(function(res) {
|
||||
if (res.code == 200) {
|
||||
that.getContent();
|
||||
wx.showToast({
|
||||
title: '昵称更新成功',
|
||||
icon: 'success'
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -2,12 +2,12 @@
|
||||
<page-loding wx:if="{{showLoding}}"></page-loding>
|
||||
<view class="page-top">
|
||||
<view class="user-info">
|
||||
<view class="avatar">
|
||||
<view class="avatar" bindtap="updateUserAvatar">
|
||||
<image src="{{user.avatar}}"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="left">
|
||||
<view class="username">{{user.nickname}}</view>
|
||||
<view class="username" bindtap="updateUserNickname">{{user.nickname}}</view>
|
||||
<view class="tel">{{user.mobile}}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
|
||||
Reference in New Issue
Block a user