From 7f48ad7939773a9bc02aad98dbc5e11a35d132e1 Mon Sep 17 00:00:00 2001
From: zuoxiao <zuoxiao>
Date: 星期二, 19 八月 2025 15:42:32 +0800
Subject: [PATCH] 更新项目配置,启用URL检查功能;修改监测页面状态管理逻辑,优化在线状态的判断方式,提升用户体验和代码可读性。

---
 pages/stationMonitor/stationMonitor.wxml |  496 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 433 insertions(+), 63 deletions(-)

diff --git a/pages/stationMonitor/stationMonitor.wxml b/pages/stationMonitor/stationMonitor.wxml
index 0807f36..7723357 100644
--- a/pages/stationMonitor/stationMonitor.wxml
+++ b/pages/stationMonitor/stationMonitor.wxml
@@ -1,23 +1,23 @@
 <!--pages/stationMonitor/stationMonitor.wxml-->
 <view class="container">
   <!-- 椤堕儴閫夐」鍗� -->
-  <view class="tab-container">
-    <view class="tab-item {{activeTab === 'weather' ? 'active' : ''}}" bind:tap="switchTab" data-tab="weather">
+  <view class="tabs">
+    <view class="tab {{activeTab === 'weather' ? 'active' : ''}}" bind:tap="switchTab" data-tab="weather">
       <image class="tab-icon" src="/images/weather.svg" />
       <text class="tab-name">姘旇薄绔�</text>
     </view>
 
-    <view class="tab-item {{activeTab === 'soil' ? 'active' : ''}}" bind:tap="switchTab" data-tab="soil">
+    <view class="tab {{activeTab === 'soil' ? 'active' : ''}}" bind:tap="switchTab" data-tab="soil">
       <image class="tab-icon" src="/images/soil.svg" />
       <text class="tab-name">鍦熷¥澧掓儏绔�</text>
     </view>
 
-    <view class="tab-item {{activeTab === 'fertilizer' ? 'active' : ''}}" bind:tap="switchTab" data-tab="fertilizer">
+    <view class="tab {{activeTab === 'fertilizer' ? 'active' : ''}}" bind:tap="switchTab" data-tab="fertilizer">
       <image class="tab-icon" src="/images/fertilizer.svg" />
       <text class="tab-name">姘磋偉鏈�</text>
     </view>
 
-    <view class="tab-item {{activeTab === 'camera' ? 'active' : ''}}" bind:tap="switchTab" data-tab="camera">
+    <view class="tab {{activeTab === 'camera' ? 'active' : ''}}" bind:tap="switchTab" data-tab="camera">
       <image class="tab-icon" src="/images/camera.svg" />
       <text class="tab-name">鎽勫儚澶�</text>
     </view>
@@ -27,25 +27,407 @@
   <view class="content-area">
     <!-- 姘旇薄绔欏唴瀹� -->
     <view wx:if="{{activeTab === 'weather'}}" class="tab-content">
