[baozhangchao] 3 vuotta sitten
vanhempi
commit
8aeeff5eda

BIN
src/assets/icons/comm/locationImage.png Näytä tiedosto


BIN
src/assets/mineImgaes/userMoren.png Näytä tiedosto


+ 1
- 1
src/components/CarsListContent/index.jsx Näytä tiedosto

@@ -28,7 +28,7 @@ export default (props) => {
28 28
 
29 29
 
30 30
   const startReserve = () => {
31
-    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
31
+    Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id${1}` })
32 32
 
33 33
   }
34 34
   const goCarsInfo = (res) => {

+ 17
- 5
src/pages/CheckMap/index.jsx Näytä tiedosto

@@ -1,9 +1,9 @@
1
-import { useEffect } from "react"
1
+import { useEffect, useState } from "react"
2 2
 import { Map, View, Image, Text } from "@tarojs/components"
3 3
 import CustomNav from "@/components/CustomNav"
4 4
 import ButtontWX from "@/components/ButtontWX"
5 5
 import Taro from "@tarojs/taro"
6
-import decorate from "@/assets/icons/comm/decorate.png"
6
+import locationImage from "@/assets/icons/comm/locationImage.png"
7 7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
8 8
 import './style.less'
9 9
 
@@ -11,6 +11,18 @@ import './style.less'
11 11
 export default (props) => {
12 12
 
13 13
   const $instance = Taro.getCurrentInstance()
14
+  const [mapLoca, setMapLoca] = useState('')
15
+  Taro.getStorage({
16
+    key: 'location',
17
+    success: function (res) {
18
+      setMapLoca(res.data)
19
+    }
20
+  })
21
+
22
+
23
+  const LocationMap = mapLoca.split(",")
24
+  console.log("🚀 ~ file: index.jsx ~ line 25 ~ LocationMap", LocationMap)
25
+
14 26
 
15 27
 
16 28
   useEffect(() => {
@@ -24,10 +36,10 @@ export default (props) => {
24 36
   }
25 37
 
26 38
   const markers = [{ // 绘制浮标,传入JSON支持多个
27
-    // iconPath: "/images/location.png", 
39
+    iconPath: locationImage,
28 40
     id: 0,
29
-    latitude: 112.092169,// 经度
30
-    longitude: 32.694883,//纬度
41
+    latitude: LocationMap[0],// 经度
42
+    longitude: LocationMap[1],//纬度
31 43
     width: 50, // 浮标宽度
32 44
     height: 50 // 浮标高度
33 45
   }]

+ 21
- 0
src/pages/FeedbackText/index.jsx Näytä tiedosto

@@ -2,6 +2,9 @@ import { useState } from "react"
2 2
 import { Textarea, View } from "@tarojs/components"
3 3
 import CustomNav from "@/components/CustomNav"
4 4
 import ButtontWX from "@/components/ButtontWX"
5
+import { feedback } from "@/services/mine"
6
+import Taro from "@tarojs/taro"
7
+
5 8
 import './style.less'
6 9
 
7 10
 
@@ -13,6 +16,24 @@ export default (props) => {
13 16
 
14 17
   const onSubmitClick = () => {
15 18
     console.log('textAreaValue', textAreaValue);
19
+    feedback({ content: textAreaValue }).then(() => {
20
+      Taro.showToast({
21
+        title: '反馈已收到!',
22
+        icon: 'success',
23
+        duration: 2000
24
+      }).then(() => {
25
+        setTimeout(() => {
26
+          Taro.navigateBack({
27
+            delta: 1
28
+          }
29
+
30
+          )
31
+        }, 1500)
32
+
33
+      })
34
+    })
35
+
36
+
16 37
   }
17 38
 
18 39
   return (

+ 42
- 4
src/pages/MyAddressList/AddressInfos/index.jsx Näytä tiedosto

@@ -11,12 +11,50 @@ import { useEffect } from "react"
11 11
 
12 12
 
13 13
 export default (props) => {
14
+  console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", props)
15
+
16
+  const $instance = Taro.getCurrentInstance()
17
+  const { addressId, address } = $instance.router.params
18
+
19
+  console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", $instance.router.params)
20
+
14 21
   const formSubmit = e => {
22
+
15 23
     const value = e.detail.value
16 24
     console.log(value)
17
-    addressSave({ address: value.address, isDefault: value.isDefault }).then((e) => {
18
-      console.log('e', e);
19
-    })
25
+    if (addressId) {
26
+      addressUpdate(addressId, { address: value.address }).then((res) => {
27
+        console.log('地址修改成功', res);
28
+        Taro.showToast({
29
+          title: '地址修改成功',
30
+          icon: 'success',
31
+          duration: 2000
32
+        }).then(() => {
33
+          setTimeout(() => {
34
+            Taro.navigateBack({
35
+              delta: 1
36
+            })
37
+          }, 1500)
38
+
39
+        })
40
+      })
41
+    } else {
42
+      addressSave({ address: value.address }).then((e) => {
43
+        console.log('地址添加成功', e);
44
+        Taro.showToast({
45
+          title: '地址添加成功',
46
+          icon: 'success',
47
+          duration: 2000
48
+        }).then(() => {
49
+          setTimeout(() => {
50
+            Taro.navigateBack({
51
+              delta: 1
52
+            })
53
+          }, 1500)
54
+        })
55
+      })
56
+    }
57
+
20 58
 
21 59
   }
22 60
 
@@ -30,7 +68,7 @@ export default (props) => {
30 68
       <Form onSubmit={formSubmit} onReset={formReset} >
31 69
         <View className='example-body'>
32 70
           <View>详细地址:</View>
33
-          <Textarea name='address' className='aTextareaCentent' placeholder='请输入地址信息' />
71
+          <Textarea name='address' value={address} className='aTextareaCentent' placeholder='请输入地址信息' />
34 72
         </View>
35 73
         {/* <View className='example-body'>
36 74
           <View>是否设为默认地址:</View>

+ 23
- 14
src/pages/MyAddressList/index.jsx Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 import { View, Image, Switch, Radio, RadioGroup } from "@tarojs/components"
2
-import Taro from "@tarojs/taro"
3
-import { useState, useEffect } from "react"
2
+import Taro, { useDidShow } from "@tarojs/taro"
3
+import { useState, useEffect, useMemo } from "react"
4 4
 import CustomNav from "@/components/CustomNav"
5 5
 import edit from "@/assets/icons/comm/edit.png"
6 6
 import userRight from '@/assets/mineImgaes/userRight.png'
@@ -29,6 +29,12 @@ export default (props) => {
29 29
       success: function (res) {
30 30
         if (res.confirm) {
31 31
           addressDelete(e).then((e) => {
32
+            Taro.showToast({
33
+              title: '地址删除成功',
34
+              icon: 'success',
35
+              duration: 2000
36
+            })
37
+            getList()
32 38
 
33 39
           })
34 40
         } else if (res.cancel) {
@@ -43,8 +49,6 @@ export default (props) => {
43 49
 
44 50
   const handelSwitch = (a, e) => {
45 51
     const { value } = e.detail
46
-    // console.log('e', !!value);
47
-    console.log('a,e', a, value);
48 52
     addressDefault(a).then((se) => {
49 53
       console.log('e', se);
50 54
       getList()
@@ -57,25 +61,32 @@ export default (props) => {
57 61
     // }
58 62
 
59 63
   }
60
-  const addressEdit = (e) => {
64
+  const addressEdit = (e, res) => {
61 65
     console.log('e', e);
66
+    Taro.navigateTo({ url: `/pages/MyAddressList/AddressInfos/index?addressId=${e}&address=${res}` })
62 67
 
63 68
   }
64 69
 
65 70
 
71
+
66 72
   const getList = () => {
67 73
     getAddress().then((e) => {
68 74
       console.log('地址列表', e);
75
+      // let abccList = e.records.sort((a, b) => b.isDefault - a.isDefault)
76
+      // console.log("🚀 ~ file: index.jsx ~ line 75 ~ getAddress ~ abccList", abccList)
69 77
       setAddresList(e.records)
70 78
     })
71 79
   }
80
+  useDidShow(() => {
81
+    getList()
82
+
83
+  })
72 84
 
73 85
   useEffect(() => {
74 86
     getList()
75 87
 
76 88
 
77
-    console.log('执行了', switchBool,);
78
-  }, [switchBool,])
89
+  }, [])
79 90
 
80 91
 
81 92
 
@@ -87,12 +98,14 @@ export default (props) => {
87 98
       <scroll-view scrollY style='height: 100%;' >
88 99
         <View>
89 100
           {
90
-
91 101
             addresList.map((item, index) => {
92 102
               return (
93 103
                 <View className='addressList-box' key={index}>
94 104
                   <View className='addressList-box-addressTop'>
95
-                    <View className='addressList-box-addressTop-redText'>默认地址</View>
105
+                    {
106
+                      item.isDefault ?
107
+                        <View className='addressList-box-addressTop-redText'>默认地址</View> : ''
108
+                    }
96 109
                     <View className='addressList-box-addressTop-title'>我的地址{index + 1}</View>
97 110
                   </View>
98 111
                   <View className='addressList-box-addressBotton'>
@@ -100,19 +113,15 @@ export default (props) => {
100 113
                       <View>
101 114
                         {item.address}
102 115
                       </View>
103
-                      <Image src={edit} onClick={() => addressEdit(item.addressId)} />
116
+                      <Image src={edit} onClick={() => addressEdit(item.addressId, item.address)} />
104 117
                     </View>
105 118
 
106 119
                     <View className='addressList-box-addressBotton-setAddress'>
107 120
                       <View>
108
-
109 121
                         设为默认地址:
110
-
111 122
                         <RadioGroup className='radio-group' onChange={(res) => handelSwitch(item.addressId, res)} >
112 123
                           <Radio color='#FC5531' checked={item.isDefault}></Radio>
113 124
                         </RadioGroup>
114
-
115
-
116 125
                       </View>
117 126
 
118 127
                       <View className='addressList-box-addressBotton-addressDelete' onClick={() => addressDeletess(item.addressId)}>

+ 3
- 2
src/pages/MyAddressList/style.less Näytä tiedosto

@@ -96,7 +96,8 @@
96 96
 }
97 97
 
98 98
 .bottomButtom {
99
+  margin: 22vh auto;
99 100
   width: 100%;
100
-  margin: 0 auto;
101
-  margin-bottom: 15vh;
101
+  position: relative;
102
+  bottom: 17vh;
102 103
 }

+ 9
- 0
src/pages/OrderConfirmation/index.config.js Näytä tiedosto

@@ -0,0 +1,9 @@
1
+
2
+export default {
3
+  navigationBarTitleText: '订单确认',
4
+  navigationStyle: 'custom',
5
+  disableScroll: true,
6
+  usingComponents: {
7
+  }
8
+
9
+}

+ 49
- 0
src/pages/OrderConfirmation/index.jsx Näytä tiedosto

@@ -0,0 +1,49 @@
1
+import { View, Text } from "@tarojs/components"
2
+import Taro from "@tarojs/taro"
3
+import { useState } from "react"
4
+import CustomNav from '@/components/CustomNav'
5
+import ButtontWX from '@/components/ButtontWX'
6
+// import BottomMoadl from '@/components/BottomMoadl/index'
7
+
8
+
9
+
10
+
11
+
12
+
13
+import './style.less'
14
+
15
+export default (props) => {
16
+  //底部弹窗
17
+  // const [showFrame, setShowFrame] = useState(false)
18
+  // const setRecommend = () => {
19
+  //   setShowFrame(!showFrame)
20
+  // }
21
+
22
+  const okgoPay = () => {
23
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
24
+  }
25
+  const cancelPay = () => {
26
+    Taro.navigateBack({
27
+      delta: 1
28
+    })
29
+  }
30
+
31
+
32
+
33
+  return (
34
+    <View className='page-index'>
35
+      <View className='index-navbar'>
36
+        <CustomNav title='订单确认' />
37
+      </View>
38
+      {/* <BottomMoadl frameTitle='支付方式' flag={showFrame} onRecommend={setRecommend} /> */}
39
+      <View>
40
+
41
+      </View>
42
+      <View className='BottomtBut' >
43
+        <ButtontWX butText='取消' onClick={cancelPay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
44
+
45
+        <ButtontWX butText='确定' onClick={okgoPay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
46
+      </View>
47
+    </View>
48
+  )
49
+}

+ 4
- 0
src/pages/OrderConfirmation/style.less Näytä tiedosto

@@ -0,0 +1,4 @@
1
+.BottomtBut {
2
+  width: 99vw;
3
+  display: flex;
4
+}

+ 79
- 10
src/pages/OrderInfo/index.jsx Näytä tiedosto

@@ -1,7 +1,11 @@
1 1
 import { View, Text } from "@tarojs/components"
2
-import { useState } from "react"
2
+import { useEffect, useState } from "react"
3
+import Taro from "@tarojs/taro"
3 4
 import CustomNav from '@/components/CustomNav'
4 5
 import ButtontWX from '@/components/ButtontWX'
6
+import formatTimes from "@/utils/codeSegment"
7
+
8
+import { generateOrder, orderDelete, orderInfo } from "@/services/order"
5 9
 // import BottomMoadl from '@/components/BottomMoadl/index'
6 10
 
7 11
 
@@ -12,14 +16,77 @@ import ButtontWX from '@/components/ButtontWX'
12 16
 import './style.less'
13 17
 
14 18
 export default (props) => {
19
+
20
+  const $instance = Taro.getCurrentInstance()
21
+  const { orderId } = $instance.router.params
22
+
23
+  const [orderInfos, setOrderInfos] = useState()
15 24
   //底部弹窗
16 25
   // const [showFrame, setShowFrame] = useState(false)
17 26
   // const setRecommend = () => {
18 27
   //   setShowFrame(!showFrame)
19 28
   // }
20 29
 
21
-  const pay = () => {
30
+  const cancelPay = () => {
31
+    Taro.showModal({
32
+      title: '提示',
33
+      content: '您确定要取消此订单吗?',
34
+      success: function (res) {
35
+        if (res.confirm) {
36
+          orderDelete(orderId).then((e) => {
37
+            console.log('订单取消/删除', e);
38
+            Taro.showToast({
39
+              title: '订单取消成功',
40
+              icon: 'success',
41
+              duration: 2000
42
+            }).then(() => {
43
+              setTimeout(() => {
44
+                Taro.navigateBack({
45
+                  delta: 1
46
+                })
47
+              }, 1500)
48
+            })
49
+          })
50
+        } else if (res.cancel) {
51
+          console.log('用户点击取消')
52
+        }
53
+      }
54
+    })
55
+  }
22 56
 
57
+  useEffect(() => {
58
+    if (orderId) {
59
+      orderInfo(orderId).then((res) => {
60
+        setOrderInfos(res)
61
+      })
62
+    } else {
63
+      Taro.showToast({
64
+        title: '暂无订单详情',
65
+        icon: 'error',
66
+        duration: 2000
67
+      }).then(() => {
68
+        setTimeout(() => {
69
+          Taro.navigateBack({
70
+            delta: 1
71
+          })
72
+        }, 1500)
73
+      })
74
+    }
75
+
76
+  }, [orderId])
77
+
78
+  const pay = () => {
79
+    generateOrder({
80
+      charges: 200,
81
+      price: 100,
82
+      amount: 20,
83
+      machineryId: '7cdf832d7a7af0c19ab33418e10e1a94',
84
+      machineryName: '第一台播种机',
85
+      machineryType: 'b4d183f684ed1f3d1cb2194c1975ae46',
86
+      typeName: '播种机',
87
+      address: '我是作业地址:房屋后面',
88
+      appontmentDate: new Date(),
89
+    })
23 90
   }
24 91
 
25 92
 
@@ -30,18 +97,20 @@ export default (props) => {
30 97
       </View>
31 98
       {/* <BottomMoadl frameTitle='支付方式' flag={showFrame} onRecommend={setRecommend} /> */}
32 99
       <View className='orders-listBox-RihtboxBoxOrderViewText'>
33
-        <View className='View-LiftTextTop'>订单编号:<Text>41242425</Text></View>
34
-        <View>农机名称:<Text>阿松大的</Text></View>
35
-        <View>需求数量:<Text>2</Text></View>
36
-        <View>需求时间:<Text>2322-80-99</Text></View>
37
-        <View>下单时间:<Text>2244-06-78</Text></View>
38
-        <View>订单状态:<Text  >未支付</Text></View>
100
+        <View className='View-LiftTextTop'>订单编号:<Text>{orderInfos?.orderNo}</Text></View>
101
+        <View>农机名称:<Text>{orderInfos?.machineryName}</Text></View>
102
+        <View>作业面积:<Text>{orderInfos?.amount}</Text></View>
103
+        <View>需求时间:<Text>{formatTimes(orderInfos?.appointmentDate, 'yyyy-MM-dd hh:mm')}</Text></View>
104
+        <View>下单时间:<Text>{formatTimes(orderInfos?.createDate, 'yyyy-MM-dd hh:mm')}</Text></View>
105
+        <View>订单状态:<Text  >{orderInfos?.payStatus}</Text></View>
39 106
         <View className='View-LiftTextBotton'>
40
-          <View>费用:<Text className='feiyongStyle'>88</Text></View>
107
+          <View>费用:<Text className='feiyongStyle'>{orderInfos?.charges}</Text></View>
41 108
         </View>
42 109
       </View>
43 110
       <View className='BottomtBut' >
44
-        <ButtontWX butText='支付' onClick={pay} butWidth={345} butHeight={49} butFontSize={16} butBorderRadius={49} />
111
+        <ButtontWX butText='取消' onClick={cancelPay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
112
+
113
+        <ButtontWX butText='支付' onClick={pay} butWidth={123} butHeight={39} butFontSize={16} butBorderRadius={49} />
45 114
       </View>
46 115
     </View>
47 116
   )

+ 1
- 0
src/pages/OrderInfo/style.less Näytä tiedosto

@@ -46,4 +46,5 @@
46 46
   width: 99vw;
47 47
   position: absolute;
48 48
   bottom: 5vh;
49
+  display: flex;
49 50
 }

+ 23
- 4
src/pages/index/tabs/Mine.jsx Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 
2 2
 import { View, Image } from "@tarojs/components"
3
-import Taro from "@tarojs/taro"
3
+import Taro, { useDidShow } from "@tarojs/taro"
4 4
 import { useState, useEffect, useMemo } from "react"
5 5
 import UserCellBox from '@/components/UserCellBox'
6 6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
@@ -8,9 +8,12 @@ import aboutUs from '@/assets/mineImgaes/aboutUs.png'//关于我们
8 8
 import feedbacks from '@/assets/mineImgaes/feedbacks.png'//意见反馈
9 9
 import helpCenter from '@/assets/mineImgaes/helpCenter.png'//帮助中心
10 10
 import versionUpdate from '@/assets/mineImgaes/versionUpdate.png'//版本更新
11
+import userMoren from '@/assets/mineImgaes/userMoren.png'//默认头像
11 12
 import userRight from '@/assets/mineImgaes/userRight.png'
12 13
 import { useModel } from "@/store"
13 14
 
15
+import { getAddress } from "@/services/address"
16
+
14 17
 
15 18
 
16 19
 import './MineCss/style.less'
@@ -19,6 +22,8 @@ import './MineCss/style.less'
19 22
 export default (props) => {
20 23
   const { person } = useModel('userData')
21 24
   const [isLoginBox, setIsLoginBox] = useState(false)
25
+  const [addresInfo, setAddresInfo] = useState('')
26
+
22 27
   const userList = [
23 28
     { userTitle: '关于我们', userImg: aboutUs, pageType: 0 },
24 29
     { userTitle: '版本更新', userImg: versionUpdate, pageType: 1 },
@@ -40,6 +45,20 @@ export default (props) => {
40 45
 
41 46
 
42 47
 
48
+  useDidShow(() => {
49
+    getAddress().then((e) => {
50
+      let abccList = e.records.sort((a, b) => b.isDefault - a.isDefault)
51
+      setAddresInfo(abccList[0].address)
52
+    })
53
+  })
54
+  useEffect(() => {
55
+
56
+    getAddress().then((e) => {
57
+      let abccList = e.records.sort((a, b) => b.isDefault - a.isDefault)
58
+      console.log("🚀 ~ file: index.jsx ~ line 75 ~ getAddress ~ abccList", abccList)
59
+      setAddresInfo(abccList[0].address)
60
+    })
61
+  }, [])
43 62
 
44 63
   const setAddress = (dd) => {
45 64
     Taro.navigateTo({ url: `/pages/MyAddressList/index?id${dd}` })
@@ -88,14 +107,14 @@ export default (props) => {
88 107
         {
89 108
           !isLoginBox ?
90 109
             <View style={{ backgroundImage: "url(" + require("@/assets/mineImgaes/mineBack.png") + ")" }} className='User-Avatar-background-falseBox'>
91
-              <Image className='User-Avatar-background-falseBox-userImg userImg' src='https://profile.csdnimg.cn/3/1/5/0_qq_42551866' />
110
+              <Image className='User-Avatar-background-falseBox-userImg userImg' src={userMoren} />
92 111
               <View onClick={userLoginnow} className='User-Avatar-background-falseBox-userLogin' >点击登陆</View>
93 112
             </View>
94 113
             :
95 114
             <>
96 115
               <View style={{ backgroundImage: "url(" + require("@/assets/mineImgaes/mineBack.png") + ")" }} className='User-Avatar-background-trueBox'>
97 116
                 <View className='setPassword' onClick={goUserInfo}>修改个人信息</View>
98
-                <Image className='User-Avatar-background-trueBox-userImg' src={userInfo?.avatar} />
117
+                <Image className='User-Avatar-background-trueBox-userImg' src={userInfo?.avatar || userMoren} />
99 118
                 <View className='User-Avatar-background-trueBox-name'>
100 119
                   <View >{userInfo?.nickName}</View>
101 120
                   <View >{userInfo?.phone}</View>
@@ -106,7 +125,7 @@ export default (props) => {
106 125
                 <View className='addresss-box' onClick={setAddress} >
107 126
                   <Image className='addresss-box-images' src={addresss} />
108 127
                   <View className='addresss-box-contents'>
109
-                    <View className='addresss-box-contents-texts' >河南省南阳市邓州市九龙镇5556666665</View>
128
+                    <View className='addresss-box-contents-texts' >{addresInfo}</View>
110 129
                     <View>》</View>
111 130
                   </View>
112 131
                 </View>

+ 29
- 23
src/pages/index/tabs/Orders.jsx Näytä tiedosto

@@ -1,18 +1,32 @@
1 1
 
2 2
 import { View, Image, Text } from "@tarojs/components"
3
-import Taro from '@tarojs/taro'
3
+import Taro, { useDidShow } from '@tarojs/taro'
4 4
 
5 5
 import ordersListImga from '@/assets/ordersImages/ordersListImga.png'
6 6
 import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
7
-
7
+import { useEffect, useState } from "react"
8
+import { getOrder } from "@/services/order"
9
+import formatTimes from "@/utils/codeSegment"
8 10
 
9 11
 import './OrdersCss/style.less'
10 12
 
11 13
 
12 14
 export default (props) => {
13 15
 
14
-
15
-
16
+  const [ourderList, setOrderList] = useState([])
17
+  useDidShow(() => {
18
+    getOrder().then((e) => {
19
+      const { records } = e
20
+      setOrderList(records)
21
+    })
22
+  })
23
+  useEffect(() => {
24
+    getOrder().then((e) => {
25
+      const { records } = e
26
+      setOrderList(records)
27
+    })
28
+  }, [])
29
+  console.log(ourderList, 'ourderList');
16 30
 
17 31
   const orderStates = (item) => {
18 32
     switch (item) {
@@ -58,19 +72,11 @@ export default (props) => {
58 72
         }
59 73
     }
60 74
   }
61
-  const handleTobePaid = () => {
62
-    Taro.navigateTo({ url: '/pages/OrderInfo/index' })
75
+  const handleTobePaid = (id) => {
76
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?orderId=${id}` })
63 77
   }
