From 0b939dd6181d5a435c171a4721188f018086add7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=BA=8F=E6=8C=AF?= Date: Thu, 21 Mar 2024 15:30:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=AE=BE=E5=A4=87=E5=B7=A1?= =?UTF-8?q?=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.ts | 1 + src/pages/equipment/index.tsx | 90 ++++++++++++++++++++++++++- src/pages/inspection/index.config.ts | 3 + src/pages/inspection/index.tsx | 92 ++++++++++++++++++++++++++++ 4 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 src/pages/inspection/index.config.ts create mode 100644 src/pages/inspection/index.tsx diff --git a/src/app.config.ts b/src/app.config.ts index 74a6e3a..3682eeb 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -11,6 +11,7 @@ export default defineAppConfig({ // 跳转页面 'pages/weatherStation/index', // 气象站 + 'pages/inspection/index', // 气象站(巡检) 'pages/msgDetail/index', // 消息详情 'pages/soilMoisture/index', // 土壤墒情 'pages/envMonitor/index', // 棚内环境监测 diff --git a/src/pages/equipment/index.tsx b/src/pages/equipment/index.tsx index fefec37..53680a7 100644 --- a/src/pages/equipment/index.tsx +++ b/src/pages/equipment/index.tsx @@ -1,9 +1,93 @@ import { View } from "@tarojs/components" +import { useState } from "react" +import Taro from "@tarojs/taro" const EquipMent = () => { - return ( - Equ - ) + const [selectedMenuId, setSelectedMenuId] = useState('all') + const topMenus = [ + { + id: '1', + title: '基地1' + }, + { + id: '2', + title: '基地2' + }, + { + id: '3', + title: '基地3' + }, + ] + + const dataList = [ + { + id: '1', + }, + { + id: '2', + }, + { + id: '3', + }, + ] + return ( + + + + { + topMenus.map(item => { + return ( + setSelectedMenuId(item.id)} + >{ item.title } + ) + }) + } + + + { + dataList.map(item => { + return ( + { + // Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id }) + // }} + > + {/* + + */} + + 气象站 + + + 已巡检 + 3 + + + 未巡检 + 3 + + + + { + Taro.navigateTo({ url: '/pages/inspection/index?id=' + item.id}) + }} + >去巡检 + + ) + }) + } + + + + ) } export default EquipMent; \ No newline at end of file diff --git a/src/pages/inspection/index.config.ts b/src/pages/inspection/index.config.ts new file mode 100644 index 0000000..e6b75f9 --- /dev/null +++ b/src/pages/inspection/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '气象站' +}) \ No newline at end of file diff --git a/src/pages/inspection/index.tsx b/src/pages/inspection/index.tsx new file mode 100644 index 0000000..33a06d6 --- /dev/null +++ b/src/pages/inspection/index.tsx @@ -0,0 +1,92 @@ +import { View, Image } from "@tarojs/components" +import { useState } from "react" +import Taro from "@tarojs/taro" +import PageWrapper from "../../components/customized/pageWrapper" + +const EquipMent = () => { + const [selectedMenuId, setSelectedMenuId] = useState('all') + const topMenus = [ + { + id: '1', + title: '已巡检' + }, + { + id: '2', + title: '未巡检' + } + ] + + const dataList = [ + { + id: '1', + }, + { + id: '2', + }, + { + id: '3', + }, + ] + return ( + + + + + { + topMenus.map(item => { + return ( + setSelectedMenuId(item.id)} + >{ item.title } + ) + }) + } + + + { + dataList.map(item => { + return ( + + + 设备1 + 上次巡检 2023-1-11 + + { + Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id}) + }} + >巡检日志 + { + Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id}) + }} + >去巡检 + + + { '在线' } + + + ) + }) + } + + + + + + ) +} + +export default EquipMent; \ No newline at end of file