[baozhangchao] преди 3 години
родител
ревизия
6b6a130335
променени са 41 файла, в които са добавени 677 реда и са изтрити 193 реда
  1. BIN
      src/assets/icons/comm/starOff.png
  2. BIN
      src/assets/icons/comm/starOn.png
  3. BIN
      src/assets/tabbar/newsOFFImages.png
  4. BIN
      src/assets/tabbar/newsONImages.png
  5. 116
    0
      src/components/AssessModel/index.jsx
  6. 55
    0
      src/components/AssessModel/style.less
  7. 11
    9
      src/components/CarsListContent/index.jsx
  8. 2
    2
      src/components/LoginModel/index.jsx
  9. 11
    0
      src/components/Popup/index.jsx
  10. 9
    0
      src/components/Popup/style.less
  11. 5
    5
      src/components/orderRater/index.js
  12. 1
    1
      src/layouts/index.jsx
  13. 3
    3
      src/pages/CheckDetails/index.jsx
  14. 13
    10
      src/pages/CheckMap/index.jsx
  15. 0
    57
      src/pages/HelpCenterInfo/index.jsx
  16. 15
    0
      src/pages/InformationInfo/InfoImgaText.jsx
  17. 1
    1
      src/pages/InformationInfo/index.config.js
  18. 61
    0
      src/pages/InformationInfo/index.jsx
  19. 0
    0
      src/pages/InformationInfo/infoimgaText.less
  20. 15
    0
      src/pages/InformationInfo/style.less
  21. 2
    1
      src/pages/MoreCars/CarTypeList.jsx
  22. 15
    24
      src/pages/MoreCars/index.jsx
  23. 5
    2
      src/pages/MyAddressList/index.jsx
  24. 4
    4
      src/pages/OrderConfirmation/index.jsx
  25. 2
    0
      src/pages/OrderInfo/index.config.js
  26. 40
    5
      src/pages/OrderInfo/index.jsx
  27. 9
    0
      src/pages/OrderInfo/style.less
  28. 10
    0
      src/pages/Search/index.config.js
  29. 56
    0
      src/pages/Search/index.jsx
  30. 24
    0
      src/pages/Search/style.less
  31. 4
    2
      src/pages/index/index.jsx
  32. 5
    0
      src/pages/index/tabbar.js
  33. 8
    3
      src/pages/index/tabs/Homes.jsx
  34. 50
    0
      src/pages/index/tabs/Information.jsx
  35. 4
    0
      src/pages/index/tabs/InformationCss/style.less
  36. 3
    9
      src/pages/index/tabs/Mine.jsx
  37. 57
    52
      src/pages/index/tabs/Orders.jsx
  38. 12
    2
      src/routes.js
  39. 18
    0
      src/services/news.js
  40. 6
    1
      src/services/order.js
  41. 25
    0
      src/utils/codeSegment.js

BIN
src/assets/icons/comm/starOff.png Целия файл


BIN
src/assets/icons/comm/starOn.png Целия файл


BIN
src/assets/tabbar/newsOFFImages.png Целия файл


BIN
src/assets/tabbar/newsONImages.png Целия файл


+ 116
- 0
src/components/AssessModel/index.jsx Целия файл

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

+ 55
- 0
src/components/AssessModel/style.less Целия файл

@@ -0,0 +1,55 @@
1
+.modelBack {
2
+  width: 100vw;
3
+  height: 100vh;
4
+  background-color: rgba(0, 0, 0, 0.2);
5
+  z-index: 10;
6
+  position: fixed;
7
+  top: 0;
8
+  left: 0;
9
+}
10
+
11
+.assessModel-box {
12
+  z-index: 8888;
13
+
14
+  padding: 60px 30px;
15
+  width: 80vw;
16
+  margin: 8em auto;
17
+  background: #ffffff;
18
+  border-radius: 40px;
19
+
20
+  &-top {
21
+  }
22
+  .item-center-Number {
23
+    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
24
+    padding-bottom: 38px;
25
+    margin-bottom: 41px;
26
+    .card-box-star {
27
+      margin: 23px 0 7px 0;
28
+      display: flex;
29
+      align-items: center;
30
+
31
+      .card-box-star-text {
32
+        font-size: 34px;
33
+        font-weight: bold;
34
+        color: #333333;
35
+      }
36
+      .card-star-image {
37
+        padding-left: 35px;
38
+        width: 23px;
39
+        height: 55px;
40
+      }
41
+    }
42
+  }
43
+  > Textarea {
44
+    width: 70vw;
45
+    margin: 0 auto;
46
+    font-size: 30px;
47
+    font-weight: 500;
48
+    padding: 37px 30px;
49
+    border: 1px solid rgba(0, 0, 0, 0.2);
50
+  }
51
+  .bottomButtomBox {
52
+    position: relative;
53
+    top: 3vh;
54
+  }
55
+}

+ 11
- 9
src/components/CarsListContent/index.jsx Целия файл

@@ -15,24 +15,25 @@ import { setMorKm } from '@/utils/codeSegment'
15 15
 import './style.less'
16 16
 
17 17
 export default withLayout((props) => {
18
+
19
+  const { carsList } = props
18 20
   const { sserLocation } = useModel('userData')
19 21
   // const { carsList } = props
20 22
 
21
-  const [carsList, setCarsList] = useState([])
22
-
23
+  // const [carsList, setCarsList] = useState([])
23 24
 
24
-  useEffect(() => {
25
-    getMachinery(sserLocation).then((e) => {
26
-      setCarsList(e.records)
27
-    })
25
+  // useEffect(() => {
26
+  //   getMachinery(sserLocation).then((e) => {
27
+  //     setCarsList(e.records)
28
+  //   })
28 29
 
29
-  }, [sserLocation])
30
+  // }, [sserLocation])
30 31
 
31 32
 
32 33
 
33 34
 
34 35
   const startReserve = (res) => {
35
-    Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}` })
36
+    Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${res}&location=${sserLocation}` })
36 37
 
37 38
   }
