From 536700b8822dd58847a3b201cb7b5a5afe73957f Mon Sep 17 00:00:00 2001
From: 18796357645 <674126018@qq.com>
Date: Thu, 17 Jul 2025 10:04:27 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=A6=E6=83=85=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 10 +++++++++-
pages/deviceBind/index.vue | 6 ++++++
pages/mine/index.vue | 5 +----
pages/mine/update.vue | 10 +++++-----
4 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/App.vue b/App.vue
index 3863a4e..4a5b4b5 100644
--- a/App.vue
+++ b/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);
diff --git a/pages/deviceBind/index.vue b/pages/deviceBind/index.vue
index c77bd54..cd0b4c2 100644
--- a/pages/deviceBind/index.vue
+++ b/pages/deviceBind/index.vue
@@ -94,6 +94,12 @@ export default {
if (res.result) {
// 扫码成功,获取到设备ID或编码
this.deviceCode = res.result;
+ // 友好提示
+ uni.showToast({
+ title: '扫码成功,正在绑定设备...',
+ icon: 'success',
+ duration: 1500
+ });
// 调用绑定接口
this.bindDevice();
}
diff --git a/pages/mine/index.vue b/pages/mine/index.vue
index 7c37d7c..1967f5f 100644
--- a/pages/mine/index.vue
+++ b/pages/mine/index.vue
@@ -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();
diff --git a/pages/mine/update.vue b/pages/mine/update.vue
index c6c0612..7b97713 100644
--- a/pages/mine/update.vue
+++ b/pages/mine/update.vue
@@ -24,7 +24,7 @@
昵称
-
+
@@ -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'