-      <text class="content-title">姘旇薄绔欑洃娴�</text>
-      <!-- 鍦ㄨ繖閲屾坊鍔犳皵璞$珯鐩稿叧鍐呭 -->
+      <!-- <text class="content-title">姘旇薄绔欑洃娴�</text> -->
+
+      <!-- 姘旇薄绔欓�夋嫨涓嬫媺妗� -->
+      <view class="weather-station-selector">
+        <picker bindchange="onWeatherStationChange" value="{{selectedWeatherStationIndex}}" range="{{weatherStationList}}" range-key="name">
+          <view class="picker-container">
+            <text class="picker-label">閫夋嫨姘旇薄绔欙細</text>
+            <view class="picker-value">
+              <text>{{weatherStationList[selectedWeatherStationIndex].name || '璇烽�夋嫨姘旇薄绔�'}}</text>
+              <image class="picker-arrow" src="/images/arrow-down.svg" />
+            </view>
+          </view>
+        </picker>
+      </view>
+
+      <!-- 姘旇薄绔欎俊鎭崱鐗� -->
+      <view wx:if="{{currentWeatherStation}}" class="weather-info-card">
+        <!-- 鐘舵�佹爮 -->
+        <view class="status-bar">
+          <view class="status-item">
+            <view class="status-indicator {{currentWeatherStation.onLine === true ? 'online' : 'offline'}}"></view>
+            <text class="status-text">{{currentWeatherStation.onLine === true ? '鍦ㄧ嚎' : '绂荤嚎'}}</text>
+          </view>
+          <view class="refresh-btn" bind:tap="refreshWeatherData">
+            <image class="refresh-icon" src="/images/refresh.svg" />
+            <text class="refresh-text">鍒锋柊</text>
+          </view>
+        </view>
+
+        <!-- 姘旇薄鏁版嵁缃戞牸 -->
+        <view class="weather-data-grid">
+          <!-- 绌烘皵婀垮害 -->
+          <view class="weather-data-item humidity">
+            <view class="data-icon">
+              <image src="/images/humidity.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">绌烘皵婀垮害(%)</text>
+              <text class="data-value">{{currentWeatherStation.humidity !== null && currentWeatherStation.humidity !== undefined ? currentWeatherStation.humidity : '--'}}%</text>
+            </view>
+          </view>
+
+          <!-- 绌烘皵娓╁害 -->
+          <view class="weather-data-item temperature">
+            <view class="data-icon">
+              <image src="/images/temperature.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">绌烘皵娓╁害(鈩�)</text>
+              <text class="data-value">{{currentWeatherStation.temperature !== null && currentWeatherStation.temperature !== undefined ? currentWeatherStation.temperature : '--'}}掳C</text>
+            </view>
+          </view>
+
+          <!-- 绱绾� -->
+          <view class="weather-data-item uv">
+            <view class="data-icon">
+              <image src="/images/uv.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">绱绾�(mW/m虏)</text>
+              <text class="data-value">{{currentWeatherStation.uv !== null && currentWeatherStation.uv !== undefined ? currentWeatherStation.uv : '--'}}</text>
+            </view>
+          </view>
+
+          <!-- 鍏夌収寮哄害 -->
+          <view class="weather-data-item light">
+            <view class="data-icon">
+              <image src="/images/light.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍏夌収寮哄害(lm/銕�)</text>
+              <text class="data-value">{{currentWeatherStation.light !== null && currentWeatherStation.light !== undefined ? currentWeatherStation.light : '--'}} lux</text>
+            </view>
+          </view>
+
+          <!-- 闆ㄩ噺 -->
+          <view class="weather-data-item rainfall">
+            <view class="data-icon">
+              <image src="/images/rainfall.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">闆ㄩ噺(mm)</text>
+              <text class="data-value">{{currentWeatherStation.rainfall !== null && currentWeatherStation.rainfall !== undefined ? currentWeatherStation.rainfall : '--'}} mm</text>
+            </view>
+          </view>
+
+          <!-- 椋庨�� -->
+          <view class="weather-data-item wind-speed">
+            <view class="data-icon">
+              <image src="/images/wind-speed.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">椋庨��(m/s)</text>
+              <text class="data-value">{{currentWeatherStation.windSpeed !== null && currentWeatherStation.windSpeed !== undefined ? currentWeatherStation.windSpeed : '--'}} m/s</text>
+            </view>
+          </view>
+
+          <!-- 椋庡悜 -->
+          <view class="weather-data-item wind-direction">
+            <view class="data-icon">
+              <image src="/images/wind-direction.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">椋庡悜</text>
+              <view class="wind-direction-display">
+                <!-- <image class="wind-arrow" src="/images/wind-arrow.svg" style="transform: rotate({{currentWeatherStation.windDirectionAngle || 0}}deg)" /> -->
+                <text class="data-value">{{currentWeatherStation.windDirection !== null && currentWeatherStation.windDirection !== undefined ? currentWeatherStation.windDirection : '--'}}</text>
+              </view>
+            </view>
+          </view>
+        </view>
+
+        <!-- 鏈�鍚庢洿鏂版椂闂� -->
+        <view class="last-update">
+          <text class="update-text">鏈�鍚庢洿鏂帮細{{currentWeatherStation.lastUpdate || '--'}}</text>
+        </view>
+      </view>
+
+      <!-- 鏃犳暟鎹彁绀� -->
+      <view wx:if="{{!currentWeatherStation}}" class="no-data">
+        <image class="no-data-icon" src="/images/no-data.svg" />
+        <text class="no-data-text">璇烽�夋嫨姘旇薄绔欐煡鐪嬫暟鎹�</text>
+      </view>
     </view>
 
     <!-- 鍦熷¥澧掓儏绔欏唴瀹� -->
     <view wx:elif="{{activeTab === 'soil'}}" class="tab-content">
