李志伟 3 anos atrás
pai
commit
cef9ef14ee
1 arquivos alterados com 9 adições e 9 exclusões
  1. 9
    9
      src/pages/index/components/order/index.jsx

+ 9
- 9
src/pages/index/components/order/index.jsx Ver arquivo

@@ -72,11 +72,7 @@ export default (props) => {
72 72
   const handleOverOk = () => {
73 73
     //正整数或两位小数
74 74
     if (!isNaN(area)) {
75
-      overJob(job.jobId, { ...job, area: area }).then(res => {
76
-        Taro.showToast({
77
-          title: '恭喜完成作业',
78
-          icon: 'none',
79
-        })
75
+      overJob(job.jobId, { ...job, area: area }).then(() => {
80 76
         getJobList({ pageNum: currentPage }).then(res2 => {
81 77
           const lst = currentPage === 1 ? res2.records || [] : jobList.concat(res2.records || [])
82 78
           //长列表加载当下一页没有数据时
@@ -84,7 +80,11 @@ export default (props) => {
84 80
             setIsMore(true)
85 81
             return
86 82
           }
87
-          setJobList(lst)
83
+          setJobList(lst);
84
+          Taro.showToast({
85
+            title: '恭喜完成作业',
86
+            icon: 'none',
87
+          })
88 88
           onOverClose()
89 89
         })
90 90
       })
@@ -96,7 +96,7 @@ export default (props) => {
96 96
       })
97 97
     }
98 98
   }
99
-  useDidShow(()=>{
99
+  useDidShow(() => {
100 100
     getJobList({ pageNum: currentPage }).then(res => {
101 101
       const lst = currentPage === 1 ? res.records || [] : jobList.concat(res.records || [])
102 102
       //长列表加载当下一页没有数据时
@@ -171,7 +171,7 @@ export default (props) => {
171 171
               })
172 172
           }
173 173
           {
174
-            jobList.length === 0 ||isMore && <Footer />
174
+            jobList.length === 0 || isMore && <Footer />
175 175
           }
176 176
         </View>
177 177
         <Popup
@@ -184,7 +184,7 @@ export default (props) => {
184 184
           <View>{address}</View>
185 185
           <Button className='btn' onClick={handleOk}>确认</Button>
186 186
         </Popup>
187
-        
187
+
188 188
         <OverPop showOver={showOver} onOverClose={onOverClose} area={area} setArea={setArea} handleOverOk={handleOverOk} />
189 189
       </ScrollView>
190 190
     </View>