64 78
 
65
-  const orderListContent = [
66
-    { orderNumber: 'XJDF82521DA', cardsName: '联合收割机', cardNumber: '6', need: '2021-08-09', place: '2021-08-01', orderState: 0, feiyong: '360' },
67
-    { orderNumber: 'XJDF45244DA', cardsName: '不知道这是什么什么', cardNumber: '1', need: '2021-05-08', place: '2021-08-17', orderState: 1, feiyong: '78' },
68
-    { orderNumber: 'XJDF82521DA', cardsName: '为此发爱疸的箭的', cardNumber: '211', need: '2021-08-04', place: '2021-08-27', orderState: 2, feiyong: '35' },
69
-    { orderNumber: 'X78788821DA', cardsName: '水稻播种000015', cardNumber: '4', need: '2021-04-04', place: '2021-08-22', orderState: 3, feiyong: '170' },
70
-    { orderNumber: 'X44F77777DA', cardsName: '消费者协会', cardNumber: '5', need: '2021-02-11', place: '2021-08-10', orderState: 4, feiyong: '88' },
71
-    { orderNumber: 'XJ7857771DA', cardsName: '3·15', cardNumber: '1', need: '2021-01-09', place: '2021-08-10', orderState: 5, feiyong: '1.35' },
72
-    { orderNumber: 'X0000000001', cardsName: '农民伯伯', cardNumber: '2', need: '2027-08-29', place: '2021-08-17', orderState: 6, feiyong: '0.35' },
73
-  ]
79
+
74 80
 