-      <text class="content-title">鍦熷¥澧掓儏绔欑洃娴�</text>
-      <!-- 鍦ㄨ繖閲屾坊鍔犲湡澹ゅ鎯呯珯鐩稿叧鍐呭 -->
+      <!-- 鍦熷¥澧掓儏绔欓�夋嫨涓嬫媺妗� -->
+      <view class="weather-station-selector">
+        <picker bindchange="onSoilStationChange" value="{{selectedSoilStationIndex}}" range="{{soilStationList}}" range-key="name">
+          <view class="picker-container">
+            <text class="picker-label">閫夋嫨鍦熷¥澧掓儏绔欙細</text>
+            <view class="picker-value">
+              <text>{{soilStationList[selectedSoilStationIndex].name || '璇烽�夋嫨鍦熷¥澧掓儏绔�'}}</text>
+              <image class="picker-arrow" src="/images/arrow-down.svg" />
+            </view>
+          </view>
+        </picker>
+      </view>
+
+      <!-- 鍦熷¥澧掓儏淇℃伅鍗$墖 -->
+      <view wx:if="{{currentSoilStation}}" class="weather-info-card">
+        <!-- 鐘舵�佹爮 -->
+        <view class="status-bar">
+          <view class="status-item">
+            <view class="status-indicator {{currentSoilStation.onLine === true ? 'online' : 'offline'}}"></view>
+            <text class="status-text">{{currentSoilStation.onLine === true ? '鍦ㄧ嚎' : '绂荤嚎'}}</text>
+          </view>
+          <view class="refresh-btn" bind:tap="refreshSoilData">
+            <image class="refresh-icon" src="/images/refresh.svg" />
+            <text class="refresh-text">鍒锋柊</text>
+          </view>
+        </view>
+
+        <!-- 鍦熷¥澧掓儏鏁版嵁缃戞牸 -->
+        <view class="weather-data-grid">
+          <!-- 鍦熷¥灞�1 -->
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/one.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥婀垮害1(%)</text>
+              <text class="data-value">{{currentSoilStation.soilHumidity1 !== null && currentSoilStation.soilHumidity1 !== undefined ? currentSoilStation.soilHumidity1 : '--'}}%</text>
+            </view>
+          </view>
+
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/one.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥娓╁害1(鈩�)</text>
+              <text class="data-value">{{currentSoilStation.soilTemperature1 !== null && currentSoilStation.soilTemperature1 !== undefined ? currentSoilStation.soilTemperature1 : '--'}}掳C</text>
+            </view>
+          </view>
+
+          <!-- 鍦熷¥灞�2 -->
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/two.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥婀垮害2(%)</text>
+              <text class="data-value">{{currentSoilStation.soilHumidity2 !== null && currentSoilStation.soilHumidity2 !== undefined ? currentSoilStation.soilHumidity2 : '--'}}%</text>
+            </view>
+          </view>
+
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/two.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥娓╁害2(鈩�)</text>
+              <text class="data-value">{{currentSoilStation.soilTemperature2 !== null && currentSoilStation.soilTemperature2 !== undefined ? currentSoilStation.soilTemperature2 : '--'}}掳C</text>
+            </view>
+          </view>
+
+          <!-- 鍦熷¥灞�3 -->
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/three.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥婀垮害3(%)</text>
+              <text class="data-value">{{currentSoilStation.soilHumidity3 !== null && currentSoilStation.soilHumidity3 !== undefined ? currentSoilStation.soilHumidity3 : '--'}}%</text>
+            </view>
+          </view>
+
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/three.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥娓╁害3(鈩�)</text>
+              <text class="data-value">{{currentSoilStation.soilTemperature3 !== null && currentSoilStation.soilTemperature3 !== undefined ? currentSoilStation.soilTemperature3 : '--'}}掳C</text>
+            </view>
+          </view>
+
+          <!-- 鍦熷¥灞�4 -->
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/four.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥婀垮害4(%)</text>
+              <text class="data-value">{{currentSoilStation.soilHumidity4 !== null && currentSoilStation.soilHumidity4 !== undefined ? currentSoilStation.soilHumidity4 : '--'}}%</text>
+            </view>
+          </view>
+
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/four.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥娓╁害4(鈩�)</text>
+              <text class="data-value">{{currentSoilStation.soilTemperature4 !== null && currentSoilStation.soilTemperature4 !== undefined ? currentSoilStation.soilTemperature4 : '--'}}掳C</text>
+            </view>
+          </view>
+
+          <!-- 鍦熷¥灞�5 -->
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/five.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥婀垮害5(%)</text>
+              <text class="data-value">{{currentSoilStation.soilHumidity5 !== null && currentSoilStation.soilHumidity5 !== undefined ? currentSoilStation.soilHumidity5 : '--'}}%</text>
+            </view>
+          </view>
+
+          <view class="weather-data-item soil-item">
+            <view class="data-icon">
+              <image src="/images/five.svg" />
+            </view>
+            <view class="data-content">
+              <text class="data-label">鍦熷¥娓╁害5(鈩�)</text>
+              <text class="data-value">{{currentSoilStation.soilTemperature5 !== null && currentSoilStation.soilTemperature5 !== undefined ? currentSoilStation.soilTemperature5 : '--'}}掳C</text>
+            </view>
+          </view>
+        </view>
+
+        <!-- 鏈�鍚庢洿鏂版椂闂� -->
+        <view class="last-update">
+          <text class="update-text">鏈�鍚庢洿鏂帮細{{currentSoilStation.lastUpdate || '--'}}</text>
+        </view>
+      </view>
+
+      <!-- 鏃犳暟鎹彁绀� -->
+      <view wx:if="{{!currentSoilStation}}" class="no-data">
+        <image class="no-data-icon" src="/images/no-data.svg" />
+        <text class="no-data-text">璇烽�夋嫨鍦熷¥澧掓儏绔欐煡鐪嬫暟鎹�</text>
+      </view>
     </view>
 
     <!-- 姘磋偉鏈哄唴瀹� -->
     <view wx:elif="{{activeTab === 'fertilizer'}}" class="tab-content">
