李志伟 3 年前
父节点
当前提交
ea506e8d19
共有 3 个文件被更改,包括 20 次插入22 次删除
  1. 1
    2
      src/pages/index/components/OverPop/index.jsx
  2. 18
    19
      src/pages/index/components/order/index.jsx
  3. 1
    1
      src/store/models/person.js

+ 1
- 2
src/pages/index/components/OverPop/index.jsx 查看文件

5
 export default (props) => {
5
 export default (props) => {
6
   const { showOver, onOverClose, area, setArea, handleOverOk } = props
6
   const { showOver, onOverClose, area, setArea, handleOverOk } = props
7
   const handleArea = (e) => {
7
   const handleArea = (e) => {
8
-    console.log(666)
9
     setArea(e.detail.value)
8
     setArea(e.detail.value)
10
   }
9
   }
11
   return (
10
   return (
16
     >
15
     >
17
       <View className='bankInput'>
16
       <View className='bankInput'>
18
         <View className='header'>作业面积:</View>
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
       </View>
19
       </View>
21
       <Button className='btn' onClick={handleOverOk}>确认</Button>
20
       <Button className='btn' onClick={handleOverOk}>确认</Button>
22
     </Popup>
21
     </Popup>

+ 18
- 19
src/pages/index/components/order/index.jsx 查看文件

65
     })
65
     })
66
   }
66
   }
67
   const onOverClose = () => {
67
   const onOverClose = () => {
68
-    setArea()
69
     setShowOver(false)
68
     setShowOver(false)
69
+    setArea()
70
   }
70
   }
71
   const handleOverOk = () => {
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
           onOverClose()
87
           onOverClose()
90
-        // })
91
-      // })
88
+        })
89
+      })
92
     }
90
     }
93
     else {
91
     else {
94
       Taro.showToast({
92
       Taro.showToast({
174
           <View>{address}</View>
172
           <View>{address}</View>
175
           <Button className='btn' onClick={handleOk}>确认</Button>
173
           <Button className='btn' onClick={handleOk}>确认</Button>
176
         </Popup>
174
         </Popup>
175
+        
177
         <OverPop showOver={showOver} onOverClose={onOverClose} area={area} setArea={setArea} handleOverOk={handleOverOk} />
176
         <OverPop showOver={showOver} onOverClose={onOverClose} area={area} setArea={setArea} handleOverOk={handleOverOk} />
178
       </ScrollView>
177
       </ScrollView>
179
     </View>
178
     </View>

+ 1
- 1
src/store/models/person.js 查看文件

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