diff --git a/src/components/other/index.vue b/src/components/other/index.vue
index 49befd7..b297556 100644
--- a/src/components/other/index.vue
+++ b/src/components/other/index.vue
@@ -13,19 +13,7 @@
- 编辑
-
-
-
-
-
- 联系工程师
+ 编辑塘口
-
-
-
- {{ item.deviceName }}
+
+
+
+
+ {{ item.deviceName }}
+
-
-
+
+
@@ -1890,25 +1873,48 @@ defineExpose({
border-radius: 4px;
color: #bf290e;
}
+ .device-tabs-wrapper {
+ width: 100%;
+ white-space: nowrap;
+ overflow-x: auto;
+ -webkit-overflow-scrolling: touch;
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+ &::-webkit-scrollbar {
+ display: none;
+ }
+ }
+ .device-tabs {
+ display: flex;
+ flex-wrap: nowrap;
+ padding: 20rpx 0;
+ }
.custom-tab-item {
- padding: 0 0px 0 0;
- margin: 0 30px 0 0;
-
- .custom-line {
- width: 100%;
- height: 2px;
- background: #eeeeee;
- border-radius: 10px;
- margin: 0 auto;
+ padding: 10rpx 20rpx;
+ margin-right: 10rpx;
+ background-color: #f5f6f7;
+ border-radius: 8rpx;
+ transition: all 0.3s ease;
+ white-space: nowrap;
+
+ &:last-child {
+ margin-right: 0;
+ }
+
+ &.tab-active {
+ background-color: #ffffff;
+ box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1);
}
.custom-title {
- color: black;
+ color: #333;
display: inline-block;
- }
-
- .custom-title.active {
- border-bottom: 4px solid #09b8c2;
+ font-size: 28rpx;
+
+ &.active {
+ color: #09b8c2;
+ font-weight: bold;
+ }
}
}
.nut-tab-pane {
diff --git a/src/pages/main/home.vue b/src/pages/main/home.vue
index bd80b1b..e771784 100644
--- a/src/pages/main/home.vue
+++ b/src/pages/main/home.vue
@@ -6,15 +6,32 @@
-
+
-
-
+
+
+
+
+
+ 切换模式
+
+
+
+
+
+
+
+ 联系工程师
+
系统公告
+
+
-
-
{{ `${deadList.length}个设备即将到期` }}
-
+
塘口列表
-
+
新建塘口
-
-
-
-
-
-
- 切换模式
-
+
@@ -280,11 +290,11 @@
-
+
{{ item.pondName }}
-
+
@@ -541,7 +551,7 @@
v-model="selPond_2"
@addDevice="addDevice"
ref="pondChildInfo"
- type="2"
+ :type="2"
/>
@@ -590,6 +600,8 @@ const c3_n = `${imgUrl}c3_n.png`;
const c_def = `${imgUrl}c_def.png`;
const location = `${imgUrl}location.png`;
const change = `${imgUrl}change.png`;
+const phone = `${imgUrl}tel.png`;
+const setting = `${imgUrl}setting.png`;
const noticeImg = `${imgUrl}noticeImg.png`;
const pond404 = `${imgUrl}zanwurenwu.png`;
// const notice = ref("有设备服务快到期,请尽快续费");
@@ -632,9 +644,9 @@ let qqmapsdk = new QQMapWX({
key: "75RBZ-WQSYB-6KEUB-NCZME-D62T7-YIF4G",
});
// 选中的塘口id
-const selPond = ref(undefined);
+const selPond = ref(undefined);
// 多糖选中塘口id
-const selPond_2 = ref(undefined);
+const selPond_2 = ref(undefined);
const selPondName_2 = ref("塘口详情");
const visControl = ref(false);
// 展示塘口详情
@@ -940,19 +952,22 @@ function pond1() {
});
pondList.value = rows;
+ // 立即设置默认选中的塘口,并强制触发响应式更新
+ if (rows.length > 0) {
+ const firstPondId = rows[0]["id"]; // 保持原始类型
+ if (!selPond.value || !pondIds.includes(selPond.value)) {
+ // 延迟一帧确保 DOM 已渲染
+ setTimeout(() => {
+ selPond.value = firstPondId;
+ console.log('已选中塘口:', selPond.value, '类型:', typeof selPond.value, '所有塘口:', rows.map(r => ({id: r.id, name: r.pondName})));
+ }, 50);
+ }
+ } else {
+ selPond.value = undefined;
+ }
setTimeout(() => {
showTour.value = rows.length == 0 ? true : false;
}, 500);
- selPond.value = selPond.value
- ? selPond.value
- : rows.length > 0
- ? Number(rows[0]["id"])
- : undefined;
- if (selPond.value) {
- if (!pondIds.includes(selPond.value)) {
- selPond.value = rows.length > 0 ? Number(rows[0]["id"]) : undefined;
- }
- }
}
});
}
@@ -968,6 +983,18 @@ function addPond() {
url: "/home/addPond",
});
}
+// 编辑塘口
+function updatePond() {
+ const pondId = mode.value == 1 ? selPond.value : selPond_2.value;
+ if (pondId) {
+ Taro.navigateTo({
+ url: `/home/updatePond?id=${pondId}`,
+ });
+ } else {
+ state.show = true;
+ state.msg = "请先选择塘口";
+ }
+}
// 绑定设备页面
function addDevice() {
@@ -1277,17 +1304,32 @@ function toPay() {
// 模式2塘口管理
.pond_mode2 {
.nut-radio__button--active {
- background-color: #09b8c2;
+ background: linear-gradient(135deg, #09b8c2 0%, #06a0a9 100%) !important;
border-radius: 10px;
+ color: #fff !important;
+ font-weight: bold;
+ font-size: 30rpx !important;
+ box-shadow: 0 6rpx 16rpx rgba(9, 184, 194, 0.6);
+ transform: scale(1.08);
+ transition: all 0.3s ease;
+ border: 2px solid #09b8c2;
}
.nut-radio__button--normal {
border-radius: 10px;
+ background-color: #f5f6f7;
+ color: #999;
+ font-size: 28rpx;
+ box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.06);
+ transition: all 0.3s ease;
+ border: 1px solid transparent;
}
.nut-radio--button {
- background-color: #fff;
+ background-color: #f5f6f7;
border-radius: 10px;
+ margin-bottom: 10rpx;
+ margin-right: 10rpx;
}
.nut-tab-pane {