Jelajahi Sumber

更新模块控制菜单

丁烨烨 1 tahun lalu
induk
melakukan
b5d1cc9ec9

+ 9 - 3
pages.json

@@ -11,6 +11,12 @@
 				"navigationBarTitleText": "事件列表"
 			}
 		},
+		{
+			"path": "pages/VisualControl/index",
+			"style": {
+				"navigationBarTitleText": "模块控制"
+			}
+		},
 		{
 			"path": "pages/my/index",
 			"style": {
@@ -38,7 +44,7 @@
 	],
 	"tabBar": {
 		"color": "#999999",
-		"selectedColor": "#ff0000",
+		"selectedColor": "#black",
 		"backgroundColor": "#ffffff",
 		"borderStyle": "black",
 		"list": [
@@ -57,9 +63,9 @@
 		]
 	},
 	"globalStyle": {
-		"navigationBarTextStyle": "black",
+		"navigationBarTextStyle": "#FFFFFF",
 		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "#F8F8F8",
+		"navigationBarBackgroundColor": "#2979ff",
 		"backgroundColor": "#F8F8F8",
 		"app-plus": {
 			"background": "#efeff4"

+ 227 - 0
pages/VisualControl/index.vue

@@ -0,0 +1,227 @@
+
+<template>
+  <view class="container">
+    <!-- 天气控制 -->
+    <view class="weather-section">
+      <view 
+        v-for="(weather, index) in weathers" 
+        :key="index"
+        :class="['weather-item', { active: currentWeather === weather.type }]"
+        @click="handleWeatherChange(weather.type)"
+      >
+        <uni-icons :type="weather.icon" size="30" :color="currentWeather === weather.type ? '#ffffff' : '#333333'" />
+        <text class="weather-text">{{ weather.name }}</text>
+      </view>
+    </view>
+
+    <!-- 时区控制 -->
+    <view class="time-section">
+      <view 
+        v-for="(time, index) in times" 
+        :key="index"
+        :class="['time-item', { active: currentTime === time.type }]"
+        @click="handleTimeChange(time.type)"
+      >
+        <uni-icons :type="time.icon" size="24" :color="currentTime === time.type ? '#ffffff' : '#333333'" />
+        <text class="time-text">{{ time.name }}</text>
+      </view>
+    </view>
+
+    <!-- 模块控制 -->
+    <view class="module-section">
+      <view 
+        v-for="(module, index) in modules" 
+        :key="index"
+        class="module-item"
+        @click="handleModuleClick(module.type)"
+      >
+        <view class="module-icon">
+          <uni-icons :type="module.icon" size="36" color="#2979ff" />
+        </view>
+        <text class="module-name">{{ module.name }}</text>
+        <text class="module-status">{{ module.status }}</text>
+      </view>
+    </view>
+	
+	<view class="initialization">
+		<button type="primary">
+			初始化选项
+		</button>
+	</view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue';
+
+// 天气类型
+type WeatherType = 'sunny' | 'foggy' | 'rainy' | 'snowy';
+const currentWeather = ref<WeatherType>('sunny');
+
+// 时间类型
+type TimeType = 'morning' | 'noon' | 'night';
+const currentTime = ref<TimeType>('morning');
+
+// 模块类型
+type ModuleType = 'overview' | 'security' | 'energy' | 'fire' | 'lamp' | 'passage';
+
+// 天气数据
+const weathers = [
+  { type: 'sunny', name: '晴天', icon: 'sun' },
+  { type: 'foggy', name: '雾天', icon: 'cloud' },
+  { type: 'rainy', name: '雨天', icon: 'rain' },
+  { type: 'snowy', name: '雪天', icon: 'snow' }
+];
+
+// 时间数据
+const times = [
+  { type: 'morning', name: '早上', icon: 'sun' },
+  { type: 'noon', name: '中午', icon: 'sun-filled' },
+  { type: 'night', name: '夜晚', icon: 'moon' }
+];
+
+// 模块数据
+const modules = [
+  { type: 'overview', name: '园区总览', icon: 'map', status: '运行正常' },
+  { type: 'security', name: '智慧安防', icon: 'contact', status: '无异常' },
+  { type: 'energy', name: '智慧能耗', icon: 'list', status: '节能运行' },
+  { type: 'fire', name: '智慧消防', icon: 'fire', status: '系统正常' },
+  { type: 'lamp', name: '智慧灯杆', icon: 'map-pin-ellipse', status: '照明正常' },
+  { type: 'passage', name: '智慧通行', icon: 'staff', status: '通行顺畅' }
+];
+
+// 处理天气变化
+const handleWeatherChange = (type: WeatherType) => {
+  currentWeather.value = type;
+};
+
+// 处理时间变化
+const handleTimeChange = (type: TimeType) => {
+  currentTime.value = type;
+};
+
+// 处理模块点击
+const handleModuleClick = (type: ModuleType) => {
+  console.log('点击模块:', type);
+};
+</script>
+
+<style>
+page {
+  height: 100%;
+}
+
+.container {
+  min-height: 100%;
+  padding: 30rpx;
+  background-color: #f5f5f5;
+}
+
+.weather-section {
+  display: flex;
+  justify-content: space-between;
+  padding: 20rpx;
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  margin-bottom: 30rpx;
+}
+
+.weather-item {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 20rpx 30rpx;
+  border-radius: 12rpx;
+  transition: all 0.3s;
+}
+
+.weather-item.active {
+  background-color: #2979ff;
+}
+
+.weather-text {
+  margin-top: 10rpx;
+  font-size: 14px;
+  color: #333333;
+}
+
+.weather-item.active .weather-text {
+  color: #ffffff;
+}
+
+.time-section {
+  display: flex;
+  justify-content: space-around;
+  padding: 20rpx;
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  margin-bottom: 30rpx;
+}
+
+.time-item {
+  display: flex;
+  align-items: center;
+  padding: 16rpx 40rpx;
+  border-radius: 12rpx;
+  transition: all 0.3s;
+}
+
+.time-item.active {
+  background-color: #2979ff;
+}
+
+.time-text {
+  margin-left: 10rpx;
+  font-size: 14px;
+  color: #333333;
+}
+
+.time-item.active .time-text {
+  color: #ffffff;
+}
+
+.module-section {
+  display: grid;
+  grid-template-columns: repeat(2, 1fr);
+  gap: 20rpx;
+}
+
+.module-item {
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  padding: 30rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  transition: transform 0.3s;
+}
+
+.module-item:active {
+  transform: scale(0.98);
+}
+
+.module-icon {
+  width: 80rpx;
+  height: 80rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-bottom: 20rpx;
+}
+
+.module-name {
+  font-size: 16px;
+  color: #333333;
+  margin-bottom: 10rpx;
+}
+
+.module-status {
+  font-size: 12px;
+  color: #666666;
+}
+
+.initialization{
+	margin-top: 12px;
+}
+</style>
+

+ 29 - 2
pages/index/index.vue

@@ -38,7 +38,20 @@
           </view>
           <uni-icons type="right" size="20" color="#666"/>
         </view>
+		
+		<!-- 可视化菜单控制卡片 -->
+		<view class="function-card viual-control" @click="toVisualControl">
+		  <view class="card-content">
+		    <image class="card-image" :src="VisualControl" mode="aspectFill" />
+		    <view class="card-info">
+		      <text class="card-title">模块控制</text>
+		      <text class="card-desc">设备运行正常</text>
+		    </view>
+		  </view>
+		  <uni-icons type="right" size="20" color="#666"/>
+		</view>
       </view>
+	  
 
       <!-- 状态概览 -->
       <view class="status-overview">
@@ -75,9 +88,19 @@ const toPoleList = () => {
 	})
 }
 
-const eventCenterImage = ref('https://ai-public.mastergo.com/ai/img_res/c17e4608f5722aa86a58cc8c7a35eccf.jpg');
 
-const poleControlImage = ref('https://ai-public.mastergo.com/ai/img_res/4dc77feb78b19b69c2ac630128735a8b.jpg');
+const toVisualControl = () => {
+	console.log(1112)
+	uni.navigateTo({
+		url:"/pages/VisualControl/index"
+	})
+}
+
+const eventCenterImage = ref('../../static/viualControlImg/sjzx.png');
+
+const poleControlImage = ref('../../static/viualControlImg/dgkz.png');
+
+const VisualControl = ref('../../static/viualControlImg/mkkz.png');
 </script>
 
 <style>
@@ -194,6 +217,10 @@ page {
   border-left: 8rpx solid #2B5DE0;
 }
 
+.viual-control {
+  border-left: 8rpx solid #66b890;
+}
+
 .status-overview {
   display: grid;
   grid-template-columns: repeat(3, 1fr);

TEMPAT SAMPAH
static/viualControlImg/dgkz.png


TEMPAT SAMPAH
static/viualControlImg/foggy.png


TEMPAT SAMPAH
static/viualControlImg/mkkz.png


TEMPAT SAMPAH
static/viualControlImg/morning.png


TEMPAT SAMPAH
static/viualControlImg/night.png


TEMPAT SAMPAH
static/viualControlImg/noon.png


TEMPAT SAMPAH
static/viualControlImg/rainy.png


TEMPAT SAMPAH
static/viualControlImg/sjzx.png


TEMPAT SAMPAH
static/viualControlImg/snowy.png


TEMPAT SAMPAH
static/viualControlImg/sunny.png