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