Browse Source

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-miniapp

Yansen 2 years ago
parent
commit
e805208bc1

+ 14
- 2
project.config.json View File

39
         "disableUseStrict": false,
39
         "disableUseStrict": false,
40
         "showES6CompileOption": false,
40
         "showES6CompileOption": false,
41
         "useCompilerPlugins": false,
41
         "useCompilerPlugins": false,
42
-        "minifyWXML": true
42
+        "minifyWXML": true,
43
+        "ignoreDevUnusedFiles": false,
44
+        "ignoreUploadUnusedFiles": false
43
     },
45
     },
44
     "compileType": "miniprogram",
46
     "compileType": "miniprogram",
45
-    "condition": {}
47
+    "condition": {},
48
+    "libVersion": "2.25.0",
49
+    "srcMiniprogramRoot": "dist/",
50
+    "packOptions": {
51
+        "ignore": [],
52
+        "include": []
53
+    },
54
+    "editorSetting": {
55
+        "tabIndent": "insertSpaces",
56
+        "tabSize": 4
57
+    }
46
 }
58
 }

+ 9
- 0
project.private.config.json View File

1
+{
2
+    "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3
+    "projectname": "machinery-miniapp",
4
+    "setting": {
5
+        "compileHotReLoad": true,
6
+        "urlCheck": false,
7
+        "preloadBackgroundData": false
8
+    }
9
+}

BIN
src/assets/mineImgaes/userMoren.png View File


+ 6
- 49
src/components/AssessModel/index.jsx View File

1
-
2
 import { useState } from 'react'
1
 import { useState } from 'react'
3
-
4
-import ButtontWX from '@/components/ButtontWX'
5
-import { Textarea, View } from '@tarojs/components'
6
-
7
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
+import { Textarea, View } from '@tarojs/components'
4
+import ButtontWX from '@/components/ButtontWX'
5
+import { orderEvaluation } from '@/services/order'
8
 import starOn from '@/assets/icons/comm/starOn.png'
6
 import starOn from '@/assets/icons/comm/starOn.png'
9
 import starOff from '@/assets/icons/comm/starOff.png'
7
 import starOff from '@/assets/icons/comm/starOff.png'
10
-import Popup from '@/components/Popup'
11
-// import { saveEvaluate } from '@/services/mine'
12
-import { orderEvaluation } from '@/services/order'
13
 import './style.less'
8
 import './style.less'
14
 
9
 
15
-
16
-
17
-
18
-
19
-
20
 export default (props) => {
10
 export default (props) => {
21
-  const { showCutover, maskClosable, orderId, onClose, goBACK } = props
22
-
11
+  const { showCutover, orderId, onClose } = props
23
   const scoreList = new Array(5).fill(0)
12
   const scoreList = new Array(5).fill(0)
24
-
25
-
26
   const [textAreaCentent, setTextAreaCentent] = useState('')
13
   const [textAreaCentent, setTextAreaCentent] = useState('')
27
-
28
-
29
-
30
   const [evaluate, setEvaluate] = useState({
14
   const [evaluate, setEvaluate] = useState({
31
     sweetScore: 0,
15
     sweetScore: 0,
32
   })
16
   })
33
-
34
-
35
-
36
   const [kwCollectNub, setkwCollectNub] = useState(0)
17
   const [kwCollectNub, setkwCollectNub] = useState(0)
37
   const kwChange = (e, val) => {
18
   const kwChange = (e, val) => {
38
     e.stopPropagation();
19
     e.stopPropagation();
39
     setkwCollectNub(val + 1)
20
     setkwCollectNub(val + 1)
40
-
41
-    console.log("🚀 ~ file: index.jsx ~ line 49 ~ kwChange ~ val", e, val + 1)
42
-
43
     setEvaluate({ sweetScore: val + 1, })
21
     setEvaluate({ sweetScore: val + 1, })
44
   }
22
   }
45
-
46
-
47
-  const ButtonCancel = () => {
48
-    onClose()
49
-  }
50
   const ButtonOK = (e) => {
23
   const ButtonOK = (e) => {
51
     if (evaluate.sweetScore == 0) {
24
     if (evaluate.sweetScore == 0) {
52
       Taro.showToast({
25
       Taro.showToast({
56
       return;
29
       return;
57
     }
30
     }
58
     else {
31
     else {
59
-
60
       orderEvaluation({ orderId: orderId, score: kwCollectNub, content: textAreaCentent }).then(() => {
32
       orderEvaluation({ orderId: orderId, score: kwCollectNub, content: textAreaCentent }).then(() => {
61
         Taro.showToast({
33
         Taro.showToast({
62
           title: '评价成功',
34
           title: '评价成功',
68
           }, 500);
40
           }, 500);
69
         })
41
         })
70
       })
42
       })
71
-
72
     }
43
     }
73
   }
44
   }
74
 
45
 
75
-
76
-
77
   return (
46
   return (
78
     <>
47
     <>
79
-
80
       {
48
       {
81
         showCutover ? <View className='modelBack' >
49
         showCutover ? <View className='modelBack' >
82
           <View className='assessModel-box'>
50
           <View className='assessModel-box'>
85
                 <text className='card-box-star-text'  >满意度:</text>
53
                 <text className='card-box-star-text'  >满意度:</text>
86
                 {
54
                 {
87
                   scoreList.map((_, index) => {
55
                   scoreList.map((_, index) => {
88
-
89
                     const src = index < kwCollectNub ? starOn : starOff
56
                     const src = index < kwCollectNub ? starOn : starOff
90
                     return (
57
                     return (
91
                       <image className='card-star-image' key={index} src={src} onClick={(e) => kwChange(e, index)} />
58
                       <image className='card-star-image' key={index} src={src} onClick={(e) => kwChange(e, index)} />
93
                   })
60
                   })
94
                 }
61
                 }
95
               </view>
62
               </view>
96
-
97
             </view>
63
             </view>
98
             <Textarea placeholder='请输入评价内容' onInput={(e) => setTextAreaCentent(e.detail.value)} />
64
             <Textarea placeholder='请输入评价内容' onInput={(e) => setTextAreaCentent(e.detail.value)} />
99
             <View className='bottomButtomBox'>
65
             <View className='bottomButtomBox'>
100
               <ButtontWX onClick={ButtonOK} butText='提交' butWidth={80} butHeight={34} butFontSize={16} butBorderRadius={0} />
66
               <ButtontWX onClick={ButtonOK} butText='提交' butWidth={80} butHeight={34} butFontSize={16} butBorderRadius={0} />
101
             </View>
67
             </View>
102
           </View>
68
           </View>
103
-
104
-
105
-
106
-        </View> : <View></View>
69
+        </View> : <></>
107
       }
70
       }
108
     </>
71
     </>
109
-
110
-
111
-
112
-
113
-
114
   )
72
   )
115
-}
116
-
73
+}

+ 2
- 27
src/components/CarsListContent/index.jsx View File

1
 
1
 
2
-import { View, Swiper, Image, SwiperItem, Text, Input } from "@tarojs/components"
3
-import { useEffect, useState, useMemo } from "react"
4
-import Taro, { useReachBottom } from "@tarojs/taro"
2
+import { View, Image, Text, } from "@tarojs/components"
3
+import Taro from "@tarojs/taro"
5
 import ButtontWX from '@/components/ButtontWX'
4
 import ButtontWX from '@/components/ButtontWX'
6
 import withLayout from '@/layouts'
5
 import withLayout from '@/layouts'
7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
8
 import { useModel } from "@/store"
7
 import { useModel } from "@/store"
9
 import ListPlaceholder from "@/components/ListPlaceholder"
8
 import ListPlaceholder from "@/components/ListPlaceholder"
10
-import { getMachinery, } from "@/services/homes"
11
 import formatPrice from "@/utils/formatPrice"
9
 import formatPrice from "@/utils/formatPrice"
12
 import { setMorKm } from '@/utils/codeSegment'
10
 import { setMorKm } from '@/utils/codeSegment'
13
 
11
 
18
 
16
 
19
   const { carsList } = props
17
   const { carsList } = props
20
   const { sserLocation } = useModel('userData')
18
   const { sserLocation } = useModel('userData')
21
-  // const { carsList } = props
22
-
23
-  // const [carsList, setCarsList] = useState([])
24
-
25
-  // useEffect(() => {
26
-  //   getMachinery(sserLocation).then((e) => {
27
-  //     setCarsList(e.records)
28
-  //   })
29
-
30
-  // }, [sserLocation])
31
-
32
-
33
-
34
-
35
   const startReserve = (res) => {
19
   const startReserve = (res) => {
36
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}&location=${sserLocation}` })
20
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}&location=${sserLocation}` })
37
-
38
   }
21
   }
39
   const goCarsInfo = (res) => {
22
   const goCarsInfo = (res) => {
40
     Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}&location=${sserLocation}` })
23
     Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}&location=${sserLocation}` })
41
-
42
   }
24
   }
43
   const goMapInfo = (res) => {
25
   const goMapInfo = (res) => {
44
-    console.log("🚀 ~ file: index.jsx ~ line 43 ~ goMapInfo ~ res", res)
45
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${sserLocation}` })
26
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${sserLocation}` })
46
-
47
-
48
   }
27
   }
49
 
28
 
50
-
51
   return (
29
   return (
52
-
53
-
54
     <>
30
     <>
55
       {
31
       {
56
         carsList?.length > 0 ? carsList.map((item, index) => {
32
         carsList?.length > 0 ? carsList.map((item, index) => {
77
           )
53
           )
78
         }) : <ListPlaceholder title='暂无农机信息!' />
54
         }) : <ListPlaceholder title='暂无农机信息!' />
79
       }
55
       }