-      <text class="content-title">姘磋偉鏈虹洃娴�</text>
-      <!-- 鍦ㄨ繖閲屾坊鍔犳按鑲ユ満鐩稿叧鍐呭 -->
+      <!-- <text class="content-title">姘磋偉鏈虹洃娴�</text> -->
+
+      <!-- 姘磋偉鏈洪�夋嫨涓嬫媺妗� -->
+      <view class="fertilizer-station-selector">
+        <picker bindchange="onFertilizerStationChange" value="{{selectedFertilizerStationIndex}}" range="{{fertilizerStationList}}" range-key="name">
+          <view class="picker-container">
+            <text class="picker-label">閫夋嫨姘磋偉鏈猴細</text>
+            <view class="picker-value">
+              <text>{{fertilizerStationList[selectedFertilizerStationIndex].name || '璇烽�夋嫨姘磋偉鏈�'}}</text>
+              <image class="picker-arrow" src="/images/arrow-down.svg" />
+            </view>
+          </view>
+        </picker>
+      </view>
+
+      <!-- 姘磋偉鏈轰俊鎭崱鐗� -->
+      <view wx:if="{{currentFertilizerStation}}" class="fertilizer-info-card">
+        <!-- 鐘舵�佹爮 -->
+        <view class="status-bar">
+          <view class="status-item">
+            <view class="status-indicator {{currentFertilizerStation.onLine === true ? 'online' : 'offline'}}"></view>
+            <text class="status-text">{{currentFertilizerStation.onLine === true ? '鍦ㄧ嚎' : '绂荤嚎'}}</text>
+          </view>
+          <view class="refresh-btn" bind:tap="refreshFertilizerData">
+            <image class="refresh-icon" src="/images/refresh.svg" />
+            <text class="refresh-text">鍒锋柊</text>
+          </view>
+        </view>
+
+        <!-- 鎺у埗寮�鍏冲尯鍩� -->
+        <view class="control-switches">
+          <text class="section-title">鎺у埗寮�鍏�</text>
+          <view class="switch-container">
+            <!-- 鎼呮媽寮�鍏� -->
+            <view class="switch-item">
+              <text class="switch-label">鎼呮媽</text>
+              <switch class="custom-switch" checked="{{currentFertilizerStation.mixingEnabled}}" bindchange="toggleMixing" disabled="{{currentFertilizerStation.onLine !== true}}" color="#07c160" />
+            </view>
+
+            <!-- 娉ㄨ偉寮�鍏� -->
+            <view class="switch-item">
+              <text class="switch-label">娉ㄨ偉</text>
+              <switch class="custom-switch" checked="{{currentFertilizerStation.fertilizingEnabled}}" bindchange="toggleFertilizing" disabled="{{currentFertilizerStation.onLine !== true}}" color="#07c160" />
+            </view>
+          </view>
+        </view>
+
+        <!-- 鐩戞祴鏁版嵁鍖哄煙 -->
+        <view class="monitoring-data">
+          <text class="section-title">鐩戞祴鏁版嵁</text>
+          <view class="data-grid">
+            <!-- 鑲ユ枡娴侀噺 -->
+            <view class="data-item waste-flow">
+              <view class="data-icon">
+                <image src="/images/flow.svg" />
+              </view>
+              <view class="data-content">
+                <text class="data-label">鑲ユ枡娴侀噺(鍗�)</text>
+                <text class="data-value">{{currentFertilizerStation.manureFlow !== null && currentFertilizerStation.manureFlow !== undefined ? currentFertilizerStation.manureFlow : '--'}} L</text>
+              </view>
+            </view>
+
+            <!-- 娉ㄨ偉鏃堕暱 -->
+            <view class="data-item fertilizing-duration">
+              <view class="data-icon">
+                <image src="/images/timer.svg" />
+              </view>
+              <view class="data-content">
+                <text class="data-label">娉ㄨ偉鏃堕暱(绉�)</text>
+                <text class="data-value">{{currentFertilizerStation.manureTime !== null && currentFertilizerStation.manureTime !== undefined ? currentFertilizerStation.manureTime : '--'}} s</text>
+              </view>
+            </view>
+
+            <!-- 鎼呮媽鏃堕暱 -->
+            <view class="data-item mixing-duration">
+              <view class="data-icon">
+                <image src="/images/mixing.svg" />
+              </view>
+              <view class="data-content">
+                <text class="data-label">鎼呮媽鏃堕暱(绉�)</text>
+                <text class="data-value">{{currentFertilizerStation.stirTime !== null && currentFertilizerStation.stirTime !== undefined ? currentFertilizerStation.stirTime : '--'}} s</text>
+              </view>
+            </view>
+
+            <!-- 鎼呮媽璁惧畾鏃堕棿 -->
+            <view class="data-item mixing-set-time">
+              <view class="data-icon">
+                <image src="/images/settings.svg" />
+              </view>
+              <view class="data-content">
+                <text class="data-label">鎼呮媽璁惧畾鏃堕棿(绉�)</text>
+                <text class="data-value">{{currentFertilizerStation.stirDuration !== null && currentFertilizerStation.stirDuration !== undefined ? currentFertilizerStation.stirDuration : '--'}} s</text>
+              </view>
+            </view>
+
+            <!-- 娉ㄨ偉璁惧畾鏃堕棿 -->
+            <view class="data-item fertilizing-set-time">
+              <view class="data-icon">
+                <image src="/images/settings-time.svg" />
+              </view>
+              <view class="data-content">
+                <text class="data-label">娉ㄨ偉璁惧畾鏃堕棿(绉�)</text>
+                <text class="data-value">{{currentFertilizerStation.injectDuration !== null && currentFertilizerStation.injectDuration !== undefined ? currentFertilizerStation.injectDuration : '--'}} s</text>
+              </view>
+            </view>
+          </view>
+        </view>
+
+        <!-- 鏈�鍚庢洿鏂版椂闂� -->
+        <view class="last-update">
+          <text class="update-text">鏈�鍚庢洿鏂帮細{{currentFertilizerStation.dt || currentFertilizerStation.lastUpdate || '--'}}</text>
+        </view>
+      </view>
+
+      <!-- 鏃犳暟鎹彁绀� -->
+      <view wx:if="{{!currentFertilizerStation}}" class="no-data">
+        <image class="no-data-icon" src="/images/no-data.svg" />
+        <text class="no-data-text">璇烽�夋嫨姘磋偉鏈烘煡鐪嬫暟鎹�</text>
+      </view>
     </view>
 
     <!-- 鎽勫儚澶村唴瀹� -->
     <view wx:elif="{{activeTab === 'camera'}}" class="tab-content">
