Skip to content

Commit 0ef6aa1

Browse files
committed
Fixed Error Change the Wechat Nickname Text in Some Phone Types
1 parent 1b4ed5e commit 0ef6aa1

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

eaterplanet_ecommerce/components/modal-userProfile/index.js

+18-14
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Component({
3434
})
3535
this.getBg();
3636
let member_info = wx.getStorageSync('member_info');
37-
if (member_info!==null) {
37+
if (member_info !== null) {
3838
this.setData({
3939
nickname: member_info.username,
4040
avatarUrl: member_info.avatar
@@ -55,13 +55,17 @@ Component({
5555
avatarUrl: e.detail.avatarUrl
5656
})
5757
},
58-
nicknameInput(e){
59-
const {value}= e.detail;
60-
console.log(value);
61-
this.setData({
62-
nickname:value
63-
})
64-
},
58+
nicknameInput(e) {
59+
const { value } = e.detail;
60+
this.setData({
61+
nickname: value
62+
})
63+
},
64+
getNickname(e) {
65+
this.setData({
66+
nickname: e.detail.value
67+
})
68+
},
6569
getBg: function () {
6670
let that = this;
6771
app.util.request({
@@ -133,10 +137,10 @@ Component({
133137
'content-type': 'multipart/form-data'
134138
},
135139
success: function (res) {
136-
var data = JSON.parse(res.data);
137-
var imgUrl = data.image_o;
140+
let data = JSON.parse(res.data);
141+
let imgUrl = data.image_o;
138142
that.setData({
139-
avatarUrl: imgUrl
143+
avatarUrl: imgUrl
140144
});
141145
}
142146
})
@@ -198,7 +202,7 @@ Component({
198202
},
199203
method: 'post',
200204
dataType: 'json',
201-
success: function (res) {
205+
success: function (res) {
202206
let isblack = res.data.isblack || 0;
203207
if (isblack == 1) {
204208
app.globalData.isblack = 1;
@@ -220,10 +224,10 @@ Component({
220224
title: '修改成功',
221225
duration: 2000
222226
})
223-
that.triggerEvent("authSuccess",res);
227+
that.triggerEvent("authSuccess", res);
224228
console.log("下一步刷新页面")
225229
},
226-
})
230+
})
227231
}
228232
})
229233
}

eaterplanet_ecommerce/components/modal-userProfile/index.wxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<view class="nickname" wx:if="{{showUserProfile}}">
88
<text class="title">昵称</text>
99
<view class="nickname-wrapper">
10-
<input class="input" type="nickname" value="{{nickname}}" bindinput="nicknameInput"/>
10+
<input class="input" type="nickname" value="{{nickname}}" bind:change="getNickname" bindinput="nicknameInput"/>
1111
</view>
1212
</view>
1313
</view>

0 commit comments

Comments
 (0)