Skip to content

Commit

Permalink
Fixed Error Change the Wechat Nickname Text in Some Phone Types
Browse files Browse the repository at this point in the history
  • Loading branch information
zhrrobert committed Nov 29, 2023
1 parent 1b4ed5e commit 0ef6aa1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 18 additions & 14 deletions eaterplanet_ecommerce/components/modal-userProfile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Component({
})
this.getBg();
let member_info = wx.getStorageSync('member_info');
if (member_info!==null) {
if (member_info !== null) {
this.setData({
nickname: member_info.username,
avatarUrl: member_info.avatar
Expand All @@ -55,13 +55,17 @@ Component({
avatarUrl: e.detail.avatarUrl
})
},
nicknameInput(e){
const {value}= e.detail;
console.log(value);
this.setData({
nickname:value
})
},
nicknameInput(e) {
const { value } = e.detail;
this.setData({
nickname: value
})
},
getNickname(e) {
this.setData({
nickname: e.detail.value
})
},
getBg: function () {
let that = this;
app.util.request({
Expand Down Expand Up @@ -133,10 +137,10 @@ Component({
'content-type': 'multipart/form-data'
},
success: function (res) {
var data = JSON.parse(res.data);
var imgUrl = data.image_o;
let data = JSON.parse(res.data);
let imgUrl = data.image_o;
that.setData({
avatarUrl: imgUrl
avatarUrl: imgUrl
});
}
})
Expand Down Expand Up @@ -198,7 +202,7 @@ Component({
},
method: 'post',
dataType: 'json',
success: function (res) {
success: function (res) {
let isblack = res.data.isblack || 0;
if (isblack == 1) {
app.globalData.isblack = 1;
Expand All @@ -220,10 +224,10 @@ Component({
title: '修改成功',
duration: 2000
})
that.triggerEvent("authSuccess",res);
that.triggerEvent("authSuccess", res);
console.log("下一步刷新页面")
},
})
})
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<view class="nickname" wx:if="{{showUserProfile}}">
<text class="title">昵称</text>
<view class="nickname-wrapper">
<input class="input" type="nickname" value="{{nickname}}" bindinput="nicknameInput"/>
<input class="input" type="nickname" value="{{nickname}}" bind:change="getNickname" bindinput="nicknameInput"/>
</view>
</view>
</view>
Expand Down

0 comments on commit 0ef6aa1

Please sign in to comment.