添加详情信息

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", // "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) { if (res.statusCode == 200) {
// uni-app // uni-app
uni.setStorageSync("userInfo", res.data); uni.setStorageSync("userInfo", res.data);

View File

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

View File

@ -90,12 +90,9 @@ export default {
// }, // },
], ],
userInfo: {}, userInfo: {},
avatarUrl: BASE_IMG_URL + "/file/image/", avatarUrl: BASE_IMG_URL ,
user: BASE_IMG_URL + "/minePage/user.png", // user: BASE_IMG_URL + "/minePage/user.png", //
}; };
},
computed: {
}, },
onLoad () { onLoad () {
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();

View File

@ -24,7 +24,7 @@
<!-- Nickname Section --> <!-- Nickname Section -->
<view class="profile_item"> <view class="profile_item">
<text class="item_label">昵称</text> <text class="item_label">昵称</text>
<input class="nickname_input" v-model="userInfo.nikename" placeholder="请输入昵称"/> <input class="nickname_input" v-model="userInfo.nickname" placeholder="请输入昵称"/>
</view> </view>
<!-- Save Button --> <!-- Save Button -->
<button class="save_btn" @click="saveProfile">保存修改</button> <button class="save_btn" @click="saveProfile">保存修改</button>
@ -44,10 +44,10 @@ export default {
return { return {
back: BASE_IMG_URL + "/minePage/back.png", // back: BASE_IMG_URL + "/minePage/back.png", //
user: BASE_IMG_URL + "/minePage/user.png", // user: BASE_IMG_URL + "/minePage/user.png", //
avatarUrl: BASE_IMG_URL + "/file/image/", avatarUrl: BASE_IMG_URL,
statusBarHeight: 0, statusBarHeight: 0,
userInfo: { userInfo: {
nikename: "", nickname: "",
avatar: "", avatar: "",
phone: "" phone: ""
} }
@ -70,7 +70,7 @@ export default {
getUserInfoFromCache() { getUserInfoFromCache() {
const userInfo = uni.getStorageSync("userInfo"); const userInfo = uni.getStorageSync("userInfo");
if (userInfo) { if (userInfo) {
this.userInfo.nikename = userInfo.nikeName; this.userInfo.nickname = userInfo.nikeName;
this.userInfo.avatar = userInfo.avatar; this.userInfo.avatar = userInfo.avatar;
} }
}, },
@ -106,7 +106,7 @@ export default {
}); });
}, },
async saveProfile() { async saveProfile() {
if (!this.userInfo.nikename.trim()) { if (!this.userInfo.nickname.trim()) {
uni.showToast({ uni.showToast({
title: '昵称不能为空', title: '昵称不能为空',
icon: 'none' icon: 'none'