添加详情信息
This commit is contained in:
parent
5137974b5c
commit
536700b882
10
App.vue
10
App.vue
@ -31,7 +31,15 @@ export default {
|
||||
"Content-Type": "application/x-www-form-urlencoded", // 关键配置
|
||||
},
|
||||
});
|
||||
|
||||
if (res.data.status == 400) {
|
||||
// 1. 显示无按钮的 Toast(无法关闭)
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none',
|
||||
duration: 9999999, // 极长时间,相当于不自动关闭
|
||||
mask: true, // 透明遮罩层,阻止触摸
|
||||
});
|
||||
}
|
||||
if (res.statusCode == 200) {
|
||||
// 存储用户信息到本地缓存(uni-app接口)
|
||||
uni.setStorageSync("userInfo", res.data);
|
||||
|
@ -94,6 +94,12 @@ export default {
|
||||
if (res.result) {
|
||||
// 扫码成功,获取到设备ID或编码
|
||||
this.deviceCode = res.result;
|
||||
// 友好提示
|
||||
uni.showToast({
|
||||
title: '扫码成功,正在绑定设备...',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
// 调用绑定接口
|
||||
this.bindDevice();
|
||||
}
|
||||
|
@ -90,12 +90,9 @@ export default {
|
||||
// },
|
||||
],
|
||||
userInfo: {},
|
||||
avatarUrl: BASE_IMG_URL + "/file/image/",
|
||||
avatarUrl: BASE_IMG_URL ,
|
||||
user: BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
onLoad () {
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
|
@ -24,7 +24,7 @@
|
||||
<!-- Nickname Section -->
|
||||
<view class="profile_item">
|
||||
<text class="item_label">昵称</text>
|
||||
<input class="nickname_input" v-model="userInfo.nikename" placeholder="请输入昵称"/>
|
||||
<input class="nickname_input" v-model="userInfo.nickname" placeholder="请输入昵称"/>
|
||||
</view>
|
||||
<!-- Save Button -->
|
||||
<button class="save_btn" @click="saveProfile">保存修改</button>
|
||||
@ -44,10 +44,10 @@ export default {
|
||||
return {
|
||||
back: BASE_IMG_URL + "/minePage/back.png", //返回图标
|
||||
user: BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
||||
avatarUrl: BASE_IMG_URL + "/file/image/",
|
||||
avatarUrl: BASE_IMG_URL,
|
||||
statusBarHeight: 0,
|
||||
userInfo: {
|
||||
nikename: "",
|
||||
nickname: "",
|
||||
avatar: "",
|
||||
phone: ""
|
||||
}
|
||||
@ -70,7 +70,7 @@ export default {
|
||||
getUserInfoFromCache() {
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
if (userInfo) {
|
||||
this.userInfo.nikename = userInfo.nikeName;
|
||||
this.userInfo.nickname = userInfo.nikeName;
|
||||
this.userInfo.avatar = userInfo.avatar;
|
||||
}
|
||||
},
|
||||
@ -106,7 +106,7 @@ export default {
|
||||
});
|
||||
},
|
||||
async saveProfile() {
|
||||
if (!this.userInfo.nikename.trim()) {
|
||||
if (!this.userInfo.nickname.trim()) {
|
||||
uni.showToast({
|
||||
title: '昵称不能为空',
|
||||
icon: 'none'
|
||||
|
Loading…
Reference in New Issue
Block a user