-
+      <!-- <text class="content-title">鎽勫儚澶寸洃鎺�</text> -->
 
       <!-- 鎽勫儚澶村垪琛� -->
       <view class="camera-list">
@@ -53,69 +435,57 @@
           <!-- 鎽勫儚澶村悕绉� -->
           <view class="camera-header">
             <text class="camera-name">{{item.name}}</text>
-            <view class="camera-status {{item.online ? 'online' : 'offline'}}">
-              <text>{{item.online ? '鍦ㄧ嚎' : '绂荤嚎'}}</text>
+            <view class="camera-status {{item.onLine === true ? 'online' : 'offline'}}">
+              <text>{{item.onLine === true ? '鍦ㄧ嚎' : '绂荤嚎'}}</text>
             </view>
           </view>
 
           <!-- 鎽勫儚澶磋棰� -->
-          <view class="camera-video-container">
-            <view wx:if="{{item.online}}" class="video-wrapper">
+          <view class="camera-video-container" >
+            <!-- 鍔犺浇鐘舵�� -->
+            <view wx:if="{{item.isLoadingUrl}}" class="video-loading">
+              <view class="loading-spinner"></view>
+              <text class="loading-text">姝e湪鑾峰彇鎾斁鍦板潃...</text>
+            </view>
+
+            <!-- 閿欒鐘舵�� -->
+            <view wx:elif="{{item.urlError}}" class="video-error">
+              <image class="error-icon" src="/images/error.svg" />
+              <text class="error-text">鑾峰彇鎾斁鍦板潃澶辫触</text>
+              <button class="retry-btn" bind:tap="retryGetHlsUrl" data-camera="{{item}}">
+                <image class="retry-icon" src="/images/refresh.svg" />
+                <text>閲嶈瘯</text>
+              </button>
+            </view>
+
+            <!-- 姝e父鎾斁鐘舵�� -->
+            <view wx:elif="{{item.onLine && item.hslUrl}}" class="video-wrapper">
               <!-- 鐩存挱鎾斁鍣ㄧ粍浠� -->
