feat(dealer): 完善经销商客户添加与订单展示功能
- 添加推荐人信息查询逻辑 - 验证报备人是否存在
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, {useState, useEffect, useCallback} from 'react'
|
||||
import {View, Text, ScrollView} from '@tarojs/components'
|
||||
import {Empty, Tag, PullToRefresh, Loading} from '@nutui/nutui-react-taro'
|
||||
import {Empty, PullToRefresh, Loading} from '@nutui/nutui-react-taro'
|
||||
import Taro from '@tarojs/taro'
|
||||
import {pageShopDealerOrder} from '@/api/shop/shopDealerOrder'
|
||||
import {useDealerUser} from '@/hooks/useDealerUser'
|
||||
@@ -97,11 +97,11 @@ const DealerOrders: React.FC = () => {
|
||||
return '待结算'
|
||||
}
|
||||
|
||||
const getStatusColor = (isSettled?: number, isInvalid?: number) => {
|
||||
if (isInvalid === 1) return 'danger'
|
||||
if (isSettled === 1) return 'success'
|
||||
return 'warning'
|
||||
}
|
||||
// const getStatusColor = (isSettled?: number, isInvalid?: number) => {
|
||||
// if (isInvalid === 1) return 'danger'
|
||||
// if (isSettled === 1) return 'success'
|
||||
// return 'warning'
|
||||
// }
|
||||
|
||||
const renderOrderItem = (order: OrderWithDetails) => (
|
||||
<View key={order.id} className="bg-white rounded-lg p-4 mb-3 shadow-sm">
|
||||
@@ -109,28 +109,35 @@ const DealerOrders: React.FC = () => {
|
||||
<Text className="font-semibold text-gray-800">
|
||||
电费收益
|
||||
</Text>
|
||||
<Tag type={getStatusColor(order.isSettled, order.isInvalid)}>
|
||||
{getStatusText(order.isSettled, order.isInvalid)}
|
||||
</Tag>
|
||||
</View>
|
||||
|
||||
<View className="flex justify-between items-center mb-1">
|
||||
<Text className="text-sm text-gray-400">
|
||||
结算金额:¥{order.orderPrice || '0.00'}
|
||||
</Text>
|
||||
<Text className="text-lg text-orange-500 font-semibold">
|
||||
¥{(Number(order.orderPrice) * 10).toFixed(2)}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View className="flex justify-between items-center mb-1">
|
||||
<Text className="text-sm text-gray-400">
|
||||
客户名称:{order.comments}
|
||||
</Text>
|
||||
<Text className="text-sm text-gray-400">
|
||||
收益比率:{order.rate}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View className="flex justify-between items-center">
|
||||
<Text className="text-sm text-gray-400">
|
||||
客户:{order.comments}
|
||||
结算电量:{order.orderPrice || '0.00'}
|
||||
</Text>
|
||||
<Text className="text-sm text-gray-400">
|
||||
状态:{getStatusText(order.isSettled, order.isInvalid)}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View className="flex justify-between items-center mb-1">
|
||||
<Text className="text-sm text-gray-400">
|
||||
{order.settleTime}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user