80
-
81
     </>
56
     </>
82
   )
57
   )
83
 })
58
 })

+ 5
- 19
src/components/LoginModel/index.jsx View File

45
 
45
 
46
   const onInputPhone = (r) => {
46
   const onInputPhone = (r) => {
47
     setInputPhoneValue(r?.detail?.value)
47
     setInputPhoneValue(r?.detail?.value)
48
-    console.log("🚀 ~ file: index.jsx ~ line 26 ~ InputCodeValue", InputPhoneValue)
49
-
50
   }
48
   }
51
   const onInputCode = (r) => {
49
   const onInputCode = (r) => {
52
     setInputCodeValue(r?.detail?.value)
50
     setInputCodeValue(r?.detail?.value)
55
   //获取验证码
53
   //获取验证码
56
   const getCode = (r) => {
54
   const getCode = (r) => {
57
     if (InputPhoneValue === '' || !(/^1[3456789]\d{9}$/.test(InputPhoneValue))) {
55
     if (InputPhoneValue === '' || !(/^1[3456789]\d{9}$/.test(InputPhoneValue))) {
58
-      console.log('提示')
59
       Taro.showToast({
56
       Taro.showToast({
60
         title: '手机号码有误',
57
         title: '手机号码有误',
61
         icon: 'none',
58
         icon: 'none',
96
   const getUserLogin = () => {
93
   const getUserLogin = () => {
97
 
94
 
98
     if (InputPhoneValue === '' || !(/^1[3456789]\d{9}$/.test(InputPhoneValue))) {
95
     if (InputPhoneValue === '' || !(/^1[3456789]\d{9}$/.test(InputPhoneValue))) {
99
-      console.log('提示')
100
       Taro.showToast({
96
       Taro.showToast({
101
         title: '手机号或验证码有误',
97
         title: '手机号或验证码有误',
102
         icon: 'none',
98
         icon: 'none',
111
         })
107
         })
112
       } else {
108
       } else {
113
         setUserPhone(person.personId, { captcha: InputCodeValue, phone: InputPhoneValue }).then((e) => {
109
         setUserPhone(person.personId, { captcha: InputCodeValue, phone: InputPhoneValue }).then((e) => {
114
-          console.log('e', e);
115
-
116
           setPerson(e.person)
110
           setPerson(e.person)
117
           // Taro.navigateTo({ url: path });
111
           // Taro.navigateTo({ url: path });
118
           // Taro.navigateTo({ url: `/pages/index/index?tab=${tab}` });
112
           // Taro.navigateTo({ url: `/pages/index/index?tab=${tab}` });
119
-
120
           if (loginType) {
113
           if (loginType) {
121
-
122
             Taro.navigateBack({
114
             Taro.navigateBack({
123
               delta: 1
115
               delta: 1
124
             })
116
             })
125
-
126
           } else {
117
           } else {
127
             myClosure()
118
             myClosure()
128
-
129
           }
119
           }
130
         })
120
         })
131
-        // console.log('person', person);
132
       }
121
       }
133
-
134
     }
122
     }
135
-
136
   }
123
   }
137
 
124
 
138
-
139
-
140
   return (
125
   return (
141
     <>
126
     <>
142
       {
127
       {
143
         isLoginVisible !== myClosures ? myClosures : isLoginVisible ?
128
         isLoginVisible !== myClosures ? myClosures : isLoginVisible ?
144
           <View className='page-index  ' style={{ position: 'absolute', zIndex: '29999' }
129
           <View className='page-index  ' style={{ position: 'absolute', zIndex: '29999' }
145
-          }>
130
+          }
131
+          >
146
             <View className='index-navbar'>
132
             <View className='index-navbar'>
147
-              <CustomNav title='登' home />
133
+              <CustomNav title='登' home />
148
             </View>
134
             </View>
149
             <View className='loginBackImg-box' >
135
             <View className='loginBackImg-box' >
150
               <Image src={require("@/assets/lolginImages/backLogin.png")} />
136
               <Image src={require("@/assets/lolginImages/backLogin.png")} />
157
                 <View className='loginPhone-box' >
143
                 <View className='loginPhone-box' >
158
                   <View className='loginPhone-box-loginPhoneView'>+86</View>
144
                   <View className='loginPhone-box-loginPhoneView'>+86</View>
159
                   <Input maxlength={11} placeholder='请输入手机号码' type={Number} value={InputPhoneValue} onInput={onInputPhone} />
145
                   <Input maxlength={11} placeholder='请输入手机号码' type={Number} value={InputPhoneValue} onInput={onInputPhone} />
160
-                  <ButtontWX opacity={countCenter.show_btn ? '0.7' : '11'} disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={94} butHeight={34} butFontSize={15} butBorderRadius={10} />
146
+                  <ButtontWX opacity={countCenter.show_btn ? '0.7' : '11'} disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={150} butHeight={34} butFontSize={15} butBorderRadius={10} />
161
                 </View>
147
                 </View>
162
                 <View className='loginPhone-box'>
148
                 <View className='loginPhone-box'>
163
                   <View className='loginPhone-box-loginPhoneView'>
149
                   <View className='loginPhone-box-loginPhoneView'>
168
               </View>
154
               </View>
169
             </View>
155
             </View>
170
             <View className='BottomtButrelative'  >
156
             <View className='BottomtButrelative'  >
171
-              <ButtontWX onClick={getUserLogin} butText='登' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
157
+              <ButtontWX onClick={getUserLogin} butText='登' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
172
             </View>
158
             </View>
173
             <View className='bottom-agreement'>
159
             <View className='bottom-agreement'>
174
               <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />
160
               <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />

+ 0
- 10
src/components/orderRater/index.js View File

57
       ]
57
       ]
58
     }
58
     }
59
   },
59
   },
60
-
61
   data: {
60
   data: {
62
     initScore: 0
61
     initScore: 0
63
   },
62
   },
64
-
65
-
66
   methods: {
63
   methods: {
67
-
68
     clickStar: function (e) {
64
     clickStar: function (e) {
69
       if (this.properties.onlyShow) return
65
       if (this.properties.onlyShow) return
70
       let index = e.currentTarget.dataset.index
66
       let index = e.currentTarget.dataset.index
71
       this.setData({
67
       this.setData({
72
         initScore: index + 1
68
         initScore: index + 1
73
       })
69
       })
74
-
75
-      console.log("🚀 ~ file: index.js ~ line 73 ~ index + 1", index + 1)
76
       this.triggerEvent('raterChange', index + 1)
70
       this.triggerEvent('raterChange', index + 1)
77
-
78
-
79
-
80
     }
71
     }
81
   },
72
   },
82
   ready () {
73
   ready () {
83
     this.setData({
74
     this.setData({
84
       initScore: this.properties.score
75
       initScore: this.properties.score
85
     })
76
     })
86
-    console.log('ready')
87
   }
77
   }
88
 })
78
 })

+ 2
- 48
src/layouts/index.jsx View File

1
 
1
 
2
 
2
 
3
 import useRouter from '@/utils/hooks/useRouter'
3
 import useRouter from '@/utils/hooks/useRouter'
4
-import { useEffect, useMemo, useState } from 'react'
4
+import { useMemo } from 'react'
5
 import { useModel } from '@/store'
5
 import { useModel } from '@/store'
6
 import Spin from "@/components/Spin";
6
 import Spin from "@/components/Spin";
7
 
7
 
31
   )
31
   )
32
 
32
 
33
 
33
 
34
-}
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-// import useRouter from '@/utils/hooks/useRouter'
45
-// import Taro from '@tarojs/taro'
46
-// import { useState, useMemo } from 'react'
47
-// import { useModel } from '@/store'
48
-// import LoginModel from '@/components/LoginModel'
49
-// import useLogin from '@/utils/hooks/useLogin'
50
-
51
-
52
-// export default (Child) => (props) => {
53
-//   const { person } = useModel('userData')
54
-//   const router = useRouter()
55
-//   const [isShow, setIsShow] = useState(false)
56
-
57
-
58
-//   const { path } = router
59
-
60
-//   useLogin()
61
-//   console.log("🚀 ~ file: index.jsx ~ line 20 ~   useLogin().abac", useLogin())
62
-
63
-//   const isShowFun = () => {
64
-//     setIsShow(true)
65
-
66
-//   }
67
-//   // Taro.useReady(()=>{
68
-//   //   useLogin(person,router)
69
-//   // })
70
-//   // useEffect(()=>{
71
-//   //   useLogin(person,router)
72
-//   // },[person, person?.phone, router, router?.path])
73
-
74
-//   // 确保执行过 login 方法,拿到了 person
75
-//   const isLoged = useMemo(() => !!person?.personId, [person?.personId])
76
-
77
-//   return isLoged ? <Child {...props} router={router} /> : <LoginModel isLoginVisible={isShow} />
78
-// }
79
-
80
-
34
+}

+ 2
- 19
src/pages/AddressInfos/index.jsx View File

1
-import { View, Form, Input, Switch, Textarea } from "@tarojs/components"
1
+import { View, Form, Textarea } from "@tarojs/components"
2
 import Taro from "@tarojs/taro"
2
 import Taro from "@tarojs/taro"
3
 import CustomNav from "@/components/CustomNav"
3
 import CustomNav from "@/components/CustomNav"
4
 import ButtontWX from '@/components/ButtontWX'
4
 import ButtontWX from '@/components/ButtontWX'
5
-import { addressSave, getAddress, addressDelete, addressUpdate } from "@/services/address"
5
+import { addressSave, addressUpdate } from "@/services/address"
6
 import withLayout from '@/layouts'
6
 import withLayout from '@/layouts'
7
-
8
 import './style.less'
