李志伟 3 лет назад
Родитель
Сommit
ea506e8d19

+ 1
- 2
src/pages/index/components/OverPop/index.jsx Просмотреть файл

@@ -5,7 +5,6 @@ import './style.less'
5 5
 export default (props) => {
6 6
   const { showOver, onOverClose, area, setArea, handleOverOk } = props
7 7
   const handleArea = (e) => {
8
-    console.log(666)
9 8
     setArea(e.detail.value)
10 9
   }
11 10
   return (
@@ -16,7 +15,7 @@ export default (props) => {
16 15
     >
17 16
       <View className='bankInput'>
18 17
         <View className='header'>作业面积:</View>
19
-        <Input className='body' type='digit' placeholder='请输入本次作业的面积' value={area} onBlur={handleArea} />
18
+        <Input className='body' type='digit' placeholder='请输入本次作业的面积' value={area} onInput={handleArea} />
20 19
       </View>
21 20
       <Button className='btn' onClick={handleOverOk}>确认</Button>
22 21
     </Popup>

+ 18
- 19
src/pages/index/components/order/index.jsx Просмотреть файл

@@ -65,30 +65,28 @@ export default (props) => {
65 65
     })
66 66
   }
67 67
   const onOverClose = () => {
68
-    setArea()
69 68
     setShowOver(false)
69
+    setArea()
70 70
   }
71 71
   const handleOverOk = () => {
72
-    console.log(999999)
73 72
     //正整数或两位小数
74
-    const test2 = /^\d+(\.\d{1,2})?$/.test(area)
75
-    if (test2) {
76
-      // overJob(job.jobId, { ...job, area: area }).then(res => {
77
-      //   Taro.showToast({
78
-      //     title: '恭喜完成作业',
79
-      //     icon: 'none',
80
-      //   })
81
-      //   getJobList({ pageNum: currentPage }).then(res2 => {
82
-      //     const lst = currentPage === 1 ? res2.records || [] : jobList.concat(res2.records || [])
83
-      //     //长列表加载当下一页没有数据时
84
-      //     if (res2.records.length == 0 && currentPage != 1) {
85
-      //       setIsMore(true)
86
-      //       return
87
-      //     }
88
-      //     setJobList(lst)
73
+    if (!isNaN(area)) {
74
+      overJob(job.jobId, { ...job, area: area }).then(res => {
75
+        Taro.showToast({
76
+          title: '恭喜完成作业',
77
+          icon: 'none',
78
+        })
79
+        getJobList({ pageNum: currentPage }).then(res2 => {
80
+          const lst = currentPage === 1 ? res2.records || [] : jobList.concat(res2.records || [])
81
+          //长列表加载当下一页没有数据时
82
+          if (res2.records.length == 0 && currentPage != 1) {
83
+            setIsMore(true)
84
+            return
85
+          }
86
+          setJobList(lst)
89 87
           onOverClose()
90
-        // })
91
-      // })
88
+        })
89
+      })
92 90
     }
93 91
     else {
94 92
       Taro.showToast({
@@ -174,6 +172,7 @@ export default (props) => {
174 172
           <View>{address}</View>
175 173
           <Button className='btn' onClick={handleOk}>确认</Button>
176 174
         </Popup>
175
+        
177 176
         <OverPop showOver={showOver} onOverClose={onOverClose} area={area} setArea={setArea} handleOverOk={handleOverOk} />
178 177
       </ScrollView>
179 178
     </View>

+ 1
- 1
src/store/models/person.js Просмотреть файл

@@ -8,7 +8,7 @@ export default () => {
8 8
   const login = (params) => {
9 9
     signIn(params).then((res) => {
10 10
       const { person: taPerson,  sessionKey: skey } = res;
11
-      taPerson.phone=null
11
+      // taPerson.phone=null
12 12
       setPerson(taPerson);
13 13
       setSessionKey(skey);
14 14
     })