38 39
   const goCarsInfo = (res) => {
@@ -40,6 +41,7 @@ export default withLayout((props) => {
40 41
 
41 42
   }
42 43
   const goMapInfo = (res) => {
44
+    console.log("🚀 ~ file: index.jsx ~ line 43 ~ goMapInfo ~ res", res)
43 45
     Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${sserLocation}` })
44 46
 
45 47
 
@@ -51,7 +53,7 @@ export default withLayout((props) => {
51 53
 
52 54
     <>
53 55
       {
54
-        carsList != [] ? carsList.map((item, index) => {
56
+        carsList?.length > 0 ? carsList.map((item, index) => {
55 57
           return (
56 58
             <View key={index} className='carsListImga-bottom-box'>
57 59
               <Image src={item.thumb} onClick={() => goCarsInfo(item.machineryId)} />

+ 2
- 2
src/components/LoginModel/index.jsx Целия файл

@@ -30,8 +30,8 @@ export default (props) => {
30 30
 
31 31
   const [checkImage, setCheckImage] = useState(false)
32 32
 
33
-  const [InputPhoneValue, setInputPhoneValue] = useState('18082043755')
34
-  const [InputCodeValue, setInputCodeValue] = useState('375501')
33
+  const [InputPhoneValue, setInputPhoneValue] = useState('')
34
+  const [InputCodeValue, setInputCodeValue] = useState('')
35 35
 
36 36
   const onInputPhone = (r) => {
37 37
     setInputPhoneValue(r?.detail?.value)

+ 11
- 0
src/components/Popup/index.jsx Целия файл

@@ -0,0 +1,11 @@
1
+
2
+import './style.less'
3
+
4
+export default (props) => {
5
+  const { show, mask = true, onClose, maskClosable } = props
6
+  return (
7
+    <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
8
+      {props.children}
9
+    </mp-dialog>
10
+  )
11
+}

+ 9
- 0
src/components/Popup/style.less Целия файл

@@ -0,0 +1,9 @@
1
+.x-popup {
2
+  .weui-dialog {
3
+    width: auto;
4
+  }
5
+  .weui-dialog__hd,
6
+  .weui-dialog__ft {
7
+    display: none;
8
+  }
9
+}

+ 5
- 5
src/components/orderRater/index.js Целия файл

@@ -36,27 +36,22 @@ Component({
36 36
         {
37 37
           light: scoreON,
38 38
           gray: scoreOFF,
39
-          // tips: '极差'
40 39
         },
41 40
         {
42 41
           light: scoreON,
43 42
           gray: scoreOFF,
44
-          // tips: '差'
45 43
         },
46 44
         {
47 45
           light: scoreON,
48 46
           gray: scoreOFF,
49
-          // tips: '一般'
50 47
         },
51 48
         {
52 49
           light: scoreON,
53 50
           gray: scoreOFF,
54
-          // tips: '好'
55 51
         },
56 52
         {
57 53
           light: scoreON,
58 54
           gray: scoreOFF,
59
-          // tips: '极好'
60 55
         },
61 56
 
62 57
       ]
@@ -69,14 +64,19 @@ Component({
69 64
 
70 65
 
71 66
   methods: {
67
+
72 68
     clickStar: function (e) {
73 69
       if (this.properties.onlyShow) return
74 70
       let index = e.currentTarget.dataset.index
75 71
       this.setData({
76 72
         initScore: index + 1
77 73
       })
74
+
75
+      console.log("🚀 ~ file: index.js ~ line 73 ~ index + 1", index + 1)
78 76
       this.triggerEvent('raterChange', index + 1)
79 77
 
78
+
79
+
80 80
     }
81 81
   },
82 82
   ready () {

+ 1
- 1
src/layouts/index.jsx Целия файл

@@ -3,10 +3,10 @@
3 3
 import useRouter from '@/utils/hooks/useRouter'
4 4
 import { useEffect, useMemo, useState } from 'react'
5 5
 import { useModel } from '@/store'
6
+import Spin from "@/components/Spin";
6 7
 
7 8
 import LoginModel from '@/components/LoginModel'
8 9
 import useLogin from '@/utils/hooks/useLogin'
9
-import Spin from "@/components/Spin";
10 10
 
11 11
 
12 12
 

+ 3
- 3
src/pages/CheckDetails/index.jsx Целия файл

@@ -32,7 +32,7 @@ export default withLayout((props) => {
32 32
         setContentList(e.contentList)
33 33
         setCarsInfo(e)
34 34
 
35
-        console.log('e', e);
35
+        console.log('setCarsInfosetCarsInfosetCarsInfo', e);
36 36
       })
37 37
     }
38 38
 
@@ -44,12 +44,12 @@ export default withLayout((props) => {
44 44
 
45 45
 
46 46
   const startReserve = () => {
47
-    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
47
+    Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${carsInfo?.machineryId}&location=${location}` })
48 48
 
49 49
   }
50 50
 
51 51
   const goMapInfo = (res) => {
52
-    Taro.navigateTo({ url: `/pages/CheckMap/index?mapId=${res + 111}` })
52
+    Taro.navigateTo({ url: `/pages/CheckMap/index?id=${carsInfo?.machineryId}&location=${location}` })
53 53
 
54 54
   }
55 55
 

+ 13
- 10
src/pages/CheckMap/index.jsx Целия файл