7
 import './style.less'
9
 
8
 
10
-
11
-
12
-
13
-
14
 export default withLayout((props) => {
9
 export default withLayout((props) => {
15
 
10
 
16
   const $instance = Taro.getCurrentInstance()
11
   const $instance = Taro.getCurrentInstance()
17
   const { addressId, address } = $instance.router.params
12
   const { addressId, address } = $instance.router.params
18
 
13
 
19
   const formSubmit = e => {
14
   const formSubmit = e => {
20
-
21
     const value = e?.detail?.value
15
     const value = e?.detail?.value
22
-    console.log(value)
23
-
24
-
25
-
26
     if (addressId) {
16
     if (addressId) {
27
-
28
       addressUpdate(addressId, { address: value.address }).then((res) => {
17
       addressUpdate(addressId, { address: value.address }).then((res) => {
29
-        console.log('地址修改成功', res);
30
         Taro.showToast({
18
         Taro.showToast({
31
           title: '地址修改成功',
19
           title: '地址修改成功',
32
           icon: 'success',
20
           icon: 'success',
37
               delta: 1
25
               delta: 1
38
             })
26
             })
39
           }, 1000)
27
           }, 1000)
40
-
41
         })
28
         })
42
       })
29
       })
43
     } else {
30
     } else {
44
       addressSave({ address: value.address }).then((e) => {
31
       addressSave({ address: value.address }).then((e) => {
45
-        console.log('地址添加成功', e);
46
         Taro.showToast({
32
         Taro.showToast({
47
           title: '地址添加成功',
33
           title: '地址添加成功',
48
           icon: 'success',
34
           icon: 'success',
56
         })
42
         })
57
       })
43
       })
58
     }
44
     }
59
-
60
-
61
   }
45
   }
62
-
63
   const formReset = e => {
46
   const formReset = e => {
64
     console.log(e)
47
     console.log(e)
65
   }
48
   }

+ 2
- 25
src/pages/CheckDetails/index.jsx View File

9
 import { getMachineryInfo } from "@/services/homes"
9
 import { getMachineryInfo } from "@/services/homes"
10
 import formatPrice from "@/utils/formatPrice"
10
 import formatPrice from "@/utils/formatPrice"
11
 import TextContent from "./TextContent"
11
 import TextContent from "./TextContent"
12
-
13
-
14
 import './style.less'
12
 import './style.less'
15
 
13
 
16
-
17
-
18
 export default withLayout((props) => {
14
 export default withLayout((props) => {
19
-  console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", props)
20
 
15
 
21
   const $instance = Taro.getCurrentInstance()
16
   const $instance = Taro.getCurrentInstance()
22
   const { id, location } = $instance.router.params
17
   const { id, location } = $instance.router.params
39
 
34
 
40
   }, [$instance.router.params, id, location])
35
   }, [$instance.router.params, id, location])
41
 
36
 
42
-  console.log("🚀 ~ file: index.jsx ~ line 23 ~ carsInfo", carsInfo)
43
-
44
-
45
   const startReserve = () => {
37
   const startReserve = () => {
46
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${carsInfo?.machineryId}&location=${location}` })
38
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${carsInfo?.machineryId}&location=${location}` })
47
-
48
   }
39
   }
49
 
40
 
50
   const goMapInfo = (res) => {
41
   const goMapInfo = (res) => {
51
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${carsInfo?.machineryId}&location=${location}` })
42
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${carsInfo?.machineryId}&location=${location}` })
52
-
53
   }
43
   }
54
 
44
 
55
   return (
45
   return (
56
     <View className='page-index'>
46
     <View className='page-index'>
57
-
58
       <View className='index-navbar'>
47
       <View className='index-navbar'>
59
         <CustomNav title='查看详情' />
48
         <CustomNav title='查看详情' />
60
       </View>
49
       </View>
61
       <scroll-view scrollY style='height: 100%;' >
50
       <scroll-view scrollY style='height: 100%;' >
62
-
63
         <View >
51
         <View >
64
-
65
           {/* <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' /> */}
52
           {/* <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' /> */}
66
           <Swiper
53
           <Swiper
67
             mode='scaleToFill'
54
             mode='scaleToFill'
68
             className='swiper-box-info'
55
             className='swiper-box-info'
69
-
70
           >
56
           >
71
             {imagesList.map((item, inx) => (
57
             {imagesList.map((item, inx) => (
72
               <SwiperItem key={inx}>
58
               <SwiperItem key={inx}>
83
             <View className='content-header-box-map-Info' onClick={() => goMapInfo('222888')}>
69
             <View className='content-header-box-map-Info' onClick={() => goMapInfo('222888')}>
84
               <View className='content-header-box-map-Info-liftCentent'>
70
               <View className='content-header-box-map-Info-liftCentent'>
85
                 <Image src={addresss} />
71
                 <Image src={addresss} />
86
-                <View>距离当前位置8.8公里&gt;&gt;</View>
72
+                <View>距离当前位置{carsInfo?.distance/1000}公里&gt;&gt;</View>
87
               </View>
73
               </View>
88
             </View>
74
             </View>
89
             <View className='content-header-box-map-Info-carsName'>{carsInfo?.orgName}</View>
75
             <View className='content-header-box-map-Info-carsName'>{carsInfo?.orgName}</View>
95
               </View>
81
               </View>
96
               {
82
               {
97
                 contentList.map((item, index) => {
83
                 contentList.map((item, index) => {
98
-
99
                   return (
84
                   return (
100
-                    <TextContent item={item} />
85
+                    <TextContent key={item.machineryId} item={item} />
101
                   )
86
                   )
102
-
103
-
104
                 })
87
                 })
105
               }
88
               }
106
-
107
-
108
             </View>
89
             </View>
109
             <View className='startReserve-Bottom-oen'>
90
             <View className='startReserve-Bottom-oen'>
110
               <ButtontWX butText='预约' onClick={startReserve} butWidth={300} butHeight={49} butFontSize={16} butBorderRadius={49} />
91
               <ButtontWX butText='预约' onClick={startReserve} butWidth={300} butHeight={49} butFontSize={16} butBorderRadius={49} />
111
-
112
             </View>
92
             </View>
113
-
114
-
115
           </View>
93
           </View>
116
         </View>
94
         </View>
117
       </scroll-view>
95
       </scroll-view>
118
-
119
     </View >
96
     </View >
120
   )
97
   )
121
 })
98
 })

+ 2
- 2
src/pages/CheckDetails/style.less View File

13
   background-color: #fff;
13
   background-color: #fff;
14
   border-radius: 40px 40px 0px 0px;
14
   border-radius: 40px 40px 0px 0px;
15
   .CheckDetails-bottom-box-flaxBox-liftText {
15
   .CheckDetails-bottom-box-flaxBox-liftText {
16
-    width: 95%;
17
-
18
     display: flex;
16
     display: flex;
19
     justify-content: space-between;
17
     justify-content: space-between;
20
 
18
 
33
       background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
31
       background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
34
       -webkit-background-clip: text;
32
       -webkit-background-clip: text;
35
       -webkit-text-fill-color: transparent;
33
       -webkit-text-fill-color: transparent;
34
+      width: 6em;
35
+      text-align: right;
36
       > Text {
36
       > Text {
37
         font-size: 25px;
37
         font-size: 25px;
38
       }
38
       }

+ 0
- 1
src/pages/CheckMap/index.jsx View File

64
     width: 40, // 浮标宽度
64
     width: 40, // 浮标宽度
65
     height: 37,// 浮标高度
65
     height: 37,// 浮标高度
66
   }]
66
   }]
67
-  console.log("🚀 ~ file: index.jsx ~ line 46 ~ markers", markers)
68
 
67
 
