From 8920d6117b63f87b6290ce997b5983a59d5a07b1 Mon Sep 17 00:00:00 2001 From: lld <15027638633@163.com> Date: Fri, 20 Feb 2026 20:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A6=E6=BB=91=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.vue | 91 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index b18c247..c97db61 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -38,31 +38,32 @@ lower-threshold="50" scroll-with-animation > - - + - - {{ item.agriName }} - {{ item.workModeDesc }} - {{ item.online }} - + :right-options="options"> + + + {{ item.agriName }} + {{ item.workModeDesc }} + {{ item.online }} + - - 设备编号:{{ item.imei }} - + + 设备编号:{{ item.imei }} + - - 温度1: {{ item.temp1 }}℃ - 温度2: {{ item.temp2 }}℃ - 温度3: {{ item.temp3 }}℃ - 温度4: {{ item.temp4 }}℃ + + 温度1: {{ item.temp1 }}℃ + 温度2: {{ item.temp2 }}℃ + 温度3: {{ item.temp3 }}℃ + 温度4: {{ item.temp4 }}℃ + - + @@ -74,7 +75,7 @@ 点击添加大棚 - + @@ -280,8 +281,17 @@ export default { refresh() { this.getListData(); }, + onDeleteItem(item) { + console.info(`点击了${item.content.text}`) + + }, // 点击列表项 - onItemTap(item) { + onItemTap(item,index) { + console.info(item,index) + if (item.online==='离线') { + return; + } + console.info(item) var agri = JSON.stringify( { imei:item.imei, @@ -368,18 +378,41 @@ page { background-color: #e0e0e0; border-radius: 2rpx; } - -.list-item { - padding: 14rpx 25rpx; - /* 移除border-bottom,改为margin-top,并且把列表项背景设为半透明白色 */ +.item-card { + background-color: #FFFFFF; + border-radius: 12rpx; + box-shadow: 8rpx 5rpx 10rpx #999; margin-bottom: 20rpx; + // #ifndef H5 + //margin-right: 10rpx; + // #endif +} +/deep/ .uni-swipe { + // #ifdef MP-WEIXIN + height: 214rpx !important; + // #endif +} +/deep/ .uni-swipe_button { + // #ifdef MP-WEIXIN + height: 198rpx !important; + // #endif margin-right: 10rpx; - background-color: rgba(255, 255, 255, 0.85); + border-radius: 12rpx; + box-shadow: 8rpx 5rpx 10rpx #999; +} +.list-item,/deep/.tn-swipe-action-item { + height: 190rpx; + /* 移除border-bottom,改为margin-top,并且把列表项背景设为半透明白色 */ + // #ifdef H5 + margin-bottom: 20rpx; + background-color: #FFFFFF; border-radius: 12rpx; /* 新增:点击态样式,双端统一 */ transition: all 0.2s ease; + overflow: hidden; box-shadow: 8rpx 5rpx 10rpx #999; pointer-events: auto !important; + // #endif } .list-item:active { background-color: #F5F5F5; @@ -396,6 +429,7 @@ page { align-items: center; width: 100%; box-sizing: border-box; + padding: 14rpx 25rpx 0 25rpx; } .title-text { overflow: hidden; @@ -428,13 +462,14 @@ page { color: #666; line-height: 52rpx; display: block; + padding: 0 25rpx; } .item-tags { display: flex; gap: 8rpx; flex-wrap: wrap; /* 新增:标签过多时换行,避免溢出 */ - padding: 14rpx 0; + padding: 14rpx 25rpx 28rpx 25rpx; } .tag { @@ -513,7 +548,6 @@ page { background-color: #fafafa; /* 可选:添加透明度 */ opacity: 0.7; - pointer-events: none !important; /* 禁止所有交互 */ } /* 禁用状态下的子元素也置灰 */ @@ -567,7 +601,6 @@ page { /* 可选:添加背景和圆角,和列表项风格统一 */ background-color: rgba(255, 255, 255, 0.85); border-radius: 12rpx; - margin-top: 20rpx; /* 点击态效果,和列表项保持一致 */ transition: all 0.2s ease; }