From 51ab4d0bfa3365af8c98ed31f2f6062e771b8ef8 Mon Sep 17 00:00:00 2001
From: fengerli <528575642@qq.com>
Date: Thu, 24 Jul 2025 10:05:17 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85=E6=8F=90=E7=A4=BA=E5=BC=B9?=
=?UTF-8?q?=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/CustomPopup/CustomPopup.vue | 182 +++++++++++++++++++++++++
config/index.js | 2 +-
pages/6170/allShare/index.vue | 17 ++-
pages/6170/deviceControl/index.vue | 50 ++++---
pages/common/allType/index.vue | 19 ++-
pages/common/index/index.vue | 1 -
pages/common/login/index.vue | 42 +++---
pages/common/send/index.vue | 136 ++++++------------
utils/request.js | 2 +-
9 files changed, 307 insertions(+), 144 deletions(-)
create mode 100644 components/CustomPopup/CustomPopup.vue
diff --git a/components/CustomPopup/CustomPopup.vue b/components/CustomPopup/CustomPopup.vue
new file mode 100644
index 0000000..e2ca6db
--- /dev/null
+++ b/components/CustomPopup/CustomPopup.vue
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/index.js b/config/index.js
index 0424e6a..a655ae5 100644
--- a/config/index.js
+++ b/config/index.js
@@ -12,7 +12,7 @@ const config = {
},
// 生产环境
production: {
- BASE_URL: 'https://fuyuanshen.com/backend',
+ BASE_URL: 'http://47.120.79.150/backend', // https://fuyuanshen.com/backend
API_PREFIX: '',
// MQTT 配置
MQTT_HOST: '47.120.79.150',
diff --git a/pages/6170/allShare/index.vue b/pages/6170/allShare/index.vue
index fe3ce26..ba5ba27 100644
--- a/pages/6170/allShare/index.vue
+++ b/pages/6170/allShare/index.vue
@@ -14,7 +14,11 @@
@@ -23,7 +27,8 @@
-
+
@@ -103,7 +102,6 @@
人员信息登记
-
@@ -161,7 +159,7 @@
-
+
+
+
@@ -245,7 +247,6 @@
sliderValue: 50,
lightModeA: false,
currentMainMode: '强光模式',
- currentSecondaryMode: '泛光模式',
lightModeB: false,
lightModeC: false, //激光提示框
items: [],
@@ -270,7 +271,12 @@
},
activePermissions: [], // 存储当前设备的权限数组
isSharedDevice: false, // 标记是否来自分享
- isRightIconVisible: false
+ isRightIconVisible: false,
+ showPopupFlag: false, //是否显示弹框
+
+ popupMessage: '!',
+ popupConfirmText: '确认',
+ showUploadPopup:false
}
},
computed: {
@@ -321,16 +327,18 @@
onItemClick(index) {
const selectedItem = this.items[index];
if (selectedItem.text === '激光') {
- this.lightModeC = true
- this.selectedItemIndex = index; // 记录当前选择的索引
+ this.lightModeC = true;
} else {
+ // 更新选中状态
this.items = this.items.map((item, i) => ({
...item,
selected: i === index
}));
- // 记录当前选中的 index,但不发送
+ this.currentMainMode = selectedItem.text;
this.selectedItemIndex = index;
- console.log(selectedItem.text, 'selectedItem.text');
+
+ // 强制更新视图(如果需要)
+ this.$forceUpdate();
}
},
// 灯光模式的确认
@@ -338,6 +346,9 @@
if (this.selectedItemIndex === null) return;
const selectedItem = this.items[this.selectedItemIndex];
const instruction = this.modeInstructions[selectedItem.text];
+ console.log(selectedItem, 'selectedItemselectedItem');
+ this.selectedItemIndex = selectedItem.text;
+
if (instruction) {
const topic = `B/${this.itemInfo.deviceImei}`;
const message = JSON.stringify(instruction);
@@ -456,10 +467,8 @@
registerPersonInfo(data).then((res) => {
if (res.code == 200) {
uni.hideLoading()
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
+ this.showPopupFlag = true
+ this.popupMessage = '人员信息发送成功'
} else {
uni.showToast({
title: res.msg,
@@ -468,6 +477,10 @@
}
})
},
+ onPopupConfirm() {
+ this.showPopupFlag = false
+ console.log('用户点击了确定')
+ },
// 发送文本消息
sendTextMessage() {
if (!this.messageToSend) {
@@ -488,10 +501,8 @@
deviceSendMessage(data).then((res) => {
if (res.code == 200) {
uni.hideLoading()
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
+ this.showPopupFlag = true
+ this.popupMessage = '发送信息成功'
} else {
uni.showToast({
title: res.msg,
@@ -529,7 +540,7 @@
}
this.messageToSend = res.data.sendMsg || ''
// 关闭加载中
- uni.hideLoading()
+ uni.hideLoading()
}
},
// 检查权限的方法
@@ -627,6 +638,7 @@
align-items: center;
z-index: 9999;
}
+
/* 优化权限控制区域的显示 */
.mode-section,
.form-section {
@@ -972,7 +984,7 @@
/* 弹窗主体 */
.agreement-popup {
width: 100%;
- height: 50%;
+ height: 40%;
background-color: rgb(42, 42, 42);
border-radius: 60rpx 60rpx 0rpx 0rpx;
padding: 40rpx;
diff --git a/pages/common/allType/index.vue b/pages/common/allType/index.vue
index cf7d17d..29571b7 100644
--- a/pages/common/allType/index.vue
+++ b/pages/common/allType/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -9,6 +9,11 @@
{{ item.typeName }}
+
+
+
+ 暂无数据
+
@@ -30,17 +35,17 @@
}
})
},
- alltypeInfo(item){
+ alltypeInfo(item) {
uni.switchTab({
url: '/pages/common/index/index',
success: (res) => {
- res.eventChannel.emit('index', {
+ res.eventChannel.emit('index', {
data: item
});
}
})
}
-
+
},
onLoad() {
this.getTab()
@@ -92,4 +97,10 @@
.plate-number {
color: rgba(255, 255, 255, 0.87);
}
+
+ .noDATA {
+ text-align: center;
+ color: rgba(255, 255, 255, 0.87);
+ transform: translate(-0%, 100%);
+ }
\ No newline at end of file
diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue
index 9bc3412..1df7c9f 100644
--- a/pages/common/index/index.vue
+++ b/pages/common/index/index.vue
@@ -21,7 +21,6 @@
位置
发送信息
-
diff --git a/pages/common/login/index.vue b/pages/common/login/index.vue
index 7bdf815..fef908c 100644
--- a/pages/common/login/index.vue
+++ b/pages/common/login/index.vue
@@ -91,25 +91,33 @@
return false;
}
try {
- await resourceSmsCode({
+ const res = await resourceSmsCode({
phonenumber: this.phone
})
- // 更新倒计时状态
- this.isCounting = true;
- this.showView = true;
- this.countdown = 60
- const timer = setInterval(() => {
- this.countdown--
- if (this.countdown <= 0) {
- clearInterval(timer)
- this.isCounting = false;
- this.showView = false;
- }
- }, 1000)
- uni.showToast({
- title: '验证码已发送',
- icon: 'none'
- })
+ if (res.code == 200) {
+ // 更新倒计时状态
+ this.isCounting = true;
+ this.showView = true;
+ this.countdown = 60
+ const timer = setInterval(() => {
+ this.countdown--
+ if (this.countdown <= 0) {
+ clearInterval(timer)
+ this.isCounting = false;
+ this.showView = false;
+ }
+ }, 1000)
+ uni.showToast({
+ title: '验证码已发送',
+ icon: 'none'
+ })
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ }
+
} catch (error) {}
},
// 勾选同意
diff --git a/pages/common/send/index.vue b/pages/common/send/index.vue
index ada8c38..d879326 100644
--- a/pages/common/send/index.vue
+++ b/pages/common/send/index.vue
@@ -31,7 +31,7 @@
-
+
编辑信息
-
-
-
-
+