添加详情信息

This commit is contained in:
18796357645 2025-07-17 10:04:27 +08:00
parent 5137974b5c
commit 536700b882
4 changed files with 21 additions and 10 deletions

10
App.vue
View File

@ -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);

View File

@ -94,6 +94,12 @@ export default {
if (res.result) {
// ID
this.deviceCode = res.result;
//
uni.showToast({
title: '扫码成功,正在绑定设备...',
icon: 'success',
duration: 1500
});
//
this.bindDevice();
}

View File

@ -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();

View File

@ -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'