| | |
| | | import { View, Image } from '@tarojs/components'; |
| | | import './index.less'; |
| | | import { getOrderHistoryList, OrderHistoryGroup } from '../../../robotaxi/api/order'; |
| | | import { INVOICE_URL } from '../../../constants/api'; |
| | | |
| | | type OrderFilterKey = 'all' | 'pendingPay' | 'completed' | 'cancelled'; |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | const toInvoicePage = () => { |
| | | Taro.navigateTo({ |
| | | url: `/pages/webpage/index?pageUrl=${encodeURIComponent(INVOICE_URL)}` |
| | | }) |
| | | } |
| | | |
| | | useReachBottom(() => { |
| | | if (hasMore) { |
| | | const nextPage = pageNum + 1; |
| | |
| | | } |
| | | }) |
| | | |
| | | const formatOrderStatus = (status?: number) => { |
| | | const formatOrderStatus = (status: number) => { |
| | | if (status == 0) { |
| | | return '已取消' |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | const getOrderStatusClassName = (status?: number) => { |
| | | const getOrderStatusClassName = (status: number) => { |
| | | if (status >= 1 && status <= 7) { |
| | | return 'order-status--processing' |
| | | } |
| | |
| | | </View> |
| | | <View className='order-start'>起点:{item.startPointName || '-'}</View> |
| | | <View className='order-start'>终点:{item.endPointName || '-'}</View> |
| | | { |
| | | formatOrderStatus(item.status) != '进行中' && |
| | | <View className='order-again-box'> |
| | | <View className='order-again-text-container'></View> |
| | | </View> |
| | | } |
| | | { |
| | | formatOrderStatus(item.status) != '进行中' && |
| | | <View className='order-again-box-position' onClick={(e) => { e.stopPropagation(); againOrder(item) }}> |
| | | <View className='order-again-text' hoverClass='common-hover-class'>再来一单</View> |
| | | </View> |
| | | } |
| | | { |
| | | formatOrderStatus(item.status) == '待支付' && |
| | | <View className='order-pay-box-position' onClick={(e) => e.stopPropagation()}> |
| | | <View className='order-pay-text' hoverClass='common-hover-class'>去支付</View> |
| | | </View> |
| | | } |
| | | <View className='order-action-row'> |
| | | { |
| | | formatOrderStatus(item.status) == '待支付' && |
| | | <View onClick={(e) => e.stopPropagation()}> |
| | | <View className='order-pay-text' hoverClass='common-hover-class'>去支付</View> |
| | | </View> |
| | | } |
| | | { |
| | | formatOrderStatus(item.status) == '已完成' && |
| | | <View onClick={(e) => { e.stopPropagation(); toInvoicePage() }}> |
| | | <View className='order-again-text' hoverClass='common-hover-class'>开发票</View> |
| | | </View> |
| | | } |
| | | { |
| | | ['已完成', '已取消'].includes(formatOrderStatus(item.status)) && |
| | | <View onClick={(e) => { e.stopPropagation(); againOrder(item) }}> |
| | | <View className='order-again-text' hoverClass='common-hover-class'>再来一单</View> |
| | | </View> |
| | | } |
| | | </View> |
| | | </View> |
| | | })} |
| | | </View>) |