69
   return (
68
   return (
70
     <View className='page-index'>
69
     <View className='page-index'>

+ 0
- 1
src/pages/FeedbackText/index.jsx View File

18
 
18
 
19
   const onSubmitClick = () => {
19
   const onSubmitClick = () => {
20
     setLoading(true)
20
     setLoading(true)
21
-    console.log('textAreaValue', textAreaValue);
22
     if (textAreaValue == '') {
21
     if (textAreaValue == '') {
23
       Taro.showToast({
22
       Taro.showToast({
24
         title: '请填写内容哦',
23
         title: '请填写内容哦',

+ 1
- 1
src/pages/LoginPage/index.config.js View File

1
 
1
 
2
 export default {
2
 export default {
3
-  navigationBarTitleText: '登',
3
+  navigationBarTitleText: '登',
4
   navigationStyle: 'custom',
4
   navigationStyle: 'custom',
5
   disableScroll: true,
5
   disableScroll: true,
6
   usingComponents: {
6
   usingComponents: {

+ 0
- 22
src/pages/MoreCars/CarTypeList.jsx View File

1
 
1
 
2
 import { View, Swiper, Image, SwiperItem, Text, Input } from "@tarojs/components"
2
 import { View, Swiper, Image, SwiperItem, Text, Input } from "@tarojs/components"
3
-import { useEffect, useState, useMemo } from "react"
4
 import Taro, { useReachBottom } from "@tarojs/taro"
3
 import Taro, { useReachBottom } from "@tarojs/taro"
5
 import ButtontWX from '@/components/ButtontWX'
4
 import ButtontWX from '@/components/ButtontWX'
6
 import withLayout from '@/layouts'
5
 import withLayout from '@/layouts'
14
 
13
 
15
 export default withLayout((props) => {
14
 export default withLayout((props) => {
16
   const { csrsListType } = props
15
   const { csrsListType } = props
17
-  console.log("🚀 ~ file: index.jsx ~ line 17 ~ withLayout ~ csrsListType", csrsListType)
18
   const { sserLocation } = useModel('userData')
16
   const { sserLocation } = useModel('userData')
19
-
20
-  // const { carsList } = props
21
-
22
-  const [carsList, setCarsList] = useState([])
23
-  console.log("🚀 ~ file: index.jsx ~ line 23 ~ withLayout ~ carsList", carsList)
24
-
25
-  const [caryType, setCaryType] = useState(false)
26
-
27
-
28
   const startReserve = (res) => {
17
   const startReserve = (res) => {
29
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}&location=${sserLocation}` })
18
     Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}&location=${sserLocation}` })
30
-
31
   }
19
   }
32
   const goCarsInfo = (res) => {
20
   const goCarsInfo = (res) => {
33
     Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}&location=${sserLocation}` })
21
     Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}&location=${sserLocation}` })
34
-
35
   }
22
   }
36
   const goMapInfo = (res) => {
23
   const goMapInfo = (res) => {
37
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${sserLocation}` })
24
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${sserLocation}` })
38
-
39
-
40
   }
25
   }
41
 
26
 
42
-
43
-
44
   return (
27
   return (
45
-
46
-
47
     <>
28
     <>
48
       {
29
       {
49
         csrsListType?.length > 0 ? csrsListType.map((item, index) => {
30
         csrsListType?.length > 0 ? csrsListType.map((item, index) => {
69
             </View>
50
             </View>
70
           )
51
           )
71
         }) : <ListPlaceholder title='该分类暂无农机!' />
52
         }) : <ListPlaceholder title='该分类暂无农机!' />
72
-
73
       }
53
       }
74
-
75
-
76
     </>
54
     </>
77
   )
55
   )
78
 })
56
 })

+ 0
- 15
src/pages/MoreCars/index.jsx View File

38
 
38
 
39
   useEffect(() => {
39
   useEffect(() => {
40
     if (tabIndex !== 0) {
40
     if (tabIndex !== 0) {
41
-      // ClassificationComparison()
42
       activeNames.map((item) => {
41
       activeNames.map((item) => {
43
         classId.push({ id: item.typeId })
42
         classId.push({ id: item.typeId })
44
 
43
 
45
       })
44
       })
46
       getMachinery(sserLocation, { typeId: classId[tabIndex - 1].id }).then((e) => {
45
       getMachinery(sserLocation, { typeId: classId[tabIndex - 1].id }).then((e) => {
47
-        console.log('农机分类', e);
48
         steCsrsListType(e.records)
46
         steCsrsListType(e.records)
49
       })
47
       })
50
     } else {
48
     } else {
51
-      // ClassificationComparison()
52
-
53
       getMachinery(sserLocation, { pageSize: 999 }).then((e) => {
49
       getMachinery(sserLocation, { pageSize: 999 }).then((e) => {
54
         steCsrsListType(e.records)
50
         steCsrsListType(e.records)
55
       })
51
       })
56
     }
52
     }
57
-
58
-
59
   }, [sserLocation, tabIndex])
53
   }, [sserLocation, tabIndex])
60
 
54
 
61
-
62
   useEffect(() => {
55
   useEffect(() => {
63
-
64
     getMachineryType().then((e) => {
56
     getMachineryType().then((e) => {
65
       const tabList = e.records
57
       const tabList = e.records
66
       setActiveNames(tabList)
58
       setActiveNames(tabList)
67
       let tabss = tabList.map(x => ({ title: x.name, }))
59
       let tabss = tabList.map(x => ({ title: x.name, }))
68
       const newTabs = [{ title: '全部' }, ...tabss]
60
       const newTabs = [{ title: '全部' }, ...tabss]
69
       setTabs(newTabs)
61
       setTabs(newTabs)
70
-
71
     })
62
     })
72
   }, [])
63
   }, [])
73
 
64
 
74
   const goSearch = () => {
65
   const goSearch = () => {
75
     Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
66
     Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
76
-
77
   }
67
   }
78
-
79
-
80
   const handleTabChange = (e) => {
68
   const handleTabChange = (e) => {
81
-    console.log('e', e.detail);
82
     steTabIndex(e?.detail?.index)
69
     steTabIndex(e?.detail?.index)
83
-
84
   }
70
   }
85
 
71
 
86
-
87
   return (
72
   return (
88
     <View className='page-index'>
73
     <View className='page-index'>
89
       <View className='index-navbar'>
74
       <View className='index-navbar'>

+ 0
- 6
src/pages/MyAddressList/index.jsx View File

46
   const handelSwitch = (id) => {
46
   const handelSwitch = (id) => {
47
     addressDefault(id).then((res) => {
47
     addressDefault(id).then((res) => {
48
       getList()
48
       getList()
49
-      console.log(addresList);
50
     })
49
     })
51
 
50
 
52
   }
51
   }
59
     })
58
     })
60
   }
59
   }
61
   useDidShow(() => {
60
   useDidShow(() => {
62
-    console.log(9999);
63
     getList()
61
     getList()
64
   })
62
   })
65
 
63
 
66
-  // useEffect(() => {
67
-  //   getList()
68
-  // }, [])
69
-
70
   const handleAddress = (e) => {
64
   const handleAddress = (e) => {
71
     if (e) {
65
     if (e) {
72
       setUserOrderAddress(e)
66
       setUserOrderAddress(e)

+ 0
- 16
src/pages/OrderConfirmation/index.jsx View File

57
 
57
 
58
       // debugger
58
       // debugger
59
 
59
 
60
-      console.log('formSubmit', e?.detail);
61
       if (e?.detail?.value?.amount && e?.detail?.value?.appontmentDate && e?.detail?.value?.address) {
60
       if (e?.detail?.value?.amount && e?.detail?.value?.appontmentDate && e?.detail?.value?.address) {
62
         generateOrder({
61
         generateOrder({
63
           charges: carsInfo?.price * amount,
62
           charges: carsInfo?.price * amount,
97
       })
96
       })
98
       return;
97
       return;
99
     }
98
     }
100
-
101
-    // Taro.navigateTo({ url: `/pages/OrderInfo/index?goOrder=${id}` })
102
   }
99
   }
103
   useEffect(() => {
100
   useEffect(() => {
104
     if (id) {
101
     if (id) {
105
       getMachineryInfo(id, { location: location, attached: true }).then((e) => {
102
       getMachineryInfo(id, { location: location, attached: true }).then((e) => {
106
         setCarsInfo(e)
103
         setCarsInfo(e)
107
-        console.log('e', e);
108
       })
104
       })
109
     }
105
     }
110
   }, [id, sserLocation])
106
   }, [id, sserLocation])
111
   const onTimeChange = (e) => {
107
   const onTimeChange = (e) => {
112
-    console.log('时间选择器', e);
113
     // 获取当前时间 
108
     // 获取当前时间 
114
-
115
     setTimeSel(e?.detail?.value)
109
     setTimeSel(e?.detail?.value)
116
-
117
   }
110
   }
118
   const cancelPay = () => {
111
   const cancelPay = () => {
119
     Taro.navigateBack({
112
     Taro.navigateBack({
120
       delta: 1
113
       delta: 1
121
     })
114
     })
122
   }
115
   }
123
-
124
-
125
   const goAddress = () => {
116
   const goAddress = () => {
126
     Taro.navigateTo({ url: `/pages/MyAddressList/index?type=orderAddress` })
117
     Taro.navigateTo({ url: `/pages/MyAddressList/index?type=orderAddress` })
127
   }
118
   }
128
-
129
-
130
   return (
119
   return (
131
     <View className='page-index'>
120
     <View className='page-index'>
132
       <View className='index-navbar'>
121
       <View className='index-navbar'>
143
             <View>作业时间:</View>
132
             <View>作业时间:</View>
144
             <View className='example-body-WorkingTime-TimePicker'>
133
             <View className='example-body-WorkingTime-TimePicker'>
145
               <Image src={timeImage} />
134
               <Image src={timeImage} />
146
-              {/* <mp-pickerTime tips='请选择时间' isChinese={1} onChange={myevent} /> */}
147
-
148
               <Picker mode='date' name='appontmentDate' onChange={onTimeChange}>
135
               <Picker mode='date' name='appontmentDate' onChange={onTimeChange}>
149
                 <View className='picker' >
136
                 <View className='picker' >
150
                   {timeSel || '请选择日期'}
137
                   {timeSel || '请选择日期'}
151
                 </View>
138
                 </View>
152
               </Picker>
139
               </Picker>
153
             </View>
140
             </View>
154
-
155
           </View>
141
           </View>
156
           <View className='example-body-WorkingLocation'>
142
           <View className='example-body-WorkingLocation'>
157
             <View>作业位置:</View>
143
             <View>作业位置:</View>
158
             <View className='example-body-WorkingLocation-info' onClick={goAddress}>
144
             <View className='example-body-WorkingLocation-info' onClick={goAddress}>
159
               <Image src={addresss} />
145
               <Image src={addresss} />
160
               <Input name='address' disabled className='aTextareaCentent' value={userAddres} placeholder={userAddres == '' ? '请输入地址信息' : ''} />
146
               <Input name='address' disabled className='aTextareaCentent' value={userAddres} placeholder={userAddres == '' ? '请输入地址信息' : ''} />
161
-
162
             </View>
147
             </View>
163
           </View>
148
           </View>
164
           <View className='BottomtBut-box'>
149
           <View className='BottomtBut-box'>
167
           </View>
152
           </View>
168
         </Form>
153
         </Form>
169
       </View>
154
       </View>
170
-
171
     </View>
155
     </View>
172
   )
156
   )
173
 })
157
 })

+ 69
- 96
src/pages/OrderInfo/index.jsx View File

1
 import { View, Text } from "@tarojs/components"