-              <ezplayer id="ezplayer" accessToken="at.2o04glgs0q36cjugbvddqujz7tqrghx1-1ovr6lmf3k-03pij3c-304ziif7e" url="rtmp://open.ys7.com/BA7248908/1/live" plugins="talk,voice,capture" recPlayTime="" width="360" height="300" watermark="shuiyin" theme="{{ { showFullScreenBtn: true, showHdBtn: true, showTimeLine: true } }}" bind:handleError="handleError" bind:onControlEvent="onControlEvent" />
-
-              <!-- 澶囩敤HLS鎾斁鍣� -->
-              <video wx:if="{{item.isPlaying && !item.rtmpUrl}}" class="live-player" src="{{item.hlsUrl}}" autoplay="{{true}}" muted="{{true}}" controls="{{false}}" object-fit="contain" bind:load="onVideoLoad" bind:play="onVideoPlay" bind:pause="onVideoPause" bind:ended="onVideoEnded" bind:error="onVideoError" data-camera="{{item}}" />
-
-              <!-- 瑙嗛鎺у埗瑕嗙洊灞� -->
-              <view class="video-overlay" wx:if="{{!item.isPlaying}}">
-                <view class="play-overlay" bind:tap="playVideo" data-camera="{{item}}">
-                  <image class="play-icon" src="/images/play.svg" />
-                </view>
-              </view>
-
-              <!-- 瑙嗛淇℃伅 -->
-              <view class="video-info">
-                <text class="video-time">{{item.lastUpdate}}</text>
-                <text class="video-status">{{item.isPlaying ? '鐩存挱涓�' : '宸插仠姝�'}}</text>
-              </view>
-
-              <!-- 鎾斁鎺у埗鎸夐挳 -->
-              <view class="video-controls" wx:if="{{item.isPlaying}}">
-                <view class="control-btn" bind:tap="pauseVideo" data-camera="{{item}}">
-                  <image class="control-icon" src="/images/pause.svg" />
-                </view>
-                <view class="control-btn" bind:tap="stopVideo" data-camera="{{item}}">
-                  <image class="control-icon" src="/images/stop.svg" />
-                </view>
-              </view>
-
-              <!-- 璋冭瘯鎸夐挳 -->
-              <view class="debug-controls">
-                <view class="debug-btn" bind:tap="testVideoUrl" data-camera="{{item}}">
-                  <text>娴嬭瘯URL</text>
-                </view>
-              </view>
+              <ezplayer class="video-wrapper-ezplayer" id="ezplayer-{{item.id}}" accessToken="{{item.accessToken}}" url="{{item.hslUrl}}" deviceSerial="{{item.deviceSerial}}" channelNo="1" plugins="capture,ptz,mirror" watermark="澶х" autoPlay="{{true}}" theme="{{ { showFullScreenBtn: true, showHdBtn: true, showTimeLine: true } }}" bind:handleError="handleError" bind:onControlEvent="onControlEvent" />
             </view>
 
