This commit is contained in:
Tony 2024-03-22 10:02:32 +08:00
parent f6a72fefc9
commit b385cffb26
10 changed files with 221 additions and 123 deletions

View File

@ -1,56 +1,56 @@
{
"miniprogramRoot": "dist/",
"projectname": "taro-react-tailwind-vscode-template",
"description": "",
"appid": "wxc422ab9e3d9174d8",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
"miniprogramRoot": "dist/",
"projectname": "taro-react-tailwind-vscode-template",
"description": "",
"appid": "wx22cc65a14ab1a16d",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"compileType": "miniprogram",
"libVersion": "2.30.3",
"srcMiniprogramRoot": "dist/",
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"condition": {}
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
},
"compileType": "miniprogram",
"libVersion": "2.30.3",
"srcMiniprogramRoot": "dist/",
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"condition": {}
}

View File

@ -1,21 +1,8 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "taro-react-tailwind-vscode-template",
"setting": {
"compileHotReLoad": false
},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "taro-demo",
"setting": {
"compileHotReLoad": true
},
"condition": {}
}

View File

@ -12,6 +12,8 @@ export default defineAppConfig({
// 跳转页面
'pages/weatherStation/index', // 气象站
'pages/inspection/index', // 气象站(巡检)
'pages/inspectionContent/index', // 气象站(巡检内容表单)
'pages/inspectionLog/index', // 气象站(巡检日志)
'pages/msgDetail/index', // 消息详情
'pages/soilMoisture/index', // 土壤墒情
'pages/envMonitor/index', // 棚内环境监测

View File

@ -20,7 +20,9 @@ const PageWrapper = ({ children, title = '' }) => {
}}
>
<HeaderNation title={title}></HeaderNation>
{ children }
<View style={{ height: `calc(100% - ${globalData.appHeaderHeight}px)` }}>
{ children }
</View>
</View>
</View>
)

View File