1
 import { View, Text } from "@tarojs/components"
2
 import { useEffect, useState, useMemo } from "react"
2
 import { useEffect, useState, useMemo } from "react"
3
-import Taro, { useDidShow } from "@tarojs/taro"
3
+import Taro from "@tarojs/taro"
4
 import CustomNav from '@/components/CustomNav'
4
 import CustomNav from '@/components/CustomNav'
5
 import ButtontWX from '@/components/ButtontWX'
5
 import ButtontWX from '@/components/ButtontWX'
6
-import formatTimes from "@/utils/codeSegment"
6
+import AssessModel from "@/components/AssessModel"
7
 import withLayout from '@/layouts'
7
 import withLayout from '@/layouts'
8
+import formatTimes from "@/utils/codeSegment"
8
 import formatPrice from "@/utils/formatPrice"
9
 import formatPrice from "@/utils/formatPrice"
9
-import AssessModel from "@/components/AssessModel"
10
 import useProcessStatus, { getProcessSignBy } from "@/utils/hooks/useProcessStatus"
10
 import useProcessStatus, { getProcessSignBy } from "@/utils/hooks/useProcessStatus"
11
-import { orderPrepay, orderDelete, orderInfo, orderRefund } from "@/services/order"
12
-// import BottomMoadl from '@/components/BottomMoadl/index'
13
-
14
-
11
+import { orderPrepay, orderDelete, orderInfo } from "@/services/order"
12
+import { useModel } from "@/store"
15
 import './style.less'
13
 import './style.less'
16
 
14
 
