|
@@ -7,6 +7,7 @@ import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
|
7
|
7
|
import { useEffect, useState } from "react"
|
8
|
8
|
import { getOrder } from "@/services/order"
|
9
|
9
|
import formatTimes from "@/utils/codeSegment"
|
|
10
|
+import { useModel } from "@/store"
|
10
|
11
|
|
11
|
12
|
import './OrdersCss/style.less'
|
12
|
13
|
|
|
@@ -14,6 +15,11 @@ import './OrdersCss/style.less'
|
14
|
15
|
export default (props) => {
|
15
|
16
|
|
16
|
17
|
const [ourderList, setOrderList] = useState([])
|
|
18
|
+
|
|
19
|
+ const { person, setPerson } = useModel('userData')
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
17
|
23
|
useDidShow(() => {
|
18
|
24
|
getOrder().then((e) => {
|
19
|
25
|
const { records } = e
|
|
@@ -80,33 +86,39 @@ export default (props) => {
|
80
|
86
|
|
81
|
87
|
return (
|
82
|
88
|
<scroll-view scrollY style='height: 100%;' >
|
83
|
|
- <View className='content-header-box-orders'>
|
84
|
|
- <View className='content-header-box-orders-liftCentent'>
|
85
|
|
- <Image src={ordersListImga} />
|
86
|
|
- <View>订单列表</View>
|
87
|
|
- </View>
|
88
|
|
- {/* <View className='content-header-box-orders-rightCentent'>更多>></View> */}
|
89
|
|
- </View>
|
|
89
|
+
|
90
|
90
|
{
|
91
|
|
- ourderList.map((item, index) => {
|
92
|
|
- return (
|
93
|
|
- <View key={index} className='orders-listBox'>
|
94
|
|
- <Image src={ordersLeft} />
|
95
|
|
- <View className='orders-listBox-RihtboxBoxOrderViewText'>
|
96
|
|
- <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId)} >订单编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>更多>></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>
|
101
|
|
- <View className='View-LiftTextBotton'>
|
102
|
|
- <View>订单状态:<Text style={{ color: orderStates(item.payStatus).styleColor }} >{orderStates(item.orderState).title}</Text></View>
|
103
|
|
- <View>费用:<Text className='feiyongStyle'>{item.charges}</Text></View>
|
104
|
|
- </View>
|
105
|
|
- </View>
|
|
91
|
+ person?.phone !== '' ? <>
|
|
92
|
+ <View className='content-header-box-orders'>
|
|
93
|
+ <View className='content-header-box-orders-liftCentent'>
|
|
94
|
+ <Image src={ordersListImga} />
|
|
95
|
+ <View>订单列表</View>
|
106
|
96
|
</View>
|
107
|
|
- )
|
108
|
|
- })
|
|
97
|
+ {/* <View className='content-header-box-orders-rightCentent'>更多>></View> */}
|
|
98
|
+ </View>
|
|
99
|
+ {
|
|
100
|
+ ourderList.map((item, index) => {
|
|
101
|
+ return (
|
|
102
|
+ <View key={index} className='orders-listBox'>
|
|
103
|
+ <Image src={ordersLeft} />
|
|
104
|
+ <View className='orders-listBox-RihtboxBoxOrderViewText'>
|
|
105
|
+ <View className='View-LiftTextTop' onClick={() => handleTobePaid(item.orderId)} >订单编号:<Text>{item.orderNo}</Text><Text className='View-LiftTextTop-nextText'>更多>></Text></View>
|
|
106
|
+ <View>农机名称:<Text>{item.machineryName}</Text></View>
|
|
107
|
+ <View>作业面积:<Text>{item.amount}</Text></View>
|
|
108
|
+ <View>需求时间:<Text>{formatTimes(item.appointmentDate, 'yyyy-MM-dd hh:mm')}</Text></View>
|
|
109
|
+ <View>下单时间:<Text>{formatTimes(item.createDate, 'yyyy-MM-dd hh:mm')}</Text></View>
|
|
110
|
+ <View className='View-LiftTextBotton'>
|
|
111
|
+ <View>订单状态:<Text style={{ color: orderStates(item.payStatus).styleColor }} >{orderStates(item.orderState).title}</Text></View>
|
|
112
|
+ <View>费用:<Text className='feiyongStyle'>{item.charges}</Text></View>
|
|
113
|
+ </View>
|
|
114
|
+ </View>
|
|
115
|
+ </View>
|
|
116
|
+ )
|
|
117
|
+ })
|
109
|
118
|
|
|
119
|
+ }
|
|
120
|
+ </>
|
|
121
|
+ : <View>未登录,请先登陆</View>
|
110
|
122
|
}
|
111
|
123
|
|
112
|
124
|
</scroll-view>
|