李志伟 3 vuotta sitten
vanhempi
commit
b03a8765c0

+ 2
- 0
project.private.config.json Näytä tiedosto

@@ -1,4 +1,6 @@
1 1
 {
2
+  "projectname": "machinery-person",
3
+  "appid": "wx6d749c13e3f8b39a",
2 4
   "setting": {},
3 5
   "condition": {
4 6
     "plugin": {

+ 3
- 3
src/components/Jianbian/index.jsx Näytä tiedosto

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

+ 1
- 1
src/components/MyButton/index.jsx Näytä tiedosto

@@ -3,5 +3,5 @@ import './style.less'
3 3
 
4 4
 export default (props) => {
5 5
   const { value,loading, onClick } = props
6
-  return <Button className='myBtn' disabled={loading} onClick={onClick}>{value}</Button>
6
+  return <Button className={value=='完成作业'?'myBtnOver':'myBtn'} disabled={loading} onClick={onClick}>{value}</Button>
7 7
 }

+ 9
- 0
src/components/MyButton/style.less Näytä tiedosto

@@ -6,4 +6,13 @@
6 6
   background: linear-gradient(0deg, #00AE39,#A0E067);
7 7
   border-radius: 49px;
8 8
   margin: 25px 0 18px;
9
+}
10
+.myBtnOver{
11
+  font-size: 34px;
12
+  font-weight: bold;
13
+  line-height: 94px;
14
+  color: #fff;
15
+  background: linear-gradient(0deg, #FF703B,#FFAB8C);
16
+  border-radius: 49px;
17
+  margin: 25px 0 18px;
9 18
 }

+ 2
- 2
src/components/MyCard/index.jsx Näytä tiedosto

@@ -10,7 +10,7 @@ export default (props) => {
10 10
   
11 11
   return (
12 12
     <View className='card'>
13
-      <Jianbian status='1' />
13
+      <Jianbian status={job?value?.status:value?.workStatus} />
14 14
       <View className='cardHead'>
15 15
         {
16 16
           job && <MyCell header='需求时间' job action='详情>>' handleAction={goDetail}>2022-06-02</MyCell>
@@ -30,7 +30,7 @@ export default (props) => {
30 30
       <MyCell header='作业时间'>上午06:00--晚上21:00</MyCell>
31 31
       <MyCell header='订单费用'>{(value?.charges&&value.charges/100)||600}元</MyCell>
32 32
       {
33
-        job && <MyButton value='开始作业' onClick={onClick} />
33
+        job &&value.status!=3&& <MyButton value={value.status==0?'开始作业':'完成作业'} onClick={onClick} />
34 34
       }
35 35
       {
36 36
         order && <View className='line' />

+ 112
- 31
src/pages/index/components/Job/index.jsx Näytä tiedosto

@@ -1,42 +1,123 @@
1 1
 import Taro from "@tarojs/taro";
2
-import { View, ScrollView, Image, Button } from "@tarojs/components"
3
-import MyCard from "@/components/MyCard"
4
-import { Popup } from "@antmjs/vantui";
5
-import { useState } from "react";
6
-import PositionImg from '@/assets/job/positionImg.png'
2
+import { useState, useEffect } from "react";
3
+import { View, Input, Image, Text, ScrollView } from "@tarojs/components"
4
+import CustomNav from "@/components/CustomNav";
5
+import searchImg from '@/assets/comm/search.png'
6
+import withLayout from '@/layouts'
7
+import NullCard from "@/components/NullCard";
8
+import MyCard from "@/components/MyCard";
9
+import Footer from "@/components/Footer";
10
+import { getOrderList } from "@/services/order";
7 11
 import './style.less'
8 12
 
9
-export default (props) => {
10
-  const [show, setShow] = useState(false)
11
-  const handleChange = () => {
12
-    setShow(true)
13
+export default () => {
14
+  const [imageShow, setImageShow] = useState(true)
15
+  const [currentTab, setCurrentTab] = useState(0);
16
+  const [orderList, setOrderList] = useState([])
17
+  
18
+  const [currentPage, setCurrentPage] = useState(1)
19
+  const [isMore, setIsMore] = useState(false)
20
+  const [q, setQ] = useState()
21
+
22
+  const handleSearch = (e) => {
23
+    if (e.detail.value) {
24
+      console.log(e.detail.value)
25
+      setImageShow(false)
26
+    } else {
27
+      setImageShow(true)
28
+    }
29
+    setIsMore(false)
30
+    setCurrentPage(1)
31
+    setQ(e.detail.value)
32
+  }
33
+  // 上拉加载
34
+  const handleScrollToLower = () => {
35
+    setCurrentPage(currentPage + 1)
13 36
   }
14
-  const onClose = () => {
15
-    setShow(false)
37
+
38
+  const handleClick = () => {
39
+    setImageShow(false)
16 40
   }
17
-  const handleOk=()=>{
18
-    console.log('开始作业')
19
-    setShow(false)
41
+  const handleChange = (val) => {
42
+    setCurrentPage(1)
43
+    setCurrentTab(val)
20 44
   }
21
-  const handleDetail = () => {
22
-    Taro.navigateTo({ url: '/pages/orderDetail/index' });
45
+  const handleDetail = (val) => {
46
+    Taro.navigateTo({ url: `/pages/orderDetail/index?id=${val}` });
23 47
   }
48
+
49
+  useEffect(() => {
50
+    getOrderList({workStatus:currentTab, pageNum: currentPage, q: q }).then(res => {
51
+      const lst = currentPage === 1 ? res.records || [] : orderList.concat(res.records || [])
52
+      //长列表加载当下一页没有数据时
53
+      if (res.records.length == 0 && currentPage != 1) {
54
+        setIsMore(true)
55
+        return
56
+      }
57
+      setOrderList(lst)
58
+    })
59
+  }, [currentPage, q,currentTab])
24 60
   return (
25
-    <ScrollView scrollY style={{ height: '100%' }}>
26
-      <MyCard job onClick={handleChange} handleDetail={handleDetail} />
27
-      <MyCard job onClick={handleChange} handleDetail={handleDetail} />
28
-      <MyCard job onClick={handleChange} handleDetail={handleDetail} />
29
-      <MyCard job onClick={handleChange} handleDetail={handleDetail} />
30
-      <Popup
31
-        show={show}
32
-        onClose={onClose}
33
-        className='tanchuang'
61
+    <>
62
+      <View className='searchOrderClass'>
63
+        <Input type='text' className='searchInput' onClick={handleClick} onBlur={handleSearch} placeholder='搜索关键字查询订单' />
64
+        {
65
+          imageShow && (
66
+            <Image src={searchImg} className='searchImg' />
67
+          )
68
+        }
69
+      </View>
70
+      <View className='tabbar'>
71
+        <View
72
+          className={['tabberItem', currentTab === 0 ? "activeTabber" : '']}
73
+          onClick={() => handleChange(0)}
74
+        >
75
+          <View>
76
+            <Text className='text'>待作业</Text>
77
+            {
78
+              currentTab === 0 && <View className='line' />
79
+            }
80
+          </View>
81
+        </View>
82
+        <View
83
+          className={['tabberItem', currentTab === 1 ? "activeTabber" : '']}
84
+          onClick={() => handleChange(1)}
85
+        >
86
+          <View>
87
+            <Text className='text'>进行中</Text>
88
+            {
89
+              currentTab === 1 && <View className='line' />
90
+            }
91
+          </View>
92
+        </View>
93
+        <View
94
+          className={['tabberItem', currentTab === 3 ? "activeTabber" : '']}
95
+          onClick={() => handleChange(3)}
96
+        >
97
+          <View>
98
+            <Text className='text'>已完成</Text>
99
+            {
100
+              currentTab === 3 && <View className='line' />
101
+            }
102
+          </View>
103
+        </View>
104
+      </View>
105
+      <ScrollView 
106
+        scrollY 
107
+        enhanced
108
+        onScrollToLower={isMore ? '' : handleScrollToLower} 
109
+        style={{ height: 'calc(100% - 108px)' }}
34 110
       >
35
-        <Image src={PositionImg} className='pImg' />
36
-        <View>当前位置在</View>
37
-        <View>河南省南阳市邓州市孟楼镇</View>
38
-        <Button className='btn' onClick={handleOk}>确认</Button>
39
-      </Popup>
40
-    </ScrollView>
111
+          {
112
+            orderList.length===0?<NullCard value='您还没有新的订单!' />:
113
+            orderList.map((item)=>{
114
+              return <MyCard order value={item} key={item.orderId} goDetail={()=>handleDetail(item.orderId)} />
115
+            })
116
+          }
117
+          {
118
+            isMore && <Footer />
119
+          }
120
+        </ScrollView>
121
+  </>
41 122
   )
42 123
 }

+ 52
- 21
src/pages/index/components/Job/style.less Näytä tiedosto

@@ -1,26 +1,57 @@
1
-.tanchuang{
1
+.searchOrderClass {
2
+  position: relative;
3
+  padding: 30px;
2 4
   text-align: center;
3
-  font-size: 34px;
4
-  font-weight: 800;
5
-  color: #323232;
6
-  width: calc(100vw - 60px);
7
-  padding: 142px 130px;
8
-  .pImg{
9
-    width: 80px;
10
-    height: 77px;
11
-    margin-bottom: 52px;
5
+  .searchInput{
6
+    background: #F8F8F8;
7
+    border-radius: 34px;
8
+    padding:0 34px;
9
+    font-size: 28px;
10
+    height: 68px;
11
+    line-height: 68px;
12 12
   }
13
-  view{
14
-    text-align: left;
15
-    line-height: 46px;
13
+  .searchImg{
14
+    width: 30px;
15
+    height: 30px;
16
+    position: absolute;
17
+    left: calc(50vw - 6.5em);
18
+    top: 50px;
16 19
   }
17
-  .btn{
18
-    width: 200px;
19
-    height: 88px;
20
-    background: linear-gradient(0deg, #00AE39, #A0E067);
21
-    border-radius: 34px;
20
+}
21
+.tabbar{
22
+  display: flex;
23
+  text-align: center;
24
+  box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.08);
25
+  height: 88px;
26
+  margin: 0 30px;
27
+  align-items: center;
28
+  .tabberItem{
29
+    flex: 1;
22 30
     font-size: 32px;
23
-    color: #FFFFFF;  
24
-    margin-top: 100px;  
31
+    font-weight: 500;
32
+    color: #999999;
33
+    height: 100%;
34
+    &>View{
35
+      height: 100%;
36
+      display: flex;
37
+      justify-content: center;
38
+      position: relative;
39
+      .text{
40
+        line-height: 29px;
41
+        align-self: center;
42
+      }
43
+      .line{
44
+        width: 12.8vw;
45
+        height: 6px;
46
+        background: #06B03B;
47
+        position: absolute;
48
+        bottom: 0;
49
+      }
50
+    }   
51
+    
25 52
   }
26
-}
53
+  .activeTabber {
54
+    color: #06B03B;
55
+    font-weight: 800;
56
+  }
57
+}

+ 84
- 40
src/pages/index/components/order/index.jsx Näytä tiedosto

@@ -1,51 +1,76 @@
1 1
 import React, { useState, useEffect } from "react"
2 2
 import Taro from "@tarojs/taro";
3
-import { View, Input, Swiper, Image, SwiperItem, Text, ScrollView } from "@tarojs/components"
3
+import { View, Input, Swiper, Image, SwiperItem, Text, ScrollView,Button } from "@tarojs/components"
4
+import { Popup } from "@antmjs/vantui";
4 5
 import positionImg from '@/assets/comm/position.png'
5 6
 import searchImg from '@/assets/comm/search.png'
6 7
 import orderImg from '@/assets/comm/orderList.png'
8
+import PositionImg from '@/assets/job/positionImg.png'
7 9
 import Footer from "@/components/Footer";
8 10
 import MyCard from "@/components/MyCard";
9 11
 import NullCard from "@/components/NullCard";
10 12
 import { getBannerList } from "@/services/banner";
11
-import { getOrderList } from "@/services/order";
13
+import { getJobList } from '@/services/job'
12 14
 import './style.less'
13 15
 
14 16
 
15 17
 export default (props) => {
16 18
   const [imgList, setImgList] = useState([])
17
-  const [orderList, setOrderList] = useState([])
18
-  const [currentPage,setCurrentPage]=useState(1)
19
-  const [isMore,setIsMore]=useState(false)
20
-  const [q,setQ]=useState()
19
+  const [jobList, setJobList] = useState([])
20
+  const [currentPage, setCurrentPage] = useState(1)
21
+  const [isMore, setIsMore] = useState(false)
22
+  const [q, setQ] = useState()
23
+  
24
+  const [show, setShow] = useState(false)
25
+  const [area,setArea]=useState()
26
+  const [showOver, setShowOver] = useState(false)
21 27
 
22 28
   const handleSearch = (e) => {
23 29
     setIsMore(false)
24 30
     setCurrentPage(1)
25 31
     setQ(e.detail.value)
26 32
   }
27
-  const handleMore = () => {
28
-    Taro.navigateTo({ url: '/pages/moreOrder/index' });
29
-  }
30 33
   const handleDetail = (val) => {
31 34
     Taro.navigateTo({ url: `/pages/orderDetail/index?id=${val}` });
32 35
   }
33 36
   // 上拉加载
34
-  const handleScrollToLower=()=>{
35
-    setCurrentPage(currentPage+1)
37
+  const handleScrollToLower = () => {
38
+    setCurrentPage(currentPage + 1)
36 39
   }
37
-
38
-  useEffect(()=>{
39
-    getOrderList({pageNum:currentPage,q:q}).then(res=>{
40
-      const lst = currentPage === 1 ? res.records || [] : orderList.concat(res.records || [])
40
+  const handleChange = () => {
41
+    setShow(true)
42
+    // setShowOver(true)
43
+  }
44
+  const onClose = () => {
45
+    setShow(false)
46
+  }
47
+  const handleOk = () => {
48
+    console.log('开始作业')
49
+    setShow(false)
50
+  }
51
+  const handleArea=(e)=>{
52
+    setArea(e.detail.value)
53
+  }
54
+  const onOverClose=()=>{
55
+    setArea()
56
+    setShowOver(false)
57
+  }
58
+  const handleOverOk=()=>{
59
+    if (area) {
60
+      console.log(666)
61
+    }
62
+  }
63
+  useEffect(() => {
64
+    getJobList({ pageNum: currentPage, q: q }).then(res => {
65
+      const lst = currentPage === 1 ? res.records || [] : jobList.concat(res.records || [])
41 66
       //长列表加载当下一页没有数据时
42
-      if (res.records.length==0&&currentPage!=1) {
67
+      if (res.records.length == 0 && currentPage != 1) {
43 68
         setIsMore(true)
44 69
         return
45 70
       }
46
-      setOrderList(lst)
71
+      setJobList(lst)
47 72
     })
48
-  },[currentPage,q])
73
+  }, [currentPage, q])
49 74
   useEffect(() => {
50 75
     getBannerList({ position: 'bannerWorker' })
51 76
       .then(res => {
@@ -73,38 +98,57 @@ export default (props) => {
73 98
       <ScrollView
74 99
         scrollY
75 100
         enhanced
76
-        onScrollToLower={isMore?'':handleScrollToLower}
77
-        style={{ height: 'calc(100% - 50px)' }}
101
+        onScrollToLower={isMore ? '' : handleScrollToLower}
102
+        style={{ height: 'calc(100% - 68px)' }}
78 103
       >
79
-        <View>
80
-          <Swiper
81
-            circular
82
-            autoplay
83
-            className='swiper'
84
-          >
85
-            {imgList.map((item, inx) => (
86
-              <SwiperItem key={inx}>
87
-                <Image src={item.thumb} mode='widthFix' className='storeImage' />
88
-              </SwiperItem>
89
-            ))}
90
-          </Swiper>
91
-        </View>
104
+        <Swiper
105
+          circular
106
+          autoplay
107
+          className='swiper'
108
+        >
109
+          {imgList.map((item, inx) => (
110
+            <SwiperItem key={inx}>
111
+              <Image src={item.thumb} mode='widthFix' className='storeImage' />
112
+            </SwiperItem>
113
+          ))}
114
+        </Swiper>
92 115
         <View className='orderList'>
93 116
           <View className='head'>
94 117
             <Image className='headIcon' src={orderImg} />
95
-            <Text className='title'>订单列表</Text>
96
-            <Text className='more' onClick={handleMore}>更多{">"}{">"}</Text>
118
+            <Text className='title'>作业列表</Text>
97 119
           </View>
98 120
           {
99
-            orderList.length === 0 ? <NullCard value='您还没有新的订单!' /> :
100
-              orderList.map((item) => {
101
-                return <MyCard order value={item} key={item.orderId} goDetail={() => handleDetail(item.orderId)} />
121
+            jobList.length === 0 ? <NullCard value='您还没有新的作业订单!' /> :
122
+              jobList.map((item) => {
123
+                return <MyCard job value={item} key={item.JobId} onClick={handleChange} goDetail={handleDetail} />
102 124
               })
103 125
           }
104 126
           {
105
-            isMore&&<Footer />
106
-          }          
127
+            isMore && <Footer />
128
+          }
107 129
         </View>
130
+        <Popup
131
+          show={show}
132
+          onClose={onClose}
133
+          className='tanchuang'
134
+        >
135
+          <Image src={PositionImg} className='pImg' />
136
+          <View>当前位置在</View>
137
+          <View>河南省南阳市邓州市孟楼镇</View>
138
+          <Button className='btn' onClick={handleOk}>确认</Button>
139
+        </Popup>
140
+        <Popup
141
+          show={showOver}
142
+          onClose={onOverClose}
143
+          className='tanchuang2'
144
+        >
145
+          <View className='bankInput'>
146
+            <View className='header'>作业面积:</View>
147
+            <Input className='body' type='digit' placeholder='请输入本次作业的面积' value={area} onBlur={handleArea} />
148
+          </View>
149
+          <Button className='btn' onClick={handleOverOk}>确认</Button>
150
+        </Popup>
151
+
108 152
       </ScrollView>
109 153
     </View>
110 154
   )

+ 89
- 1
src/pages/index/components/order/style.less Näytä tiedosto

@@ -3,7 +3,6 @@
3 3
   .top {
4 4
     display: flex;
5 5
     margin: 30px;
6
-    margin-bottom: 0;
7 6
     .left {
8 7
       display: flex;
9 8
       align-items: center;
@@ -53,6 +52,7 @@
53 52
     height: calc( calc(100vw - 60px) * 0.6);
54 53
     text-align: center;
55 54
     margin: 30px;
55
+    margin-top: 0;
56 56
     .storeImage {
57 57
       width: 100%;
58 58
     }
@@ -90,6 +90,94 @@
90 90
         color: #666666;
91 91
       }
92 92
     }
93
+    .tanchuang{
94
+      text-align: center;
95
+      font-size: 34px;
96
+      font-weight: 800;
97
+      color: #323232;
98
+      width: calc(100vw - 60px);
99
+      padding: 142px 130px;
100
+      box-shadow: 0px 0px 44px 0px rgba(0, 0, 0, 0.08);
101
+      border-radius: 40px;
102
+      .bankInput{
103
+        background: #FFF;
104
+        border: 2px solid #F2F2F2;
105
+        border-radius: 40px;
106
+        display: flex;
107
+        align-items: center;
108
+        padding: 36px 30px;
109
+        margin-top: 30px;
110
+        height: 108px;
111
+        box-sizing: border-box;
112
+        .header{
113
+          font-size: 48px;
114
+          font-weight: 500;
115
+          color: #333;
116
+          flex: none;
117
+          margin-right: 20px;
118
+        }
119
+        .body{
120
+          flex: 1;
121
+          font-size: 32px;
122
+          font-weight: 400;
123
+        }
124
+      }
125
+      .pImg{
126
+        width: 80px;
127
+        height: 77px;
128
+        margin-bottom: 52px;
129
+      }
130
+      view{
131
+        text-align: left;
132
+        line-height: 46px;
133
+      }
134
+      .btn{
135
+        width: 200px;
136
+        height: 88px;
137
+        background: linear-gradient(0deg, #00AE39, #A0E067);
138
+        border-radius: 34px;
139
+        font-size: 32px;
140
+        color: #FFFFFF;  
141
+        margin-top: 100px;  
142
+      }
143
+    }
144
+    .tanchuang2{
145
+      text-align: center;
146
+      font-size: 34px;
147
+      font-weight: 800;
148
+      color: #323232;
149
+      width: calc(100vw - 60px);
150
+      padding: 80px 30px;
151
+      box-shadow: 0px 0px 44px 0px rgba(0, 0, 0, 0.08);
152
+      border-radius: 40px;
153
+      .bankInput{
154
+        border: 2px solid #F2F2F2;
155
+        border-radius: 40px;
156
+        display: flex;
157
+        align-items: center;
158
+        padding: 36px 30px;
159
+        box-sizing: border-box;
160
+        .header{
161
+          font-weight: 500;
162
+          color: #333;
163
+          flex: none;
164
+        }
165
+        .body{
166
+          flex: 1;
167
+          font-size: 32px;
168
+          font-weight: 400;
169
+        }
170
+      }
171
+      .btn{
172
+        width: 200px;
173
+        height: 88px;
174
+        background: linear-gradient(0deg, #00AE39, #A0E067);
175
+        border-radius: 34px;
176
+        font-size: 32px;
177
+        color: #FFFFFF;  
178
+        margin-top: 50px;  
179
+      }
180
+    }
93 181
   }
94 182
 }
95 183
 

+ 2
- 2
src/pages/index/index.jsx Näytä tiedosto

@@ -59,7 +59,7 @@ export default withLayout((props) => {
59 59
         show && <LoginModel path={path} />
60 60
       }
61 61
       <View className='index-navbar'>
62
-        <CustomNav home title={currentTab == 0 ? '首页' : currentTab == 1 ? '作业管理' : '我的'} />
62
+        <CustomNav home title={currentTab == 0 ? '首页' : currentTab == 1 ? '订单列表' : '我的'} />
63 63
       </View>
64 64
       <View className='index-container'>
65 65
         {currentTab == 0 && <Order />}
@@ -79,7 +79,7 @@ export default withLayout((props) => {
79 79
           onClick={() => handleClick(1)}
80 80
         >
81 81
           <Image className='tabberImg' src={currentTab == 1 ? jobActive : job}></Image>
82
-          <View className='text'>作业管理</View>
82
+          <View className='text'>订单列表</View>
83 83
         </View>
84 84
         <View
85 85
           className={['tabberItem', currentTab === 2 ? "activeTabber" : '']}

+ 0
- 7
src/pages/moreOrder/index.config.js Näytä tiedosto

@@ -1,7 +0,0 @@
1
-export default {
2
-  navigationBarTitleText: '更多',
3
-  navigationStyle: 'custom',
4
-  styleIsolation: 'shared',
5
-  enableShareAppMessage: true,
6
-  disableScroll: true,
7
-}

+ 0
- 108
src/pages/moreOrder/index.jsx Näytä tiedosto

@@ -1,108 +0,0 @@
1
-import Taro from "@tarojs/taro";
2
-import { useState, useEffect } from "react";
3
-import { View, Input, Image, Text, ScrollView } from "@tarojs/components"
4
-import CustomNav from "@/components/CustomNav";
5
-import searchImg from '@/assets/comm/search.png'
6
-import withLayout from '@/layouts'
7
-import NullCard from "@/components/NullCard";
8
-import MyCard from "@/components/MyCard";
9
-import Footer from "@/components/Footer";
10
-import { getOrderList } from "@/services/order";
11
-import './style.less'
12
-
13
-export default withLayout(() => {
14
-  const [imageShow, setImageShow] = useState(true)
15
-  const [currentTab, setCurrentTab] = useState(0);
16
-  const [orderList, setOrderList] = useState([])
17
-  const handleSearch = (e) => {
18
-    if (e.detail.value) {
19
-      console.log(e.detail.value)
20
-      setImageShow(false)
21
-    } else {
22
-      setImageShow(true)
23
-    }
24
-    getOrderList({q:e.detail.value}).then((res) => {
25
-      setOrderList(res.records)
26
-    })
27
-  }
28
-  const handleClick = () => {
29
-    setImageShow(false)
30
-  }
31
-  const handleChange = (val) => {
32
-    setCurrentTab(val)
33
-  }
34
-  const handleDetail = (val) => {
35
-    Taro.navigateTo({ url: `/pages/orderDetail/index?id=${val}` });
36
-  }
37
-  useEffect(() => {
38
-    getOrderList().then((res) => {
39
-      console.log(res.records)
40
-      setOrderList(res.records)
41
-    })
42
-  }, [])
43
-  return (
44
-    <View className='page-index'>
45
-      <View className='index-navbar'>
46
-        <CustomNav title='更多' />
47
-      </View>
48
-      <View className='searchClass'>
49
-        <Input type='text' className='searchInput' onClick={handleClick} onBlur={handleSearch} placeholder='搜索关键字查询订单' />
50
-        {
51
-          imageShow && (
52
-            <Image src={searchImg} className='searchImg' />
53
-          )
54
-        }
55
-      </View>
56
-      <View className='tabbar'>
57
-        <View
58
-          className={['tabberItem', currentTab === 0 ? "activeTabber" : '']}
59
-          onClick={() => handleChange(0)}
60
-        >
61
-          <View>
62
-            <Text className='text'>待作业</Text>
63
-            {
64
-              currentTab === 0 && <View className='line' />
65
-            }
66
-          </View>
67
-        </View>
68
-        <View
69
-          className={['tabberItem', currentTab === 1 ? "activeTabber" : '']}
70
-          onClick={() => handleChange(1)}
71
-        >
72
-          <View>
73
-            <Text className='text'>进行中</Text>
74
-            {
75
-              currentTab === 1 && <View className='line' />
76
-            }
77
-          </View>
78
-        </View>
79
-        <View
80
-          className={['tabberItem', currentTab === 2 ? "activeTabber" : '']}
81
-          onClick={() => handleChange(2)}
82
-        >
83
-          <View>
84
-            <Text className='text'>已完成</Text>
85
-            {
86
-              currentTab === 2 && <View className='line' />
87
-            }
88
-          </View>
89
-        </View>
90
-      </View>
91
-      <View className='index-container'>
92
-        <ScrollView scrollY style={{ height: '100%' }}>
93
-          {/* {currentTab} */}
94
-          {
95
-            orderList.length===0?<NullCard value='您还没有新的订单!' />:
96
-            orderList.map((item)=>{
97
-              return <MyCard order value={item} key={item.orderId} goDetail={()=>handleDetail(item.orderId)} />
98
-            })
99
-          }
100
-          {/* <Footer /> */}
101
-        </ScrollView>
102
-        {/* {currentTab === 0 && <View>777</View>}
103
-        {currentTab === 1 && <View>888</View>}
104
-        {currentTab === 2 && <View>999</View>} */}
105
-      </View>
106
-    </View>
107
-  )
108
-})

+ 0
- 57
src/pages/moreOrder/style.less Näytä tiedosto

@@ -1,57 +0,0 @@
1
-.searchClass {
2
-  position: relative;
3
-  padding: 30px;
4
-  text-align: center;
5
-  .searchInput{
6
-    background: #F8F8F8;
7
-    border-radius: 34px;
8
-    padding:0 34px;
9
-    font-size: 28px;
10
-    height: 68px;
11
-    line-height: 68px;
12
-  }
13
-  .searchImg{
14
-    width: 30px;
15
-    height: 30px;
16
-    position: absolute;
17
-    left: calc(50vw - 5.5em);
18
-    top: 50px;
19
-  }
20
-}
21
-.tabbar{
22
-  display: flex;
23
-  text-align: center;
24
-  box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.08);
25
-  height: 88px;
26
-  margin: 0 30px;
27
-  align-items: center;
28
-  .tabberItem{
29
-    flex: 1;
30
-    font-size: 32px;
31
-    font-weight: 500;
32
-    color: #999999;
33
-    height: 100%;
34
-    &>View{
35
-      height: 100%;
36
-      display: flex;
37
-      justify-content: center;
38
-      position: relative;
39
-      .text{
40
-        line-height: 29px;
41
-        align-self: center;
42
-      }
43
-      .line{
44
-        width: 12.8vw;
45
-        height: 6px;
46
-        background: #06B03B;
47
-        position: absolute;
48
-        bottom: 0;
49
-      }
50
-    }   
51
-    
52
-  }
53
-  .activeTabber {
54
-    color: #06B03B;
55
-    font-weight: 800;
56
-  }
57
-}

+ 0
- 4
src/routes.js Näytä tiedosto

@@ -6,10 +6,6 @@ const mainPages = [
6 6
     page: 'pages/index/index',
7 7
     isIndex: true,
8 8
   },
9
-  {
10
-    title: '更多',
11
-    page: 'pages/moreOrder/index',
12
-  },
13 9
   {
14 10
     title: '详情',
15 11
     page: 'pages/orderDetail/index',

+ 29
- 0
src/services/job.js Näytä tiedosto

@@ -0,0 +1,29 @@
1
+import request from '@/utils/request'
2
+
3
+/**
4
+  * 作业列表
5
+  * @returns 
6
+  * params 搜索条件放这里
7
+  */
8
+ export const getJobList = (params) => request('/work-job', { params })
9
+
10
+/**
11
+  * 作业详情
12
+  * @returns 
13
+  * params 搜索条件放这里
14
+  */
15
+ export const getJobDetail = (id,params) => request(`/work-job/${id}`, { params })
16
+
17
+ /**
18
+ * 开始作业 暂停作业
19
+ * @param {*} data
20
+ * @returns
21
+ */
22
+export const toggleJob = (id, data) => request(`/worker/work-job/${id}/pause`, { method: 'put', data });
23
+
24
+/**
25
+ * 完成作业
26
+ * @param {*} data
27
+ * @returns
28
+ */
29
+export const overJob = (id, data) => request(`/worker/work-job/${id}/stop`, { method: 'put', data });