李志伟 3 gadus atpakaļ
vecāks
revīzija
50a2debbe8

Binārs
src/assets/machinery/repairMachinery.png Parādīt failu


+ 2
- 2
src/components/Jianbian/index.jsx Parādīt failu

@@ -6,14 +6,14 @@ export default (props) => {
6 6
   return (
7 7
     <View className={['jianbian',
8 8
       type == 'machinery' ?
9
-        (value ? 'workingClass' : 'waitClass') :
9
+        (status == 0 ? 'overClass' : (!value || value == 3) ? 'waitClass' : 'workingClass') :
10 10
         status == 0 ? 'waitClass' :
11 11
           status == 1 || status == 2 ? 'workingClass' :
12 12
             status == 3 ? 'overClass' : ''
13 13
     ]}
14 14
     >
15 15
       <View className='text'>
16
-        {type == 'machinery' ? (value ? '使用中' : '空闲中') : status == 0 ? '待作业' : status == 1 || status == 2 ? '进行中' : status == 3 ? '已完成' : ''}
16
+        {type == 'machinery' ? (status == 0 ? '维修中' : (!value || value == 3) ? '空闲中' : '使用中') : status == 0 ? '待作业' : status == 1 || status == 2 ? '进行中' : status == 3 ? '已完成' : ''}
17 17
       </View>
18 18
     </View>
19 19
   )

+ 5
- 1
src/components/MyCard/index.jsx Parādīt failu

@@ -19,7 +19,11 @@ export default (props) => {
19 19
         }
20 20
       </View>
21 21
       <View className='line' />
22
-      <MyCell header='农机名称'>{value?.machineryName}</MyCell>
22
+      {
23
+        job?
24
+        <MyCell header='农机名称'>{value?.machineryName}</MyCell>:
25
+        <MyCell header='农机类型'>{value?.typeName}</MyCell>
26
+      }
23 27
       <MyCell header='下单人'>{value?.personName}</MyCell>
24 28
       <MyCell header='手机号'>{value?.phone}</MyCell>
25 29
       <MyCell header='订单时间'>{value?.createDate.substr(0,10)}</MyCell>

+ 1
- 2
src/pages/index/components/User/index.jsx Parādīt failu

@@ -16,7 +16,6 @@ import bankCard from '@/assets/user/bankCard.png'
16 16
 import './style.less'
17 17
 
18 18
 export default (props) => {
19
-  const { setPhone } = useModel('phone')
20 19
   const { person } = useModel('person')
21 20
 
22 21
   const handleAccount = () => {
@@ -43,7 +42,7 @@ export default (props) => {
43 42
   return (
44 43
     <ScrollView scrollY style={{ height: '100%' }}>
45 44
       <View className='personTip'>该账号归{person.nickName||'张三'}所属</View>
46
-      <View className='userHead'>
45
+      <View className='userHead' onClick={handleAccount}>
47 46
         <Image src={userBgi} className='userBgi' />
48 47
         <View className='headcontent' >
49 48
           <Image src={person.avatar||avatar} className='avatar' />

+ 1
- 1
src/pages/machineryDetail/index.jsx Parādīt failu

@@ -38,7 +38,7 @@ export default withLayout((props) => {
38 38
             ))}
39 39
           </Swiper>
40 40
           <View className='detailContent'>
41
-            <Jianbian value={machinery?.jobStatus} type='machinery' />
41
+            <Jianbian value={machinery?.jobStatus} status={machinery?.status} type='machinery' />
42 42
             <View className='detialName'>{machinery?.name}</View>
43 43
             <View className='title'>
44 44
               <Image src={micon} className='detailIcon' />

+ 1
- 1
src/pages/machineryList/Card/index.jsx Parādīt failu

@@ -6,7 +6,7 @@ export default (props) => {
6 6
   const { value, onClick, goMap } = props
7 7
   return (
8 8
     <View className='machineryCard'>
9
-      <Jianbian value={value.jobStatus} type='machinery' />
9
+      <Jianbian value={value.jobStatus} status={value.status} type='machinery' />
10 10
       <Image src={value.thumb}  mode='aspectFill' onClick={onClick} />
11 11
       <View className='info'>
12 12
         <View className='machineryName' onClick={onClick} >{value.name}</View>

+ 12
- 11
src/pages/machineryMap/index.jsx Parādīt failu

@@ -5,13 +5,14 @@ import withLayout from '@/layouts'
5 5
 import { getMachineryList } from '@/services/machinery'
6 6
 import { useModel } from "@/store"
7 7
 import CustomNav from "@/components/CustomNav"
8
-import MachineryModel from './Model'
9 8
 import m1 from '@/assets/machinery/greenMachinery.png'
10 9
 import m2 from '@/assets/machinery/orangeMachinery.png'
10
+import m3 from '@/assets/machinery/repairMachinery.png'
11
+import MachineryModel from './Model'
11 12
 import './style.less'
12 13
 
13 14
 
14
-export default withLayout((props) => {  
15
+export default withLayout((props) => {
15 16
   const { router } = props
16 17
   const { id } = router.params
17 18
   const [show, setShow] = useState(false)
@@ -19,8 +20,8 @@ export default withLayout((props) => {
19 20
   const [machineryList, setMachineryList] = useState([])
20 21
   const [markerList, setMarkerList] = useState([])
21 22
   const [current, setCurrent] = useState()
22
-  const [lot,setLot]=useState(112.106514)
23
-  const [lat,setLat]=useState(32.685927)
23
+  const [lot, setLot] = useState(112.106514)
24
+  const [lat, setLat] = useState(32.685927)
24 25
 
25 26
   const locList = [
26 27
     {
@@ -74,13 +75,13 @@ export default withLayout((props) => {
74 75
   const goList = () => {
75 76
     Taro.navigateTo({ url: '/pages/machineryList/index' });
76 77
   }
77
-  const changeRegion=()=>{
78
+  const changeRegion = () => {
78 79
     setShow(false)
79 80
   }
80
-  useEffect(()=>{
81
-    if (id&&machineryList&&markerList.length!=0) {
82
-      machineryList.forEach((item,index)=>{
83
-        if(item.machineryId==id){ 
81
+  useEffect(() => {
82
+    if (id && machineryList && markerList.length != 0) {
83
+      machineryList.forEach((item, index) => {
84
+        if (item.machineryId == id) {
84 85
           setLot(markerList[index].longitude)
85 86
           setLat(markerList[index].latitude)
86 87
           setCurrent(machineryList[index])
@@ -89,7 +90,7 @@ export default withLayout((props) => {
89 90
         }
90 91
       })
91 92
     }
92
-  },[id, machineryList, markerList])
93
+  }, [id, machineryList, markerList])
93 94
   useEffect(() => {
94 95
     getMachineryList({ location: location }).then((res) => {
95 96
       setMachineryList(res.records)
@@ -98,7 +99,7 @@ export default withLayout((props) => {
98 99
           id: index,
99 100
           longitude: locList[index % 10].longitude,
100 101
           latitude: locList[index % 10].latitude,
101
-          iconPath: item.jobStatus?m1:m2,
102
+          iconPath: item.status == 0 ? m3 : (item.jobStatus || item.jobStatus == 3) ? m2 : m1,
102 103
           width: 50,
103 104
           height: 50
104 105
         }