17
 export default withLayout((props) => {
15
 export default withLayout((props) => {
18
-  // const { stateType } = props
19
 
16
 
20
   const $instance = Taro.getCurrentInstance()
17
   const $instance = Taro.getCurrentInstance()
21
   const { orderId } = $instance.router.params
18
   const { orderId } = $instance.router.params
22
-
19
+  const { orderList, setOrderList } = useModel('order')
23
   const [orderInfos, setOrderInfos] = useState()
20
   const [orderInfos, setOrderInfos] = useState()
24
-
25
   const [isAssessVisible, setIsAssessVisible] = useState(false)
21
   const [isAssessVisible, setIsAssessVisible] = useState(false)
26
-
27
   const { processStatus } = useProcessStatus(orderInfos)
22
   const { processStatus } = useProcessStatus(orderInfos)
28
 
23
 
29
-  //底部弹窗
30
-  // const [showFrame, setShowFrame] = useState(false)
31
-  // const setRecommend = () => {
32
-  //   setShowFrame(!showFrame)
33
-  // }
34
-
24
+  //取消订单
35
   const cancelPay = () => {
25
   const cancelPay = () => {
36
     Taro.showModal({
26
     Taro.showModal({
37
       title: '提示',
27
       title: '提示',
39
       success: function (res) {
29
       success: function (res) {
40
         if (res.confirm) {
30
         if (res.confirm) {
41
           orderDelete(orderId).then((e) => {
31
           orderDelete(orderId).then((e) => {
42
-            console.log('订单取消/删除', e);
43
             Taro.showToast({
32
             Taro.showToast({
44
               title: '订单取消成功',
33
               title: '订单取消成功',
45
               icon: 'success',
34
               icon: 'success',
46
               duration: 2000
35
               duration: 2000
47
             }).then(() => {
36
             }).then(() => {
48
               setTimeout(() => {
37
               setTimeout(() => {
38
+                var list = [];
39
+                for (var item of orderList) {
40
+                  if (item.orderId != orderId) {
41
+                    list.push(item)
42
+                  }
43
+                }
44
+                setOrderList(list);
49
                 Taro.navigateBack({
45
                 Taro.navigateBack({
50
                   delta: 1
46
                   delta: 1
51
                 })
47
                 })
59
     })
55
     })
60
   }
56
   }
61
 
57
 
62
-  useEffect(() => {
63
-    if (orderId) {
64
-      orderInfo(orderId).then((res) => {
65
-        setOrderInfos(res)
66
-      })
67
-    } else {
68
 
58
 
69
-      Taro.showToast({
70
-        title: '暂无订单详情',
71
-        icon: 'error',
72
-        duration: 2000
73
-      }).then(() => {
74
-        setTimeout(() => {
75
-          Taro.navigateBack({
76
-            delta: 1
77
-          })
78
-        }, 1000)
59
+  //支付
60
+  const pay = () => {
61
+    orderPrepay(orderId, {
62
+      payType: 'wx',
63
+    }).then((e) => {
64
+      console.log('订单返回', e);
65
+      Taro.showLoading({
66
+        title: '支付中',
79
       })
67
       })
80
-    }
81
-
82
-  }, [orderId])
83
-
68
+      requestPayment(e)
69
+    })
70
+  }
71
+  //微信支付付款
84
   const requestPayment = (params) => {
72
   const requestPayment = (params) => {
85
     Taro.hideLoading()
73
     Taro.hideLoading()
86
-    console.log("🚀 ~ file: index.jsx ~ line 92 ~ requestPayment ~ params", params)
87
     Taro.requestPayment({
74
     Taro.requestPayment({
88
       ...params,
75
       ...params,
89
-
90
       package: params.packageValue,
76
       package: params.packageValue,
91
       success: () => {
77
       success: () => {
92
         Taro.showToast({
78
         Taro.showToast({
95
           duration: 1000,
81
           duration: 1000,
96
         }).then(() => {
82
         }).then(() => {
97
           setTimeout(() => {
83
           setTimeout(() => {
98
-            Taro.reLaunch({
99
-              url: `/pages/index/index?tab=2`
84
+            var list = [...orderList];
85
+            for (var item of list) {
86
+              if (item.orderId == orderId) {
87
+                item.payStatus = 1
88
+              }
89
+            }
90
+            setOrderList(list);
91
+            Taro.navigateBack({
92
+              delta: 1
100
             })
93
             })
101
           }, 400)
94
           }, 400)
102
         })
95
         })
107
           icon: "none",
100
           icon: "none",
108
           duration: 2000,
101
           duration: 2000,
109
         });
102
         });
110
-        Taro.reLaunch({
111
-          // url: `/pages/MineUserAll/AllOrder/index?tabJump=1`
112
-        })
113
       },
103
       },
114
     })
104
     })
115
   }
105
   }
116
 
106
 
117
-  const pay = () => {
118
-
119
-    orderPrepay(orderId, {
120
-      payType: 'wx',
121
-
122
-    }).then((e) => {
123
-      console.log('订单返回', e);
124
-      Taro.showLoading({
125
-        title: '支付中',
126
-      })
127
-      requestPayment(e)
128
-
129
-    })
130
-    //支付逻辑
131
-  }
132
-
133
-  //退单
134
-  const orderRefunds = () => {
135
-    Taro.showLoading({
136
-      title: '退单申请中',
137
-    })
138
-    orderRefund(orderId).then(() => {
139
-      Taro.showLoading()
140
-
141
-      Taro.showToast({
142
-        title: "退单成功",
143
-        icon: "none",
144
-        duration: 2000,
145
-      }).then(() => {
146
-        setTimeout(() => {
147
-          Taro.navigateBack({
148
-            delta: 1
149
-          })
150
-        }, 400)
151
-
152
-
153
-      })
154
-    }).catch(() => {
155
-      Taro.showLoading()
156
-      Taro.showToast({
157
-        title: "请重试",
158
-        icon: "error",
159
-        duration: 2000,
160
-      });
161
-    })
162
-  }
107
+  //弹出弹窗
163
   const startModle = () => {
108
   const startModle = () => {
164
     setIsAssessVisible(true)
109
     setIsAssessVisible(true)
165
-
166
   }
110
   }
111
+  //关闭评价弹窗
167
   const onClose = () => {
112
   const onClose = () => {
168
     setIsAssessVisible(false)
113
     setIsAssessVisible(false)
114
+    var list = [...orderList];
115
+    for (var item of list) {
116
+      if (item.orderId == orderId) {
117
+        item.isEvaluated = 1
118
+      }
119
+    }
120
+    setOrderList(list);
169
     Taro.navigateBack({
121
     Taro.navigateBack({
170
       delta: 1
122
       delta: 1
171
     })
123
     })
172
 
124
 
173
   }
125
   }
174
-
175
-  const { processLabel, stateStyle, action : Actions } = useMemo(() => {
126
+  //显示底部按钮
127
+  const { processLabel, stateStyle, action: Actions } = useMemo(() => {
176
     const { label, color } = getProcessSignBy(processStatus)
128
     const { label, color } = getProcessSignBy(processStatus)
177
     let action = <></>;
129
     let action = <></>;
178
 
130
 
192
       default:
144
       default:
193
         break;
145
         break;
194
     }
146
     }
195
-    return  {
147
+    return {
196
       processLabel: label,
148
       processLabel: label,
197
       stateStyle: color,
149
       stateStyle: color,
198
       action
150
       action
199
     }
151
     }
200
   }, [processStatus])
152
   }, [processStatus])
201
 
153
 
154
+  useEffect(() => {
155
+    if (orderId) {
156
+      orderInfo(orderId).then((res) => {
157
+        setOrderInfos(res)
158
+      })
159
+    } else {
160
+      Taro.showToast({
161
+        title: '暂无订单详情',
162
+        icon: 'error',
163
+        duration: 2000
164
+      }).then(() => {
165
+        setTimeout(() => {
166
+          Taro.navigateBack({
167
+            delta: 1
168
+          })
169
+        }, 1000)
170
+      })
171
+    }
172
+  }, [orderId])
173
+
202
   return (
174
   return (
203
     <View className='page-index'>
175
     <View className='page-index'>
204
       <View className='index-navbar'>
176
       <View className='index-navbar'>
205
         <CustomNav title='订单详情' />
177
         <CustomNav title='订单详情' />
206
       </View>
178
       </View>
207
-      <AssessModel orderId={orderId} showCutover={isAssessVisible} maskClosable={isAssessVisible} onClose={onClose} onFinish={onClose} />
179
+      {/* 评价弹窗 */}
180
+      <AssessModel orderId={orderId} showCutover={isAssessVisible} onClose={onClose} />
208
       {/* <BottomMoadl frameTitle='支付方式' flag={showFrame} onRecommend={setRecommend} /> */}
181
       {/* <BottomMoadl frameTitle='支付方式' flag={showFrame} onRecommend={setRecommend} /> */}
209
       <View className='orders-listBox-RihtboxBoxOrderViewText'>
182
       <View className='orders-listBox-RihtboxBoxOrderViewText'>
210
         <View className='View-LiftTextTop'>订单编号:<Text>{orderInfos?.orderNo}</Text></View>
183
         <View className='View-LiftTextTop'>订单编号:<Text>{orderInfos?.orderNo}</Text></View>

+ 4
- 23
src/pages/Search/index.jsx View File

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
-import CustomNav from '@/components/CustomNav'
3
-import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
4
-
2
+import { useState } from 'react'
5
 import { View, Input, Image } from '@tarojs/components'
3
 import { View, Input, Image } from '@tarojs/components'
6
 import withLayout from '@/layouts'
4
 import withLayout from '@/layouts'
7
-import { useThrottle } from '@/utils/codeSegment'
5
+import CustomNav from '@/components/CustomNav'
8
 import CarsListContent from "@/components/CarsListContent"
6
 import CarsListContent from "@/components/CarsListContent"
7
+import { useThrottle } from '@/utils/codeSegment'
9
 import { getMachinery } from '@/services/homes'
8
 import { getMachinery } from '@/services/homes'
10
-import { useModel } from '@/store'
11
-
12
-
9
+import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
13
 import './style.less'
10
 import './style.less'
14
-import { useState } from 'react'
15
-
16
-
17
 
11
 
18
 export default withLayout((props) => {
12
 export default withLayout((props) => {
19
   const $instance = Taro.getCurrentInstance()
13
   const $instance = Taro.getCurrentInstance()
20
   const { id, location } = $instance.router.params
14
   const { id, location } = $instance.router.params
21
-  console.log("🚀 ~ file: index.jsx ~ line 20 ~ withLayout ~ location", location)
22
-
23
-  const handleSearch = (e) => {
24
-    console.log("🚀 ~ file: index.jsx ~ line 14 ~ handleSearch ~ e", e)
25
-
26
-  }
27
 
15
 
28
   const [carsList, setCarsList] = useState([])
16
   const [carsList, setCarsList] = useState([])
29
   //节流 搜索
17
   //节流 搜索
30
   const handlerSearch = useThrottle((e) => {
18
   const handlerSearch = useThrottle((e) => {
31
     const { value } = e?.detail
19
     const { value } = e?.detail
32
     getMachinery(location, { q: value, location: location }).then((res) => {
20
     getMachinery(location, { q: value, location: location }).then((res) => {
33
-      console.log('根据农机名字查', res);
34
       setCarsList(res.records)
21
       setCarsList(res.records)
35
     })
22
     })
36
-
37
   }, 1000)
23
   }, 1000)
38
 
24
 
39
   return (
25
   return (
48
       <scroll-view scrollY style='height: 100%;' >
34
       <scroll-view scrollY style='height: 100%;' >
49
         <View className='CarsListContent'>
35
         <View className='CarsListContent'>
50
           <CarsListContent carsList={carsList} />
36
           <CarsListContent carsList={carsList} />
51
-
52
         </View>
37
         </View>
53
-
54
-
55
-
56
       </scroll-view>
38
       </scroll-view>
57
     </View>
39
     </View>
58
   )
40
   )
59
-
60
 })
41
 })

+ 1
- 1
src/pages/UserLogin/index.config.js View File

1
 
1
 
2
 export default {
2
 export default {
3
-  navigationBarTitleText: '登',
3
+  navigationBarTitleText: '登',
4
   navigationStyle: 'custom',
4
   navigationStyle: 'custom',
5
   disableScroll: true,
5
   disableScroll: true,
6
   usingComponents: {
6
   usingComponents: {

+ 2
- 2
src/pages/UserLogin/index.jsx View File

118
 //   return (
118
 //   return (
119
 //     <View className='page-index' hidden={isLoginVisible}>
119
 //     <View className='page-index' hidden={isLoginVisible}>
120
 //       <View className='index-navbar'>
120
 //       <View className='index-navbar'>
121
-//         <CustomNav title='登' home />
121
+//         <CustomNav title='登' home />
122
 //       </View>
122
 //       </View>
123
 //       <View className='loginBackImg-box' >
123
 //       <View className='loginBackImg-box' >
124
 //         <Image src={require("@/assets/lolginImages/backLogin.png")} />
124
 //         <Image src={require("@/assets/lolginImages/backLogin.png")} />
143
 //         </View>
143
 //         </View>
144
 //       </View>
144
 //       </View>
145
 //       <View className='BottomtButrelative'  >
145
 //       <View className='BottomtButrelative'  >
146
-//         <ButtontWX onClick={getUserLogin} butText='登' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
146
+//         <ButtontWX onClick={getUserLogin} butText='登' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
147
 //       </View>
147
 //       </View>
148
 //       <View className='bottom-agreement'>
148
 //       <View className='bottom-agreement'>
149
 //         <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />
149
 //         <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />

+ 0
- 26
src/pages/index/index.jsx View File

28
 export default withLayout((props) => {
28
 export default withLayout((props) => {
29
   const { router } = props
29
   const { router } = props
30
   const { person } = useModel('userData')
30
   const { person } = useModel('userData')
31
-
32
-
33
   const { params, path } = router
31
   const { params, path } = router
34
-
35
-
36
   const { tab } = params || {}
32
   const { tab } = params || {}
37
-
38
-
39
-  console.log("🚀 ~ file: index.jsx ~ line 24 ~ withLayout ~ tab", tab)
40
   const [currentTab, setCurrentTab] = useState(0)
33
   const [currentTab, setCurrentTab] = useState(0)
41
-
42
-
43
-
44
-  // const [isShow, setIsShow] = useState(false)
45
-
46
-
47
   useDidShow(() => {
34
   useDidShow(() => {
48
-    console.log('useDidShow',);
49
-
50
     if (!person?.phone) {
35
     if (!person?.phone) {
51
-      console.log('还是未登录',);
52
       setCurrentTab(0)
36
       setCurrentTab(0)
53
     }
37
     }
54
   })
38
   })
55
 
39
 
56
   useEffect(() => {
40
   useEffect(() => {
57
-    // setCurrentTab(index)
58
-
59
     if (tab) {
41
     if (tab) {
60
       setCurrentTab(tab - 0)
42
       setCurrentTab(tab - 0)
61
     }
43
     }
62
-    // setIsShow(true)
63
   }, [tab,])
44
   }, [tab,])
64
 
45
 
65
   const handleClick = (index) => {
46
   const handleClick = (index) => {
66
-    // Taro.switchTab({
67
-    //   url: '/pages/InformationPage/index'
68
-    // })
69
     if (!person?.phone) {
47
     if (!person?.phone) {
70
       Taro.navigateTo({ url: `/pages/LoginPage/index?login=true&tab=${index}` })
48
       Taro.navigateTo({ url: `/pages/LoginPage/index?login=true&tab=${index}` })
71
-      // setIsShow(true)
72
     } else {
49
     } else {
73
       Taro.redirectTo({ url: `/pages/index/index?tab=${index}` });
50
       Taro.redirectTo({ url: `/pages/index/index?tab=${index}` });
74
-      // setCurrentTab(index)
75
     }
51
     }
76
   }
52
   }
77
 
53
 
78
-
79
   return (
54
   return (
80
     <view className='page-index'>
55
     <view className='page-index'>
81
       {/* <LoginModel isLoginVisible={isShow} /> */}
56
       {/* <LoginModel isLoginVisible={isShow} /> */}
120
           <Image className='tabberImg' src={currentTab == 3 ? MineNOImgaes : MineOFFImgaes}></Image>
95
           <Image className='tabberImg' src={currentTab == 3 ? MineNOImgaes : MineOFFImgaes}></Image>
121
           <View className='text'>我的</View>
96
           <View className='text'>我的</View>
122
         </View>
97
         </View>
123
-        {/* <mp-tabbar extClass='custom-tabbar' autoSelect={false} current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar> */}
124
       </view>
98
       </view>
125
     </view>
99
     </view>
126
   )
100
   )

+ 0
- 19
src/pages/index/tabs/Homes.jsx View File

26
 
26
 
27
   useEffect(() => {
27
   useEffect(() => {
28
     getHomeBanner({ position: 'banner' }).then((e) => {
28
     getHomeBanner({ position: 'banner' }).then((e) => {
29
-      console.log('e', e);
30
       setBannerHome(e)
29
       setBannerHome(e)
31
     })
30
     })
32
     getMachinery(sserLocation, { pageNum: currentPage, }).then((e) => {
31
     getMachinery(sserLocation, { pageNum: currentPage, }).then((e) => {
33
       const records = currentPage === 1 ? e.records || [] : carsList.concat(e.records || [])
32
       const records = currentPage === 1 ? e.records || [] : carsList.concat(e.records || [])
34
-      console.log("🚀 ~ file: Orders.jsx ~ line 41 ~ getOrder ~ records", records)
35
       if (e.records.length == 0 && currentPage != 1) {
33
       if (e.records.length == 0 && currentPage != 1) {
36
         setIsMore(true)
34
         setIsMore(true)
37
         return
35
         return
38
       }
36
       }
39
       setCarsList(records)
37
       setCarsList(records)
40
     })
38
     })
41
-
42
   }, [currentPage, sserLocation])
39
   }, [currentPage, sserLocation])
43
 
40
 
44
-
45
-
46
   const handleScrollToLower = () => {
41
   const handleScrollToLower = () => {
47
     if (carsList.length < 9) {
42
     if (carsList.length < 9) {
48
       return;
43
       return;
49
     } else {
44
     } else {
50
       setCurrentPage(currentPage + 1)
45
       setCurrentPage(currentPage + 1)
51
-
52
     }
46
     }
53
   }
47
   }
54
 
48
 
55
-
56
-
57
-
58
-
59
   const goSearch = () => {
49
   const goSearch = () => {
60
     Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
50
     Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
61
-
62
   }
51
   }
63
 
52
 
64
   const goToCarsList = () => {//更多
53
   const goToCarsList = () => {//更多
65
     Taro.navigateTo({ url: `/pages/MoreCars/index` })
54
     Taro.navigateTo({ url: `/pages/MoreCars/index` })
66
-
67
-
68
-
69
   }
55
   }
70
 
56
 
71
-
72
   return (
57
   return (
73
     <scroll-view
58
     <scroll-view
74
       className='scrollView'
59
       className='scrollView'
75
       scrollY
60
       scrollY
76
       style='height: 100%;'
61
       style='height: 100%;'
77
       onScrollToLower={isMore ? '' : handleScrollToLower}
62
       onScrollToLower={isMore ? '' : handleScrollToLower}
78
-
79
     >
63
     >
80
 
64
 
81
       <View className='heads-top-box'>
65
       <View className='heads-top-box'>
90
         </View>
74
         </View>
91
       </View>
75
       </View>
92
       <Swiper
76
       <Swiper
93
-
94
         mode='scaleToFill'
77
         mode='scaleToFill'
95
         className='swiper-box'
78
         className='swiper-box'
96
       >
79
       >
108
         <View onClick={goToCarsList} className='content-header-box-rightCentent'>更多&gt;&gt;</View>
91
         <View onClick={goToCarsList} className='content-header-box-rightCentent'>更多&gt;&gt;</View>
109
       </View>
92
       </View>
110
       <CarsListContent carsList={carsList} />
93
       <CarsListContent carsList={carsList} />
111
-
112
-
113
     </scroll-view>
94
     </scroll-view>
114
   )
95
   )
115
 })
96
 })

+ 2
- 2
src/pages/index/tabs/Mine.jsx View File

105
               <Image className='Userback' src={back} />
105
               <Image className='Userback' src={back} />
106
 
106
 
107
               <Image className='User-Avatar-background-falseBox-userImg userImg' src={userMoren} />
107
               <Image className='User-Avatar-background-falseBox-userImg userImg' src={userMoren} />
108
-              <View onClick={userLoginnow} className='User-Avatar-background-falseBox-userLogin' >点击登</View>
108
+              <View onClick={userLoginnow} className='User-Avatar-background-falseBox-userLogin' >点击登</View>
109
             </View>
109
             </View>
110
             :
110
             :
111
             <>
111
             <>
153
 
153
 
154
         {/* {
154
         {/* {
155
           !isLoginBox ? '' :
155
           !isLoginBox ? '' :
156
-            <View className='bottom-buttom'>退出登</View>
156
+            <View className='bottom-buttom'>退出登</View>
157
         } */}
157
         } */}
158
 
158
 
159
       </View>
159
       </View>

+ 1
- 1
src/pages/index/tabs/MineCss/style.less View File

35
   }
35
   }
36
 }
36
 }
37
 
37
 
38
-//已登样式-----------------------
38
+//已登样式-----------------------
39
 
39
 
40
 .User-Avatar-background-trueBox {
40
 .User-Avatar-background-trueBox {
41
   background-size: 100% 100%;
41
   background-size: 100% 100%;

+ 23
- 46
src/pages/index/tabs/Orders.jsx View File

3
 import Taro, { useDidShow } from '@tarojs/taro'
3
 import Taro, { useDidShow } from '@tarojs/taro'
4
 import ListPlaceholder from "@/components/ListPlaceholder"
4
 import ListPlaceholder from "@/components/ListPlaceholder"
5
 import withLayout from '@/layouts'
5
 import withLayout from '@/layouts'
6
-
7
 import ordersListImga from '@/assets/ordersImages/ordersListImga.png'
6
 import ordersListImga from '@/assets/ordersImages/ordersListImga.png'
8
 import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
7
 import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
9
 import { useEffect, useState } from "react"
8
 import { useEffect, useState } from "react"
10
 import { getOrder } from "@/services/order"
9
 import { getOrder } from "@/services/order"
11
 import formatTimes from "@/utils/codeSegment"
10
 import formatTimes from "@/utils/codeSegment"
12
-import { useModel } from "@/store"
13
 import formatPrice from "@/utils/formatPrice"
11
 import formatPrice from "@/utils/formatPrice"
14
 import { getProcessStatus, getProcessSignBy } from "@/utils/hooks/useProcessStatus"
12
 import { getProcessStatus, getProcessSignBy } from "@/utils/hooks/useProcessStatus"
15
-
13
+import { useModel } from "@/store"
16
 import './OrdersCss/style.less'
14
 import './OrdersCss/style.less'
17
 
15
 
18
 
16
 
19
 
17
 
20
 export default withLayout((props) => {
18
 export default withLayout((props) => {
21
 
19
 
22
-  const [ourderList, setOrderList] = useState([])
23
-
24
-  const [currentPage, setCurrentPage] = useState(1)
25
-
26
-  const [isMore, setIsMore] = useState(false)
27
-
28
-  const { person, setPerson } = useModel('userData')
29
-
30
-
31
-  useDidShow(() => {
32
-    getOrder({ pageNum: currentPage || 1, mine: true }).then((e) => {
33
-      const { records } = e
34
-      setOrderList(records)
35
-    })
36
-  })
37
-
20
+  const { orderList, setOrderList, pageNum, setPageNum, isMore, setIsMore } = useModel('order')
21
+  
38
   const handleScrollToLower = () => {
22
   const handleScrollToLower = () => {
39
-    if (ourderList.length < 9) {
23
+    if (orderList.length < 9) {
40
       return;
24
       return;
41
     } else {
25
     } else {
42
-      setCurrentPage(currentPage + 1)
43
-
26
+      setPageNum(pageNum + 1)
44
     }
27
     }
45
   }
28
   }
46
-  useEffect(() => {
47
-    getOrder({ pageNum: currentPage, mine: true }).then((e) => {
48
-      const records = currentPage === 1 ? e.records || [] : ourderList.concat(e.records || [])
49
-      console.log("🚀 ~ file: Orders.jsx ~ line 41 ~ getOrder ~ records", records)
50
-      if (e.records.length == 0 && currentPage != 1) {
51
-        setIsMore(true)
52
-        return
53
-      }
54
-      // setJobList(lst)
55
-      setOrderList(records)
56
-
57
-
58
-
59
-    })
60
-  }, [currentPage])
61
-  console.log(ourderList, 'ourderList');
62
-
63
   const orderStates = (item) => {
29
   const orderStates = (item) => {
64
     const processStatus = getProcessStatus(item)
30
     const processStatus = getProcessStatus(item)
65
     const { label: title, color: styleColor } = getProcessSignBy(processStatus)
31
     const { label: title, color: styleColor } = getProcessSignBy(processStatus)
66
     return { title, styleColor }
32
     return { title, styleColor }
67
   }
33
   }
68
 
34
 
69
-  const handleTobePaid = (id, stateType, stateStyle) => {
70
-    Taro.navigateTo({ url: `/pages/OrderInfo/index?orderId=${id}&stateType=${stateType}&stateStyle=${stateStyle}` })
35
+  const handleTobePaid = (id) => {
36
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?orderId=${id}` })
71
   }
37
   }
72
-
38
+  useEffect(()=>{
39
+    setPageNum(1);
40
+    setIsMore(false);
41
+  },[])
42
+  useEffect(() => {
43
+    getOrder({ pageNum: pageNum, mine: true }).then((e) => {
44
+      const records = pageNum === 1 ? e.records || [] : orderList.concat(e.records || [])
45
+      if (e.records.length == 0 && pageNum != 1) {
46
+        setIsMore(true)
47
+        return
48
+      }
49
+      setOrderList(records)
50
+    })
51
+  }, [pageNum])
73
 
52
 
74
   return (
53
   return (
75
     <scroll-view
54
     <scroll-view
77
       style='height: 100%;'
56
       style='height: 100%;'
78
       onScrollToLower={isMore ? '' : handleScrollToLower}
57
       onScrollToLower={isMore ? '' : handleScrollToLower}
79
     >
58
     >
80
-
81
       <View className='content-header-box-orders'>
59
       <View className='content-header-box-orders'>
82
         <View className='content-header-box-orders-liftCentent'>
60
         <View className='content-header-box-orders-liftCentent'>
83
           <Image src={ordersListImga} />
61
           <Image src={ordersListImga} />
84
           <View>订单列表</View>
62
           <View>订单列表</View>
85
         </View>
63
         </View>
86
-        {/* <View className='content-header-box-orders-rightCentent'>更多&gt;&gt;</View> */}
87
       </View>
64
       </View>
88
       {
65
       {
89
-        ourderList?.length > 0 ? ourderList.map((item, index) => {
66
+        orderList?.length > 0 ? orderList.map((item, index) => {
90
           return (
67
           return (
91
             <View key={index} className='orders-listBox'>
68
             <View key={index} className='orders-listBox'>
92
               <Image src={ordersLeft} />
69
               <Image src={ordersLeft} />
93
               <View className='orders-listBox-RihtboxBoxOrderViewText'>
70
               <View className='orders-listBox-RihtboxBoxOrderViewText'>
94
-                <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId, orderStates(item)?.title, orderStates(item)?.styleColor)} >
71
+                <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId)} >
95
                   编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>详情&gt;&gt;</Text></View>
72
                   编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>详情&gt;&gt;</Text></View>
96
                 <View>农机名称:<Text>{item.machineryName}</Text></View>
73
                 <View>农机名称:<Text>{item.machineryName}</Text></View>
97
                 <View>作业面积:<Text>{item.amount}</Text></View>
74
                 <View>作业面积:<Text>{item.amount}</Text></View>

+ 2
- 2
src/routes.js View File

25
     page: 'pages/OrderConfirmation/index',
25
     page: 'pages/OrderConfirmation/index',
26
   },
26
   },
27
   {
27
   {
28
-    title: '登页',
28
+    title: '登页',
29
     page: 'pages/UserLogin/index',
29
     page: 'pages/UserLogin/index',
30
   },
30
   },
31
   {
31
   {
92
 
92
 
93
 
93
 
94
   {
94
   {
95
-    title: '登页面~',
95
+    title: '登页面~',
96
     page: 'pages/LoginPage/index',
96
     page: 'pages/LoginPage/index',
97
   },
97
   },
98
 
98
 

+ 1
- 1
src/services/login.js View File

14
 export const getUserQcode = (params) => request('/sms-captcha', { method: 'post', params })
14
 export const getUserQcode = (params) => request('/sms-captcha', { method: 'post', params })
15
 
15
 
16
 /**
16
 /**
17
-* 验证码登修改
17
+* 验证码登修改
18
 * @param {*} 
18
 * @param {*} 
19
 * @returns 
19
 * @returns 
20
 */
20
 */

+ 2
- 1
src/store/index.js View File

1
 import { createStore, createStoreRoot, createModelHook } from '@zjxpcyc/react-tiny-store'
1
 import { createStore, createStoreRoot, createModelHook } from '@zjxpcyc/react-tiny-store'
2
 import userData from './userData'
2
 import userData from './userData'
3
+import order from './order'
3
 
4
 
4
 const store = createStore()
5
 const store = createStore()
5
-const models = { userData, }
6
+const models = { userData,order }
6
 
7
 
7
 
8
 
8
 
9
 

+ 8
- 0
src/store/order.js View File

1
+import { useState } from "react";
2
+
3
+export default () => {
4
+  const [orderList, setOrderList] = useState();
5
+  const [pageNum, setPageNum] = useState(1);
6
+  const [isMore, setIsMore] = useState(false);
7
+  return { orderList, setOrderList, pageNum, setPageNum, isMore, setIsMore };
8
+};

+ 0
- 7
src/store/userData.js View File

11
   const [sserLocation, setUserLocation] = useState('')
11
   const [sserLocation, setUserLocation] = useState('')
12
   const [userOrderAddress, setUserOrderAddress] = useState('')
12
   const [userOrderAddress, setUserOrderAddress] = useState('')
13
 
13
 
14
-
15
-
16
-  // console.log("🚀 来自store的打印 person数据", person)
17
-
18
-
19
-
20
-
21
   const logins = (params) => {
14
   const logins = (params) => {
22
     login(params).then((res) => {
15
     login(params).then((res) => {
23
       const { person: taPerson, sessionKey: skey } = res;
16
       const { person: taPerson, sessionKey: skey } = res;

+ 54
- 47
src/utils/hooks/useProcessStatus.js View File

1
 import { useState, useEffect } from "react";
1
 import { useState, useEffect } from "react";
2
 
2
 
3
 export default function useProcessStatus(orderInfo) {
3
 export default function useProcessStatus(orderInfo) {
4
-/**
5
- * 业务流程如下:
6
- * 1、农户下单 - 未支付 (管理端待分配订单)
7
- * 2、农机手待接单
8
- * 3、农机手接单干活
9
- * 4、农机手结单 - 确定亩数 (农户待支付)
10
- * 5、农户待评价
11
- * 6、结单(订单完成)
12
- */
4
+  /**
5
+   * 业务流程如下:
6
+   * 1、农户下单 - 未支付 (管理端待分配订单)
7
+   * 2、农机手待接单
8
+   * 3、农机手接单干活
9
+   * 4、农机手结单 - 确定亩数 (农户待支付)
10
+   * 5、农户待评价
11
+   * 6、结单(订单完成)
12
+   */
13
 
13
 
14
-  const [processStatus, setProcessStatus] = useState()
14
+  const [processStatus, setProcessStatus] = useState();
15
 
15
 
16
   useEffect(() => {
16
   useEffect(() => {
17
     if (!orderInfo || !orderInfo.orderId) return;
17
     if (!orderInfo || !orderInfo.orderId) return;
18
 
18
 
19
     setProcessStatus(getProcessStatus(orderInfo));
19
     setProcessStatus(getProcessStatus(orderInfo));
20
-  }, [orderInfo])
20
+  }, [orderInfo]);
21
 
21
 
22
-  return { processStatus }
22
+  return { processStatus };
23
 }
23
 }
24
 
24
 
25
 export function getProcessStatus(orderInfo) {
25
 export function getProcessStatus(orderInfo) {
26
-  
27
   if (!orderInfo || !orderInfo.orderId) return;
26
   if (!orderInfo || !orderInfo.orderId) return;
28
 
27
 
29
   // 订单完成
28
   // 订单完成
30
   if (orderInfo.isEvaluated) {
29
   if (orderInfo.isEvaluated) {
31
-    return 6
30
+    return 6;
32
   }
31
   }
33
-  
32
+
34
   // 待支付
33
   // 待支付
35
-  if (orderInfo.workStatus === 3 && orderInfo.charges > 0 && orderInfo.payStatus !== 1) {
36
-    return 4
34
+  if (
35
+    orderInfo.workStatus === 3 &&
36
+    orderInfo.charges > 0 &&
37
+    orderInfo.payStatus !== 1
38
+  ) {
39
+    return 4;
37
   }
40
   }
38
 
41
 
39
   // 待评价
42
   // 待评价
40
   if (orderInfo.workStatus === 3 && !orderInfo.isEvaluated) {
43
   if (orderInfo.workStatus === 3 && !orderInfo.isEvaluated) {
41
-    return 5
44
+    return 5;
42
   }
45
   }
43
 
46
 
44
   // 工作中
47
   // 工作中
45
-  if (orderInfo.workStatus > 0 && orderInfo.workStatus < 3 && orderInfo.dispatchStatus) {
46
-    return 3
48
+  if (
49
+    orderInfo.workStatus > 0 &&
50
+    orderInfo.workStatus < 3 &&
51
+    orderInfo.dispatchStatus
52
+  ) {
53
+    return 3;
47
   }
54
   }
48
 
55
 
49
   // 待接单
56
   // 待接单
50
   if (!orderInfo.workStatus && orderInfo.dispatchStatus) {
57
   if (!orderInfo.workStatus && orderInfo.dispatchStatus) {
51
-    return 2
58
+    return 2;
52
   }
59
   }
53
 
60
 
54
   // 待分配
61
   // 待分配
55
   if (orderInfo.status === 1 && !orderInfo.dispatchStatus) {
62
   if (orderInfo.status === 1 && !orderInfo.dispatchStatus) {
56
-    return 1
63
+    return 1;
57
   }
64
   }
58
-  
59
-  return -1
65
+
66
+  return -1;
60
 }
67
 }
61
 
68
 
62
 export function getProcessSignBy(status) {
69
 export function getProcessSignBy(status) {
63
-  if (status === undefined || status === null) return {}
64
-  
70
+  if (status === undefined || status === null) return {};
71
+
65
   switch (status) {
72
   switch (status) {
66
     case 1:
73
     case 1:
67
       return {
74
       return {
68
-        label: '待分配',
69
-        color: '#FF703B'
70
-      }
75
+        label: "待分配",
76
+        color: "#FF703B",
77
+      };
71
     case 2:
78
     case 2:
72
       return {
79
       return {
73
-        label: '待作业',
74
-        color: '#FF703B'
75
-      }
80
+        label: "待作业",
81
+        color: "#FF703B",
82
+      };
76
     case 3:
83
     case 3:
77
       return {
84
       return {
78
-        label: '进行中',
79
-        color: '#44F68B'
80
-      }
85
+        label: "进行中",
86
+        color: "#44F68B",
87
+      };
81
     case 4:
88
     case 4:
82
       return {
89
       return {
83
-        label: '待付款',
84
-        color: '#51D4FF'
85
-      }
90
+        label: "待付款",
91
+        color: "#51D4FF",
92
+      };
86
     case 5:
93
     case 5:
87
       return {
94
       return {
88
-        label: '待评价',
89
-        color: '#51D4FF'
90
-      }
95
+        label: "待评价",
96
+        color: "#51D4FF",
97
+      };
91
     case 6:
98
     case 6:
92
       return {
99
       return {
93
-        label: '已完成',
94
-        color: '#FF703B'
95
-      }
100
+        label: "已完成",
101
+        color: "#FF703B",
102
+      };
96
     default:
103
     default:
97
       return {
104
       return {
98
-        label: '异常',
99
-        color: '#FF0000'
100
-      }
105
+        label: "异常",
106
+        color: "#FF0000",
107
+      };
101
   }
108
   }
102
 }
109
 }