-            <!-- 绂荤嚎鐘舵�� -->
-            <view wx:else class="video-offline">
-              <image class="offline-icon" src="/images/offline.svg" />
-              <text class="offline-text">鎽勫儚澶寸绾�</text>
+            <!-- 绂荤嚎鐘舵�佹樉绀� -->
+            <view wx:elif="{{!item.onLine}}" class="video-offline">
+              <image class="offline-icon" src="/images/camera.svg" />
+              <text class="offline-text">璁惧绂荤嚎</text>
+            </view>
+
+            <!-- 鏃犳挱鏀惧湴鍧�鐘舵�� -->
+            <view wx:else class="video-no-url">
+              <image class="no-url-icon" src="/images/camera.svg" />
+              <text class="no-url-text">鏆傛棤鎾斁鍦板潃</text>
             </view>
           </view>
 
-          <!-- 鎽勫儚澶存搷浣滄寜閽� -->
-          <view class="camera-actions">
-            <button class="action-btn {{item.online ? 'primary' : 'disabled'}}" disabled="{{!item.online}}" bind:tap="fullscreenVideo" data-camera="{{item}}">
-              鍏ㄥ睆鎾斁
-            </button>
-            <button class="action-btn secondary" bind:tap="cameraSettings" data-camera="{{item}}">
-              璁剧疆
-            </button>
-          </view>
+
         </view>
       </view>
+
+      <!-- 鏃犳暟鎹彁绀� -->
+      <view wx:if="{{cameraList.length === 0}}" class="no-data">
+        <image class="no-data-icon" src="/images/no-data.svg" />
+        <text class="no-data-text">鏆傛棤鎽勫儚澶磋澶�</text>
+      </view>
     </view>
   </view>
 </view>
\ No newline at end of file

--
Gitblit v1.8.0