75 81
   return (
76 82
     <scroll-view scrollY style='height: 100%;' >
@@ -82,19 +88,19 @@ export default (props) => {
82 88
         {/* <View className='content-header-box-orders-rightCentent'>更多&gt;&gt;</View> */}
83 89
       </View>
84 90
       {
85
-        orderListContent.map((item, index) => {
91
+        ourderList.map((item, index) => {
86 92
           return (
87 93
             <View key={index} className='orders-listBox'>
88 94
               <Image src={ordersLeft} />
89 95
               <View className='orders-listBox-RihtboxBoxOrderViewText'>
90
-                <View className='View-LiftTextTop' onClick={handleTobePaid} >订单编号:<Text>{item.orderNumber}</Text><Text className='View-LiftTextTop-nextText'>更多&gt;&gt;</Text></View>
91
-                <View>农机名称:<Text>{item.cardsName}</Text></View>
92
-                <View>需求数量:<Text>{item.cardNumber}</Text></View>
93
-                <View>需求时间:<Text>{item.need}</Text></View>
94
-                <View>下单时间:<Text>{item.place}</Text></View>
96
+                <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId)} >订单编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>更多&gt;&gt;</Text></View>
97
+                <View>农机名称:<Text>{item.machineryName}</Text></View>
98
+                <View>作业面积:<Text>{item.amount}</Text></View>
99
+                <View>需求时间:<Text>{formatTimes(item.appointmentDate, 'yyyy-MM-dd hh:mm')}</Text></View>
100
+                <View>下单时间:<Text>{formatTimes(item.createDate, 'yyyy-MM-dd hh:mm')}</Text></View>
95 101
                 <View className='View-LiftTextBotton'>
96
-                  <View>订单状态:<Text style={{ color: orderStates(item.orderState).styleColor }} >{orderStates(item.orderState).title}</Text></View>
97
-                  <View>费用:<Text className='feiyongStyle'>{item.feiyong}</Text></View>
102
+                  <View>订单状态:<Text style={{ color: orderStates(item.payStatus).styleColor }} >{orderStates(item.orderState).title}</Text></View>
103
+                  <View>费用:<Text className='feiyongStyle'>{item.charges}</Text></View>
98 104
                 </View>
99 105
               </View>
100 106
             </View>

+ 1
- 1
src/pages/index/tabs/OrdersCss/style.less Näytä tiedosto

@@ -41,7 +41,7 @@
41 41
       padding-top: 0;
42 42
       &-nextText {
43 43
         position: relative;
44
-        left: 13vw;
44
+        left: 5vw;
45 45
         font-size: 32px;
46 46
         font-weight: 500;
47 47
         color: #666666;

+ 5
- 1
src/pages/userInfo/index.jsx Näytä tiedosto

@@ -40,7 +40,11 @@ export default (props) => {
40 40
           title: '保存成功',
41 41
           icon: 'none',
42 42
         })
43
-        Taro.navigateBack({ delta: 1 })
43
+        setTimeout(() => {
44
+          Taro.navigateBack({
45
+            delta: 1
46
+          })
47
+        }, 1500)
44 48
       }).catch((e) => {
45 49
         console.log(e)
46 50
         Taro.showToast({

+ 4
- 0
src/routes.js Näytä tiedosto

@@ -10,6 +10,10 @@ const Pages = [
10 10
     title: '订单详情',
11 11
     page: 'pages/OrderInfo/index',
12 12
   },
13
+  {
14
+    title: '订单确认页',
15
+    page: 'pages/OrderConfirmation/index',
16
+  },
13 17
   {
14 18
     title: '登陆页',
15 19
     page: 'pages/UserLogin/index',

+ 9
- 0
src/services/mine.js Näytä tiedosto

@@ -0,0 +1,9 @@
1
+
2
+import request from '@/utils/request'
3
+/**
4
+ * 意见反馈
5
+ * @param {*} data 
6
+ * @returns 
7
+ */
8
+export const feedback = (data) => request('/feedback', { data, method: 'post' })
9
+

+ 35
- 0
src/services/order.js Näytä tiedosto

@@ -0,0 +1,35 @@
1
+
2
+
3
+import request from '@/utils/request'
4
+
5
+
6
+
7
+/**
8
+ * 订单列表
9
+ * @param {*} data 
10
+ * @returns 
11
+ */
12
+export const getOrder = (data) => request(`/order`, { data, method: 'GET' })
13
+
14
+/**
15
+ * 生成订单
16
+ * @param {*} data 
17
+ * @returns 
18
+ */
19
+export const generateOrder = (data) => request(`/order`, { data, method: 'POST' })
20
+/**
21
+* 订单详情
22
+* @param {*} data 
23
+* @returns 
24
+*/
25
+export const orderInfo = (id, data) => request(`/order/${id}`, { data, method: 'GET' })
26
+/**
27
+ * 删除订单
28
+ * @param {*} data 
29
+ * @returns 
30
+ */
31
+export const orderDelete = (id, data) => request(`/order/${id}`, { data, method: 'DELETE' })
32
+
33
+
34
+
35
+

+ 32
- 0
src/utils/codeSegment.js Näytä tiedosto

@@ -18,3 +18,35 @@ export function getQueryString (params) {
18 18
 }
19 19
 
20 20
 
21
+
22
+
23
+
24
+function getDateByStr (dtStr) {
25
+  if (!dtStr) return undefined;
26
+
27
+  const t = dtStr.split(/[-T :]/);
28
+  return new Date(t[0], t[1] - 1, t[2], t[3] || 0, t[4] || 0, t[5] || 0)
29
+}
30
+
31
+export default function formatTimes (dt, fmt) {
32
+  if (!dt) return dt;
33
+
34
+  // 解决苹果手机不能正常初始化的问题
35
+  const date = typeof dt === 'string' ? getDateByStr(dt) : new Date(dt);
36
+
37
+  var o = {
38
+    "M+": date.getMonth() + 1, //月份
39
+    "d+": date.getDate(), //日
40
+    "h+": date.getHours(), //小时
41
+    "m+": date.getMinutes(), //分
42
+    "s+": date.getSeconds(), //秒
43
+    "q+": Math.floor((date.getMonth() + 3) / 3), //季度
44
+    "S": date.getMilliseconds() //毫秒
45
+  };
46
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
47
+  for (var k in o)
48
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
49
+  return fmt;
50
+};
51
+
52
+