@ -17,18 +17,7 @@ import HeaderNation from "../../components/customized/navigation";
import { globalData } from "../../config";
const Index = () => {
const { statusBarHeight = 0, screenHeight } = Taro.getSystemInfoSync()
// 获取胶囊信息
const { height, top } = Taro.getMenuButtonBoundingClientRect()
// 计算标题栏高度
const titleBarHeight = height + (top - statusBarHeight) * 2
// 计算导航栏高度
const appHeaderHeight = statusBarHeight + titleBarHeight
//去掉导航栏,屏幕剩余的高度
const contentHeight = screenHeight - appHeaderHeight * 2
console.log('titleBarHeight', titleBarHeight);
console.log('contentHeight', contentHeight);
console.log('appHeaderHeight', appHeaderHeight);
// Taro.navigateTo({ url: '/pages/inspectionLog/index' })
const [curSelectedItem, setCurSelectedItem] = useState('iot')
Taro.setNavigationBarTitle({ title: '物联网' })

View File

@ -0,0 +1,69 @@
import { Label, Radio, RadioGroup, Input, View, Textarea, Button } from "@tarojs/components"
import PageWrapper from "../../components/customized/pageWrapper";
import Taro from "@tarojs/taro";
const FormItem = ({ children, label = '' }) => {
return (
<View className="flex items-center border-b border-slate-400 p-3">
<View className="w-[5rem]">{ label }</View>
{ children }
</View>
)
}
const InspectionContent = () => {
return (
<PageWrapper title="巡检内容">
<View className="h-[3rem] flex items-center px-7 border" style={{ color: 'white' }}>1--1NKWFDS1AW27</View>
<View className="bg-white rounded-2xl p-6 relative" style={{ height: 'calc(100% - 3rem)'}}>
<FormItem label="巡检结果">
<RadioGroup>
<Label className='radio-list__label' for={'0'} key={0}>
<Radio className='radio-list__radio' value={'0'} checked={false}></Radio>
</Label>
<Label className='radio-list__label ml-4' for={'1'} key={1}>
<Radio className='radio-list__radio' value={'0'} checked={false}></Radio>
</Label>
</RadioGroup>
</FormItem>
<View className="flex items-start border-b border-slate-400 p-3">
<View className="w-[5rem]"></View>
<Textarea placeholder="请输入巡检内容" className="h-[3rem] pl-3"></Textarea>
</View>
<FormItem label="巡检人">
<Input placeholder="请输入巡检人"></Input>
</FormItem>
<FormItem label="巡检时间">
<Input placeholder="请输入巡检时间"></Input>
</FormItem>
<View className="p-3">
<View className="w-[5rem]"></View>
<View
onClick={() => {
Taro.chooseImage({
count: 1,
complete: () => {
console.log('complete');
},
fail: () => {
console.log('fail');
},
success: () => {
console.log('success');
}
})
}}
></View>
</View>
<View className="absolute bottom-3 left-0 p-4 w-full">
<Button
className="rounded-full border flex justify-center items-center"
style={{ background: 'linear-gradient(to right, #19b3c3, #10c87e);', color: 'white' }}
></Button>
</View>
</View>
</PageWrapper>
)
}
export default InspectionContent;;

View File

@ -0,0 +1,20 @@
import { Input, View } from "@tarojs/components"
import PageWrapper from "../../components/customized/pageWrapper";
const InspectionLog = () => {
return (
<PageWrapper title="巡检日志">
<View className="h-[3rem] flex items-center px-7" style={{ color: 'white' }}>
<View className="bg-white rounded-full w-full shadow-xl py-2 px-4">
<Input placeholder="输入设备号\设备名称"></Input>
</View>
</View>
<View
className="bg-white rounded-2xl p-6 relative overflow-auto"
style={{ height: 'calc(100% - 3rem)'}}
></View>
</PageWrapper>
)
}
export default InspectionLog;

View File

@ -129,20 +129,20 @@ const Iot = () => {
<Image src={img} className="w-12 h-12"></Image>
</View>
<View className="w-full flex flex-col justify-between items-start pb-1">
<View className="text-lg pb-1">{ item.title }</View>
<View className="w-full flex justify-between items-center space-x-2">
<View className="flex items-center space-x-1">
<View className="flex items-center"><Image src={onlineIcon} className="w-5 h-5"></Image></View>
<View className=" text-base pb-1 pt-1" style={{ fontFamily: 'ArtFont', color: '#252525D0' }}>{ item.title }</View>
<View className="w-full flex justify-between items-center space-x-2 text-xs">
<View className="flex items-center space-x-1 pb-1">
<View className="flex items-center"><Image src={onlineIcon} className="w-4 h-4"></Image></View>
<View>线</View>
<View>3</View>
</View>
<View className="flex items-center space-x-1">
<View className="flex items-center"><Image src={offlineIcon} className="w-5 h-5"></Image></View>
<View className="flex items-center"><Image src={offlineIcon} className="w-4 h-4"></Image></View>
<View>线</View>
<View>3</View>
</View>
<View className="flex items-center space-x-1">
<View className="flex items-center"><Image src={errorIcon} className="w-5 h-5"></Image></View>
<View className="flex items-center"><Image src={errorIcon} className="w-4 h-4"></Image></View>
<View></View>
<View>3</View>
</View>

View File

@ -1,10 +1,9 @@
.cont{
padding: 10px 15px ;
padding: 10px 15px;
width: 100%;
background-color: #fff;
display: flex;
align-items: center;
margin-top: 25px;
border-radius: 15px;
justify-content: space-between;
.right{

View File

@ -4,6 +4,7 @@ import warn from './assets/warn.png'
import rang from './assets/rang.png'
import './index.scss'
import Taro from "@tarojs/taro"
import TabWrapper from "../../components/customized/tabWrapper"
const MsgCenter = () => {
const [selectedMenuId, setSelectedMenuId] = useState('all')
let contList=[
@ -35,6 +36,48 @@ const MsgCenter = () => {
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
{
title:'虫情预警',
url:'./assets/rang.png',
time:'2024/3/13 6:30',
message:'1号棚内虫害数量接近阈值预警',
id:'1'
},
]
const topMenus = [
{
@ -69,41 +112,28 @@ const MsgCenter = () => {
}
});
return (
<View>
<View className='flex px-2 py-1' style={{ position:'relative' }}>
<View className="px-1 h-full">
<View className="h-full flex flex-col justify-start">
<TabWrapper options={topMenus} selectedId={selectedMenuId} callback={setSelectedMenuId}></TabWrapper>
<View className='flex flex-col space-y-3 p-2' style={{ overflow: 'auto', height: 'calc(100% - 2.4rem)' }}>
{
topMenus.map(item => {
contList.map((item,index)=>{
return (
<View
className={`p-1 px-3 ${selectedMenuId === item.id ? 'text-lime-600 border-b-4 border-lime-800' : ''}`}
key={item.id}
style={{color:'#fff'}}
onClick={() => setSelectedMenuId(item.id)}
>{ item.title }</View>
<View className='rounded-md shadow-xl cont' key={index} onClick={() => { Taro.navigateTo({ url: '/pages/msgDetail/index' }) }}>
<Image src={item.id=='1'|| item.id=='2'?rang:warn} className='w-11 h-11' style={{marginTop:'-10px'}}></Image>
<View className='right'>
<View className='right-top'>
<View className='top-left'>{item.title}</View>
<View className='top-right'>{item.time}</View>
</View>
<View className={item.id=='1'|| item.id=='2'?'rang':'warn'}>{item.message}</View>
</View>
</View>
)
})
}
<View style={{padding:'0 5px', position:'absolute',left:'27%',fontSize:'10px',backgroundColor:'red',color:'#fff',borderRadius:'10px'}}>{val}</View>
<View style={{padding:'0 5px', position:'absolute',left:'42%',fontSize:'10px',backgroundColor:'red',color:'#fff',borderRadius:'10px'}}>{val2}</View>
</View>
<View className='main'>
{
contList.map((item,index)=>{
return (
<View className='rounded-md shadow-xl cont' key={index} onClick={() => { Taro.navigateTo({ url: '/pages/msgDetail/index' }) }}>
<Image src={item.id=='1'|| item.id=='2'?rang:warn} className='w-11 h-11' style={{marginTop:'-10px'}}></Image>
<View className='right'>
<View className='right-top'>
<View className='top-left'>{item.title}</View>
<View className='top-right'>{item.time}</View>
</View>
<View className={item.id=='1'|| item.id=='2'?'rang':'warn'}>{item.message}</View>
</View>
</View>
)
})
}
</View>
</View>
</View>
)