@@ -17,6 +17,7 @@ export default withLayout((props) => {
17 17
 
18 18
   const $instance = Taro.getCurrentInstance()
19 19
   const { id, location } = $instance.router.params
20
+  console.log("🚀 ~ file: index.jsx ~ line 20 ~ withLayout ~ $instance.router.params", $instance.router.params)
20 21
 
21 22
 
22 23
   const { sserLocation } = useModel('userData')
@@ -25,8 +26,6 @@ export default withLayout((props) => {
25 26
 
26 27
 
27 28
   const LocationMap = sserLocation.split(",")
28
-  console.log("🚀 ~ file: index.jsx ~ line 25 ~ LocationMap", LocationMap)
29
-
30 29
 
31 30
   const [carsInfo, setCarsInfo] = useState({})
32 31
   const [imagesList, setImagesList] = useState([])
@@ -34,20 +33,24 @@ export default withLayout((props) => {
34 33
 
35 34
 
36 35
   useEffect(() => {
36
+    if (id) {
37
+      getMachineryInfo(id, { location: sserLocation, attached: true }).then((e) => {
38
+        setImagesList(e.imagesList)
39
+        setContentList(e.contentList)
40
+        setCarsInfo(e)
41
+
42
+        console.log('e', e);
43
+      })
44
+    }
37 45
 
38
-    getMachineryInfo(id, { location: location, attached: true }).then((e) => {
39
-      setImagesList(e.imagesList)
40
-      setContentList(e.contentList)
41
-      setCarsInfo(e)
42 46
 
43
-      console.log('e', e);
44
-    })
45 47
 
46
-  }, [$instance.router.params, id, location])
48
+  }, [$instance.router.params, id, sserLocation])
47 49
 
48 50
 
49 51
   const startReserve = () => {
50
-    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
52
+    Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${id}&location=${location}` })
53
+
51 54
 
52 55
   }
53 56
 

+ 0
- 57
src/pages/HelpCenterInfo/index.jsx Целия файл

@@ -1,57 +0,0 @@
1
-import { View, Image } from "@tarojs/components"
2
-import CustomNav from "@/components/CustomNav"
3
-
4
-import withLayout from '@/layouts'
5
-
6
-import './style.less'
7
-
8
-
9
-
10
-export default withLayout((props) => {
11
-
12
-  return (
13
-    <View className='page-index'>
14
-      <View className='index-navbar'>
15
-        <CustomNav title='帮助中心' />
16
-      </View>
17
-      <scroll-view scrollY style='height: 100%;' >
18
-
19
-        <View className='help-center-cell'>
20
-          <Image src='https://profile.csdnimg.cn/8/3/5/1_yunqiinsight' />
21
-          <View className='help-center-cell-bottom' >
22
-            <View className='help-center-cell-bottom-title'  >收割机的最新消息!!</View>
23
-            <View className='help-center-cell-bottom-content' >构建互联共享的“互联网+农业”信息服务体系以最终实现科学指导农业生产经营管理,政府决策监管和社会公众服务。</View>
24
-          </View>
25
-        </View>
26
-        <View className='help-center-cell'>
27
-          <Image src='https://profile.csdnimg.cn/8/3/5/1_yunqiinsight' />
28
-          <View className='help-center-cell-bottom' >
29
-            <View className='help-center-cell-bottom-title'  >收割机的最新消息!!</View>
30
-            <View className='help-center-cell-bottom-content' >构建互联共享的“互联网+农业”信息服务体系以最终实现科学指导农业生产经营管理,政府决策监管和社会公众服务。</View>
31
-          </View>
32
-        </View>
33
-        <View className='help-center-cell'>
34
-          <Image src='https://profile.csdnimg.cn/8/3/5/1_yunqiinsight' />
35
-          <View className='help-center-cell-bottom' >
36
-            <View className='help-center-cell-bottom-title'  >收割机的最新消息!!</View>
37
-            <View className='help-center-cell-bottom-content' >构建互联共享的“互联网+农业”信息服务体系以最终实现科学指导农业生产经营管理,政府决策监管和社会公众服务。</View>
38
-          </View>
39
-        </View>
40
-        <View className='help-center-cell'>
41
-          <Image src='https://profile.csdnimg.cn/8/3/5/1_yunqiinsight' />
42
-          <View className='help-center-cell-bottom' >
43
-            <View className='help-center-cell-bottom-title'  >收割机的最新消息!!</View>
44
-            <View className='help-center-cell-bottom-content' >构建互联共享的“互联网+农业”信息服务体系以最终实现科学指导农业生产经营管理,政府决策监管和社会公众服务。</View>
45
-          </View>
46
-        </View>
47
-        <View className='help-center-cell'>
48
-          <Image src='https://profile.csdnimg.cn/8/3/5/1_yunqiinsight' />
49
-          <View className='help-center-cell-bottom' >
50
-            <View className='help-center-cell-bottom-title'  >收割机的最新消息!!</View>
51
-            <View className='help-center-cell-bottom-content' >构建互联共享的“互联网+农业”信息服务体系以最终实现科学指导农业生产经营管理,政府决策监管和社会公众服务。</View>
52
-          </View>
53
-        </View>
54
-      </scroll-view>
55
-    </View>
56
-  )
57
-})

+ 15
- 0
src/pages/InformationInfo/InfoImgaText.jsx Целия файл

@@ -0,0 +1,15 @@
1
+import { Image } from "@tarojs/components"
2
+import './infoimgaText.less'
3
+
4
+export default (props) => {
5
+  const { item } = props
6
+  return (
7
+    <view className='cardext-box'>
8
+      {
9
+        item.contentType == 'image' ?
10
+          <Image key={item.extId} style={{ width: '100%' }} src={item.content} /> :
11
+          <view style={{ textIndent: '2em' }} className='storezn'>{item.content}</view>
12
+      }
13
+    </view>
14
+  )
15
+}

src/pages/HelpCenterInfo/index.config.js → src/pages/InformationInfo/index.config.js Целия файл

@@ -1,6 +1,6 @@
1 1
 
2 2
 export default {
3
-  navigationBarTitleText: '帮助中心',
3
+  navigationBarTitleText: '农业资讯',
4 4
   navigationStyle: 'custom',
5 5
   disableScroll: true,
6 6
   usingComponents: {

+ 61
- 0
src/pages/InformationInfo/index.jsx Целия файл

@@ -0,0 +1,61 @@
1
+import { View, Image } from "@tarojs/components"
2
+import CustomNav from "@/components/CustomNav"
3
+import decorate from "@/assets/icons/comm/decorate.png"
4
+import withLayout from '@/layouts'
5
+import Taro from "@tarojs/taro"
6
+
7
+import { useEffect, useState } from "react"
8
+import { getNewsInfo } from "@/services/news"
9
+import InfoImgaText from "./InfoImgaText"
10
+
11
+
12
+
13
+import './style.less'
14
+
15
+
16
+
17
+export default withLayout((props) => {
18
+
19
+  const $instance = Taro.getCurrentInstance()
20
+  const { id } = $instance.router.params
21
+  const [newInfo, setNewInfo] = useState()
22
+  useEffect(() => {
23
+    if (id) {
24
+      getNewsInfo(id).then((res) => {
25
+        setNewInfo(res)
26
+
27
+      })
28
+    }
29
+  }, [])
30
+
31
+  return (
32
+    <View className='page-index'>
33
+      <View className='index-navbar'>
34
+        <CustomNav title='农业资讯' />
35
+      </View>
36
+      <scroll-view scrollY style='height: 100%;' >
37
+        <View>
38
+          <View className='articleTitle-box-sta'>
39
+            <Image src={decorate} />
40
+            <View >{newInfo?.title}</View>
41
+            <Image src={decorate} />
42
+          </View>
43
+          <View style={{ margin: '25px auto 6em auto', padding: '1px 15px 0px 15px' }}>
44
+            {
45
+              newInfo?.contentList.map((item, index) => {
46
+                return (
47
+                  <InfoImgaText item={item} />
48
+
49
+                )
50
+
51
+              })
52
+            }
53
+
54
+          </View>
55
+
56
+
57
+        </View>
58
+      </scroll-view>
59
+    </View>
60
+  )
61
+})

+ 0
- 0
src/pages/InformationInfo/infoimgaText.less Целия файл


+ 15
- 0
src/pages/InformationInfo/style.less Целия файл

@@ -0,0 +1,15 @@
1
+.articleTitle-box-sta {
2
+  width: 100%;
3
+  display: flex;
4
+  font-size: 40px;
5
+  font-weight: bold;
6
+  color: #222222;
7
+  align-items: center;
8
+  justify-content: center;
9
+  margin-top: 32px;
10
+  > Image {
11
+    width: 33px;
12
+    height: 33px;
13
+    margin: auto 31px;
14
+  }
15
+}

+ 2
- 1
src/pages/MoreCars/CarTypeList.jsx Целия файл

@@ -40,12 +40,13 @@ export default withLayout((props) => {
40 40
   }
41 41
 
42 42
 
43
+
43 44
   return (
44 45
 
45 46
 
46 47
     <>
47 48
       {
48
-        csrsListType !== [] ? csrsListType.map((item, index) => {
49
+        csrsListType?.length > 0 ? csrsListType.map((item, index) => {
49 50
           return (
50 51
             <View key={index} className='carsListImga-bottom-box'>
51 52
               <Image src={item.thumb} onClick={() => goCarsInfo(item.machineryId)} />

+ 15
- 24
src/pages/MoreCars/index.jsx Целия файл

@@ -2,7 +2,8 @@
2 2
 
3 3
 import { View, Image, Input, Picker, Text } from "@tarojs/components"
4 4
 import { useModel } from "@/store"
5
-
5
+import Taro from "@tarojs/taro"
6
+import ListPlaceholder from "@/components/ListPlaceholder"
6 7
 import withLayout from '@/layouts'
7 8
 import { useState, useEffect } from "react"
8 9
 import CustomNav from "@/components/CustomNav"
@@ -12,6 +13,8 @@ import CarTypeList from "./CarTypeList"
12 13
 
13 14
 
14 15
 
16
+
17
+
15 18
 import './style.less'
16 19
 
17 20
 
@@ -31,26 +34,6 @@ export default withLayout((props) => {
31 34
   const [tabIndex, steTabIndex] = useState(0)
32 35
 
33 36
 
34
-  const handleSearch = (e) => {
35
-  }
36
-
37
-
38
-
39
-
40
-  // const ClassificationComparison = () => {
41
-  //   for (let item1 of tabs) {
42
-  //     let _index = activeNames.findIndex(c => c.name == item1.title)
43
-  //     if (_index > -1) {
44
-  //       item1.count = activeNames[_index].typeId;
45
-  //       console.log('saleTypes=tempSales //这', activeNames[_index].typeId);
46
-
47
-  //       // classId.push({ id: item1.count })
48
-
49
-  //     }
50
-  //   }
51
-
52
-
53
-  // }
54 37
 
55 38
   useEffect(() => {
56 39
     if (tabIndex !== 0) {
@@ -76,6 +59,7 @@ export default withLayout((props) => {
76 59
 
77 60
 
78 61
   useEffect(() => {
62
+
79 63
     getMachineryType().then((e) => {
80 64
       const tabList = e.records
81 65
       setActiveNames(tabList)
@@ -86,6 +70,11 @@ export default withLayout((props) => {
86 70
     })
87 71
   }, [])
88 72
 
73
+  const goSearch = () => {
74
+    Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
75
+
76
+  }
77
+
89 78
 
90 79
   const handleTabChange = (e) => {
91 80
     console.log('e', e.detail);
@@ -100,8 +89,8 @@ export default withLayout((props) => {
100 89
         <CustomNav title='更多' />
101 90
       </View>
102 91
       <scroll-view scrollY style='height: 100%;' >
103
-        <View className='heads-content-searchClass-abcc'>
104
-          <Input type='text' className='heads-content-searchClass-abcc-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
92
+        <View className='heads-content-searchClass-abcc' onClick={goSearch}>
93
+          <Input type='text' disabled className='heads-content-searchClass-abcc-searchInput' placeholder='搜索关键字查询农机' />
105 94
           <Image src={searchs} className='heads-content-searchClass-abcc-searchInput-searchImg' />
106 95
         </View>
107 96
         <mp-tabs
@@ -117,7 +106,9 @@ export default withLayout((props) => {
117 106
 
118 107
         {/* 内容区域 */}
119 108
         <View className='cententText'>
120
-          <CarTypeList csrsListType={csrsListType} />
109
+          {
110
+            csrsListType !== [] ? <CarTypeList csrsListType={csrsListType} /> : <ListPlaceholder title='该分类暂无农机!' />
111
+          }
121 112
         </View>
122 113
       </scroll-view>
123 114
     </View>

+ 5
- 2
src/pages/MyAddressList/index.jsx Целия файл

@@ -19,7 +19,10 @@ import './style.less'
19 19
 export default withLayout((props) => {
20 20
   const [addresList, setAddresList] = useState([])
21 21
   const $instance = Taro.getCurrentInstance()
22
-  const { orderAddress } = $instance.router.params
22
+  const { type } = $instance.router.params
23
+  console.log("🚀 ~ file: index.jsx ~ line 23 ~ withLayout ~ orderAddress", type)
24
+
25
+
23 26
   const { setUserOrderAddress, userOrderAddress } = useModel('userData')
24 27
 
25 28
 
@@ -152,7 +155,7 @@ export default withLayout((props) => {
152 155
 
153 156
                     <View className='addressList-box-addressBotton-setAddress'>
154 157
                       {
155
-                        orderAddress ? <>
158
+                        !type ? <>
156 159
                           <View>
157 160
                             设为默认地址:
158 161
                             <RadioGroup className='radio-group' onChange={(res) => handelSwitch(item.addressId, res)} >

+ 4
- 4
src/pages/OrderConfirmation/index.jsx Целия файл

@@ -26,7 +26,7 @@ export default withLayout((props) => {
26 26
   // }
27 27
 
28 28
   const $instance = Taro.getCurrentInstance()
29
-  const { id } = $instance.router.params
29
+  const { id, location } = $instance.router.params
30 30
   const { sserLocation, userOrderAddress } = useModel('userData')
31 31
 
32 32
   const [timeSel, setTimeSel] = useState('')
@@ -79,7 +79,7 @@ export default withLayout((props) => {
79 79
   }
80 80
   useEffect(() => {
81 81
     if (id) {
82
-      getMachineryInfo(id, { location: sserLocation, attached: true }).then((e) => {
82
+      getMachineryInfo(id, { location: location, attached: true }).then((e) => {
83 83
         setCarsInfo(e)
84 84
         console.log('e', e);
85 85
       })
@@ -137,8 +137,8 @@ export default withLayout((props) => {
137 137
             </View>
138 138
           </View>
139 139
           <View className='BottomtBut-box'>
140
-            <ButtontWX onClick={formSubmit} formType='submit' butText='确定' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
141
-            <ButtontWX onClick={cancelPay} formType='submit' styleType butText='取消' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
140
+            <ButtontWX onClick={formSubmit} butText='确定' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
141
+            <ButtontWX onClick={cancelPay} styleType butText='取消' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
142 142
           </View>
143 143
         </Form>
144 144
       </View>

+ 2
- 0
src/pages/OrderInfo/index.config.js Целия файл

@@ -4,6 +4,8 @@ export default {
4 4
   navigationStyle: 'custom',
5 5
   disableScroll: true,
6 6
   usingComponents: {
7
+    "mp-orderRater": '../../components/orderRater/index',
8
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
7 9
   }
8 10
 
9 11
 }

+ 40
- 5
src/pages/OrderInfo/index.jsx Целия файл

@@ -1,11 +1,12 @@
1 1
 import { View, Text } from "@tarojs/components"
2 2
 import { useEffect, useState } from "react"
3
-import Taro from "@tarojs/taro"
3
+import Taro, { useDidShow } from "@tarojs/taro"
4 4
 import CustomNav from '@/components/CustomNav'
5 5
 import ButtontWX from '@/components/ButtontWX'
6 6
 import formatTimes from "@/utils/codeSegment"
7 7
 import withLayout from '@/layouts'
8 8
 import formatPrice from "@/utils/formatPrice"
9
+import AssessModel from "@/components/AssessModel"
9 10
 
10 11
 import { generateOrder, orderDelete, orderInfo } from "@/services/order"
11 12
 // import BottomMoadl from '@/components/BottomMoadl/index'
@@ -18,11 +19,16 @@ import { generateOrder, orderDelete, orderInfo } from "@/services/order"
18 19
 import './style.less'
19 20
 
20 21
 export default withLayout((props) => {
22
+  // const { stateType } = props
21 23
 
22 24
   const $instance = Taro.getCurrentInstance()
23
-  const { orderId, } = $instance.router.params
25
+  const { orderId, stateType, stateStyle } = $instance.router.params
24 26
 
25 27
   const [orderInfos, setOrderInfos] = useState()
28
+  console.log("🚀 ~ file: index.jsx ~ line 27 ~ stateType ~ stateType", stateType)
29
+  const [isAssessVisible, setIsAssessVisible] = useState(false)
30
+
31
+
26 32
   //底部弹窗
27 33
   // const [showFrame, setShowFrame] = useState(false)
28 34
   // const setRecommend = () => {
@@ -82,12 +88,25 @@ export default withLayout((props) => {
82 88
     //支付逻辑
83 89
   }
84 90
 
91
+  const startModle = () => {
92
+    setIsAssessVisible(true)
93
+
94
+  }
95
+  const onClose = () => {
96
+    setIsAssessVisible(false)
97
+    Taro.navigateBack({
98
+      delta: 1
99
+    })
100
+
101
+  }
102
+
85 103
 
86 104
   return (
87 105
     <View className='page-index'>
88 106
       <View className='index-navbar'>
89 107
         <CustomNav title='订单详情' />
90 108
       </View>
109
+      <AssessModel orderId={orderId} showCutover={isAssessVisible} maskClosable={isAssessVisible} onClose={onClose} onFinish={onClose} />
91 110
       {/* <BottomMoadl frameTitle='支付方式' flag={showFrame} onRecommend={setRecommend} /> */}
92 111
       <View className='orders-listBox-RihtboxBoxOrderViewText'>
93 112
         <View className='View-LiftTextTop'>订单编号:<Text>{orderInfos?.orderNo}</Text></View>
@@ -97,13 +116,29 @@ export default withLayout((props) => {
97 116
         <View>下单时间:<Text>{formatTimes(orderInfos?.createDate, 'yyyy-MM-dd')}</Text></View>
98 117
         <View>订单状态:<Text  >{orderInfos?.payStatus}</Text></View>
99 118
         <View className='View-LiftTextBotton'>
100
-          <View>费用:<Text className='feiyongStyle'>{formatPrice(orderInfos?.charges)}</Text></View>
119
+          <View className='feiyongStyle'>费用:<Text className='feiyongStyle-charges' >{formatPrice(orderInfos?.charges)}</Text></View>
120
+          <View className='feiyongStyle'>状态:<Text style={{ color: `${stateStyle}` }} className='feiyongStyle-stateStyle' >{stateType}</Text></View>
101 121
         </View>
102 122
       </View>
103 123
       <View className='BottomtBut' >
104
-        <ButtontWX butText='取消' onClick={cancelPay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
124
+        <>
125
+          {
126
+            stateType == '已完成' ? <></>
127
+              : stateType == '进行中' ? <></>
128
+                : stateType == '待评价' ? <ButtontWX butText='评价' onClick={startModle} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
129
+                  : stateType == '待作业' ? <ButtontWX butText='退单' onClick={cancelPay} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
130
+                    : stateType == '待付款' ? <>
131
+                      <ButtontWX butText='取消' styleType onClick={cancelPay} butWidth={150} butHeight={39} butFontSize={16} butBorderRadius={49} />
132
+                      <ButtontWX butText='支付' onClick={pay} butWidth={150} butHeight={39} butFontSize={16} butBorderRadius={49} />
133
+                    </> : stateType == '已付款' ?
134
+                      <ButtontWX butText='退单' onClick={cancelPay} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
135
+                      : stateType == '已退单' ? <></> : <></>
136
+          }
137
+        </>
138
+
139
+
140
+
105 141
 
106
-        <ButtontWX butText='支付' onClick={pay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
107 142
       </View>
108 143
     </View>
109 144
   )

+ 9
- 0
src/pages/OrderInfo/style.less Целия файл

@@ -37,7 +37,16 @@
37 37
     }
38 38
 
39 39
     .feiyongStyle {
40
+      justify-content: space-between;
41
+      display: flex;
40 42
       color: #222222;
43
+      &-charges {
44
+        background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
45
+        -webkit-background-clip: text;
46
+        -webkit-text-fill-color: transparent;
47
+      }
48
+      &-stateStyle {
49
+      }
41 50
     }
42 51
   }
43 52
 }

+ 10
- 0
src/pages/Search/index.config.js Целия файл

@@ -0,0 +1,10 @@
1
+
2
+export default {
3
+  navigationBarTitleText: '搜索',
4
+  navigationStyle: 'custom',
5
+  disableScroll: true,
6
+  usingComponents: {
7
+
8
+  }
9
+
10
+}

+ 56
- 0
src/pages/Search/index.jsx Целия файл

@@ -0,0 +1,56 @@
1
+import Taro from '@tarojs/taro'
2
+import CustomNav from '@/components/CustomNav'
3
+import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
4
+
5
+import { View, Input, Image } from '@tarojs/components'
6
+import withLayout from '@/layouts'
7
+import { useThrottle } from '@/utils/codeSegment'
8
+import CarsListContent from "@/components/CarsListContent"
9
+import { getMachinery } from '@/services/homes'
10
+import { useModel } from '@/store'
11
+
12
+
13
+import './style.less'
14
+import { useState } from 'react'
15
+
16
+
17
+
18
+export default withLayout((props) => {
19
+  const $instance = Taro.getCurrentInstance()
20
+  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
+
28
+  const [carsList, setCarsList] = useState([])
29
+  //节流 搜索
30
+  const handlerSearch = useThrottle((e) => {
31
+    const { value } = e?.detail
32
+    getMachinery(location, { q: value, location: location }).then((res) => {
33
+      console.log('根据农机名字查', res);
34
+      setCarsList(res.records)
35
+    })
36
+
37
+  }, 1000)
38
+
39
+  return (
40
+    <View className='page-index'>
41
+      <View className='index-navbar'>
42
+        <CustomNav title='搜索' />
43
+      </View>
44
+      <scroll-view scrollY style='height: 100%;' >
45
+        <View className='searchClass-jieguoye'>
46
+          <Input type='text' onInput={handlerSearch} placeholder='搜索关键字查询' />
47
+          <Image src={searchs} />
48
+        </View>
49
+        <CarsListContent carsList={carsList} />
50
+
51
+
52
+      </scroll-view>
53
+    </View>
54
+  )
55
+
56
+})

+ 24
- 0
src/pages/Search/style.less Целия файл

@@ -0,0 +1,24 @@
1
+.searchClass-jieguoye {
2
+  display: inline-block;
3
+  position: relative;
4
+  width: 92%;
5
+  margin-top: 30px;
6
+  text-align: center;
7
+  left: 4vw;
8
+  > Input {
9
+    background: #f8f8f8;
10
+    border-radius: 34px;
11
+    padding-left: 68px;
12
+    padding-right: 34px;
13
+    font-size: 28px;
14
+    height: 68px;
15
+    line-height: 68px;
16
+  }
17
+  > Image {
18
+    width: 30px;
19
+    height: 30px;
20
+    position: absolute;
21
+    left: 31px;
22
+    top: 19px;
23
+  }
24
+}

+ 4
- 2
src/pages/index/index.jsx Целия файл

@@ -9,6 +9,7 @@ import tabList from './tabbar'
9 9
 import Homes from './tabs/Homes'
10 10
 import Orders from './tabs/Orders'
11 11
 import Mine from './tabs/Mine'
12
+import Information from './tabs/Information'
12 13
 
13 14
 import './index.less'
14 15
 
@@ -65,8 +66,9 @@ export default withLayout((props) => {
65 66
       <view className='index-container'>
66 67
         {currentTab === 0 && <Homes />}
67 68
         {currentTab === 1 && <Orders router={router} />}
68
-        {/* {currentTab === 2 && <Strategy />} */}
69
-        {currentTab === 2 && <Mine isDidShow={isDidShow} router={router} />}
69
+        {currentTab === 2 && <Information router={router} />}
70
+
71
+        {currentTab === 3 && <Mine isDidShow={isDidShow} router={router} />}
70 72
       </view>
71 73
       <view className='index-tabbar'>
72 74
         <mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>

+ 5
- 0
src/pages/index/tabbar.js Целия файл

@@ -10,6 +10,11 @@ const tabbar = [
10 10
     iconPath: require('@/assets/tabbar/OrdersOFFImgaes.png'),
11 11
     selectedIconPath: require('@/assets/tabbar/OrdersNOImgaes.png'),
12 12
   },
13
+  {
14
+    text: '资讯',
15
+    iconPath: require('@/assets/tabbar/newsONImages.png'),
16
+    selectedIconPath: require('@/assets/tabbar/newsOFFImages.png'),
17
+  },
13 18
   {
14 19
     text: '我的',
15 20
     iconPath: require('@/assets/tabbar/MineOFFImgaes.png'),

+ 8
- 3
src/pages/index/tabs/Homes.jsx Целия файл

@@ -30,7 +30,7 @@ export default withLayout((props) => {
30 30
       setCarsList(e.records)
31 31
     })
32 32
 
33
-  }, [])
33
+  }, [sserLocation])
34 34
 
35 35
 
36 36
 
@@ -42,6 +42,11 @@ export default withLayout((props) => {
42 42
     console.log(e?.detail?.value)
43 43
   }
44 44
 
45
+  const goSearch = () => {
46
+    Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
47
+
48
+  }
49
+
45 50
   const goToCarsList = () => {//更多
46 51
     Taro.navigateTo({ url: `/pages/MoreCars/index` })
47 52
 
@@ -59,8 +64,8 @@ export default withLayout((props) => {
59 64
           <Text>邓州市</Text>
60 65
           <View className='heads-top-box-left-addresssImg-DownIcon' />
61 66
         </View>
62
-        <View className='heads-content-searchClass'>
63
-          <Input type='text' className='heads-content-searchClass-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
67
+        <View className='heads-content-searchClass' onClick={goSearch}>
68
+          <Input disabled type='text' className='heads-content-searchClass-searchInput' placeholder='搜索关键字查询农机' />
64 69
           <Image src={searchs} className='heads-content-searchClass-searchInput-searchImg' />
65 70
         </View>
66 71
       </View>

+ 50
- 0
src/pages/index/tabs/Information.jsx Целия файл

@@ -0,0 +1,50 @@
1
+import { View, Image } from "@tarojs/components"
2
+import Taro from "@tarojs/taro"
3
+import { useEffect, useState } from "react"
4
+import withLayout from '@/layouts'
5
+import { getNewsList } from "@/services/news"
6
+import formatTimes from "@/utils/codeSegment"
7
+import ListPlaceholder from "@/components/ListPlaceholder"
8
+
9
+import './InformationCss/style.less'
10
+
11
+
12
+
13
+
14
+export default withLayout((props) => {
15
+  const [newList, setNewList] = useState([])
16
+
17
+  const goInfoMationInfo = (res) => {
18
+    Taro.navigateTo({ url: `/pages/InformationInfo/index?id=${res}` })
19
+
20
+  }
21
+  useEffect(() => {
22
+    getNewsList().then((res) => {
23
+      setNewList(res.records)
24
+    })
25
+  }, [])
26
+
27
+  return (
28
+
29
+    <scroll-view scrollY style='height: 100%;' >
30
+      <View >
31
+        {
32
+          newList?.length > 0 ? newList?.map((item, index) => {
33
+            return (
34
+              <View key={index} className='help-center-cell' onClick={() => goInfoMationInfo(item?.newsId)} >
35
+                <Image src={item?.thumb} />
36
+                <View className='help-center-cell-bottom' >
37
+                  <View className='help-center-cell-bottom-title'  >{item?.title}</View>
38
+                  <View className='help-center-cell-bottom-content' >{formatTimes(item?.createDate, 'yyyy-mm-dd')}</View>
39
+                </View>
40
+              </View>
41
+            )
42
+          }) : <ListPlaceholder title='暂无农业资讯' />
43
+        }
44
+
45
+
46
+      </View>
47
+
48
+    </scroll-view>
49
+  )
50
+})

src/pages/HelpCenterInfo/style.less → src/pages/index/tabs/InformationCss/style.less Целия файл

@@ -18,8 +18,12 @@
18 18
       font-size: 34px;
19 19
       font-weight: bold;
20 20
       color: #222222;
21
+      text-overflow: ellipsis; //显示...
22
+      -webkit-line-clamp: 2;
23
+      overflow: hidden;
21 24
     }
22 25
     &-content {
26
+      text-align: right;
23 27
       font-size: 28px;
24 28
       font-weight: 400;
25 29
       color: #121212;

+ 3
- 9
src/pages/index/tabs/Mine.jsx Целия файл

@@ -28,8 +28,7 @@ export default withLayout((props) => {
28 28
   const userList = [
29 29
     { userTitle: '关于我们', userImg: aboutUs, pageType: 0 },
30 30
     { userTitle: '版本更新', userImg: versionUpdate, pageType: 1 },
31
-    { userTitle: '帮助中心', userImg: helpCenter, pageType: 2 },
32
-    { userTitle: '意见反馈', userImg: feedbacks, pageType: 3 },
31
+    { userTitle: '意见反馈', userImg: feedbacks, pageType: 2 },
33 32
   ]
34 33
 
35 34
   const $instance = Taro.getCurrentInstance()
@@ -62,11 +61,11 @@ export default withLayout((props) => {
62 61
   }, [$instance.router.params.userOk, person?.avatar, person?.nickName, person.phone])
63 62
 
64 63
   const setAddress = (dd) => {
65
-    Taro.navigateTo({ url: `/pages/MyAddressList/index?id${dd}` })
64
+    Taro.navigateTo({ url: `/pages/MyAddressList/index?id=${dd}` })
66 65
 
67 66
   }
68 67
   const goUserInfo = (dd) => {
69
-    Taro.navigateTo({ url: `/pages/userInfo/index?id${dd}` })
68
+    Taro.navigateTo({ url: `/pages/userInfo/index?id=${dd}` })
70 69
 
71 70
   }
72 71
 
@@ -86,12 +85,7 @@ export default withLayout((props) => {
86 85
 
87 86
         break;
88 87
       case 2:
89
-        Taro.navigateTo({ url: '/pages/HelpCenterInfo/index' })
90
-
91
-        break;
92
-      case 3:
93 88
         Taro.navigateTo({ url: '/pages/FeedbackText/index' })
94
-
95 89
         break;
96 90
 
97 91
       default:

+ 57
- 52
src/pages/index/tabs/Orders.jsx Целия файл

@@ -1,6 +1,8 @@
1 1
 
2 2
 import { View, Image, Text } from "@tarojs/components"
3 3
 import Taro, { useDidShow } from '@tarojs/taro'
4
+import withLayout from '@/layouts'
5
+import ListPlaceholder from "@/components/ListPlaceholder"
4 6
 
5 7
 import ordersListImga from '@/assets/ordersImages/ordersListImga.png'
6 8
 import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
@@ -8,27 +10,28 @@ import { useEffect, useState } from "react"
8 10
 import { getOrder } from "@/services/order"
9 11
 import formatTimes from "@/utils/codeSegment"
10 12
 import { useModel } from "@/store"
11
-import withLayout from '@/layouts'
12
-import ListPlaceholder from "@/components/ListPlaceholder"
13
+import formatPrice from "@/utils/formatPrice"
14
+
13 15
 import './OrdersCss/style.less'
14 16
 
15 17
 
18
+
16 19
 export default withLayout((props) => {
17 20
 
18 21
   const [ourderList, setOrderList] = useState([])
19 22
 
20
-  const { person, setPerson } = useModel('userData')
21 23
 
24
+  const { person, setPerson } = useModel('userData')
22 25
 
23 26
 
24 27
   useDidShow(() => {
25
-    getOrder().then((e) => {
28
+    getOrder({ pageSize: 30 }).then((e) => {
26 29
       const { records } = e
27 30
       setOrderList(records)
28 31
     })
29 32
   })
30 33
   useEffect(() => {
31
-    getOrder().then((e) => {
34
+    getOrder({ pageSize: 31 }).then((e) => {
32 35
       const { records } = e
33 36
       setOrderList(records)
34 37
     })
@@ -36,51 +39,52 @@ export default withLayout((props) => {
36 39
   console.log(ourderList, 'ourderList');
37 40
 
38 41
   const orderStates = (item) => {
39
-    switch (item) {
40
-      case 0:
41
-        return {
42
-          title: '待付款',
43
-          styleColor: '#51D4FF'
44
-        }
45
-      case 1:
46
-        return {
47
-          title: '已付款',
48
-          styleColor: '#FF703B'
49
-        }
50
-      case 2:
51
-        return {
52
-          title: '进行中',
53
-          styleColor: '#44F68B'
54
-        }
55
-      case 3:
56
-        return {
57
-          title: '已完成',
58
-          styleColor: '#FF703B'
59
-        }
60
-      case 4:
61
-        return {
62
-          title: '待评价',
63
-          styleColor: '#51D4FF'
64
-        }
65
-      case 5:
66
-        return {
67
-          title: '退单待审',
68
-          styleColor: '#51D4FF'
69
-        }
70
-      case 6:
71
-        return {
72
-          title: '待付款',
73
-          styleColor: '#FF703B'
74
-        }
75
-      default:
76
-        return {
77
-          title: '暂无状态',
78
-          styleColor: '#000'
79
-        }
42
+    if (item.payStatus === 0) {
43
+      return {
44
+        title: '待付款',
45
+        styleColor: '#51D4FF'
46
+      }
47
+    } else if (item.payStatus === 1 && item.workStatus === 0 && item.dispatchStatus === 0) {
48
+      return {
49
+        title: '已付款',
50
+        styleColor: '#FF703B'
51
+      }
52
+    } else if (item.workStatus == 0 && item.dispatchStatus === 1) {
53
+      return {
54
+        title: '待作业',
55
+        styleColor: '#FF703B'
56
+      }
57
+
58
+    } else if (item.payStatus === 1 && (item.workStatus === 1 || item.workStatus === 2)) {
59
+      return {
60
+        title: '进行中',
61
+        styleColor: '#44F68B'
62
+      }
63
+    } else if (item.workStatus === 3 && item.isEvaluated === 0) {
64
+      return {
65
+        title: '待评价',
66
+        styleColor: '#51D4FF'
67
+      }
68
+    } if (item.workStatus === 3 && item.isEvaluated === 1) {
69
+      return {
70
+        title: '已完成',
71
+        styleColor: '#FF703B'
72
+      }
73
+    } else if (item.payStatus === 1 && item.workStatus === 0 && item.isRefund === 1) {
74
+      return {
75
+        title: '已退单',
76
+        styleColor: '#FF703B'
77
+      }
78
+    } else {
79
+      return {
80
+        title: '异常',
81
+        styleColor: '#FF0000'
82
+      }
80 83
     }
81 84
   }
82
-  const handleTobePaid = (id) => {
83
-    Taro.navigateTo({ url: `/pages/OrderInfo/index?orderId=${id}` })
85
+
86
+  const handleTobePaid = (id, stateType, stateStyle) => {
87
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?orderId=${id}&stateType=${stateType}&stateStyle=${stateStyle}` })
84 88
   }
85 89
 
86 90
 
@@ -95,19 +99,20 @@ export default withLayout((props) => {
95 99
         {/* <View className='content-header-box-orders-rightCentent'>更多&gt;&gt;</View> */}
96 100
       </View>
97 101
       {
98
-        ourderList != [] ? ourderList.map((item, index) => {
102
+        ourderList?.length > 0 ? ourderList.map((item, index) => {
99 103
           return (
100 104
             <View key={index} className='orders-listBox'>
101 105
               <Image src={ordersLeft} />
102 106
               <View className='orders-listBox-RihtboxBoxOrderViewText'>
103
-                <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId)} >订单编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>更多&gt;&gt;</Text></View>
107
+                <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId, orderStates(item)?.title, orderStates(item)?.styleColor)} >
108
+                  订单编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>更多&gt;&gt;</Text></View>
104 109
                 <View>农机名称:<Text>{item.machineryName}</Text></View>
105 110
                 <View>作业面积:<Text>{item.amount}</Text></View>
106 111
                 <View>需求时间:<Text>{formatTimes(item.appointmentDate, 'yyyy-MM-dd')}</Text></View>
107 112
                 <View>下单时间:<Text>{formatTimes(item.createDate, 'yyyy-MM-dd')}</Text></View>
108 113
                 <View className='View-LiftTextBotton'>
109
-                  <View>订单状态:<Text style={{ color: orderStates(item.payStatus).styleColor }} >{orderStates(item.orderState).title}</Text></View>
110
-                  <View>费用:<Text className='feiyongStyle'>{item.charges}</Text></View>
114
+                  <View>订单状态:<Text style={{ color: orderStates(item)?.styleColor }} >{orderStates(item)?.title}</Text></View>
115
+                  <View>费用:<Text className='feiyongStyle'>{formatPrice(item.charges)}</Text></View>
111 116
                 </View>
112 117
               </View>
113 118
             </View>

+ 12
- 2
src/routes.js Целия файл

@@ -6,6 +6,11 @@ const Pages = [
6 6
     page: 'pages/index/index',
7 7
     isIndex: true,
8 8
   },
9
+  {
10
+    title: '搜索页',
11
+    page: 'pages/Search/index',
12
+  },
13
+
9 14
   {
10 15
     title: '订单详情',
11 16
     page: 'pages/OrderInfo/index',
@@ -39,9 +44,14 @@ const Pages = [
39 44
     title: '版本更新',
40 45
     page: 'pages/NewVersionUpdatePage/index',
41 46
   },
47
+  // {
48
+  //   title: '帮助中心',
49
+  //   page: 'pages/HelpCenterInfo/index',
50
+  // },
51
+
42 52
   {
43
-    title: '帮助中心',
44
-    page: 'pages/HelpCenterInfo/index',
53
+    title: '农业资讯详情页',
54
+    page: 'pages/InformationInfo/index',
45 55
   },
46 56
   {
47 57
     title: '意见反馈',

+ 18
- 0
src/services/news.js Целия файл

@@ -0,0 +1,18 @@
1
+
2
+import request from '@/utils/request'
3
+
4
+
5
+/**
6
+ * 农机资讯
7
+ * @param {*} data 
8
+ * @returns 
9
+ */
10
+export const getNewsList = (data) => request('/news', { data, method: 'GET' })
11
+
12
+/**
13
+ * 农机资讯详情
14
+ * @param {*} data 
15
+ * @returns 
16
+ */
17
+export const getNewsInfo = (id, data) => request(`/news/${id}`, { data, method: 'GET' })
18
+

+ 6
- 1
src/services/order.js Целия файл

@@ -31,5 +31,10 @@ export const orderInfo = (id, data) => request(`/order/${id}`, { data, method: '
31 31
 export const orderDelete = (id, data) => request(`/order/${id}`, { data, method: 'DELETE' })
32 32
 
33 33
 
34
-
34
+/**
35
+ * 评价订单
36
+ * @param {*} data 
37
+ * @returns 
38
+ */
39
+export const orderEvaluation = (data) => request(`/evaluation`, { data, method: 'POST' })
35 40
 

+ 25
- 0
src/utils/codeSegment.js Целия файл

@@ -1,3 +1,7 @@
1
+import { useCallback, useEffect, useRef } from "react";
2
+
3
+
4
+
1 5
 /**
2 6
  * object 转 queryStr
3 7
  * @param {*} params 
@@ -65,3 +69,24 @@ export function setMorKm (m) {
65 69
   return n
66 70
 }
67 71
 
72
+
73
+
74
+// 节流
75
+export function useThrottle (fn, delay, dep = []) {
76
+  const { current } = useRef({ fn, timer: null })
77
+  useEffect(
78
+    function () {
79
+      current.fn = fn
80
+    },
81
+    [fn]
82
+  )
83
+  return useCallback(function f (...args) {
84
+    if (!current.timer) {
85
+      current.timer = setTimeout(() => {
86
+        delete current.timer
87
+      }, delay)
88
+      current.fn.call(this, ...args)
89
+    }
90
+  }, dep)
91
+}
92
+