1
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, PullToRefresh, Space, Loading, DatePicker, Button} from '@nutui/nutui-react-taro'
|
||||
import {Empty, PullToRefresh, Space, Loading, DatePicker, Button, Picker} from '@nutui/nutui-react-taro'
|
||||
import {ArrowDown} from '@nutui/icons-react-taro'
|
||||
import Taro from '@tarojs/taro'
|
||||
import {pageShopDealerOrder} from '@/api/shop/shopDealerOrder'
|
||||
@@ -14,6 +14,28 @@ interface OrderWithDetails extends ShopDealerOrder {
|
||||
userCommission?: string
|
||||
}
|
||||
|
||||
interface PickerOption {
|
||||
text: string | number
|
||||
value: string | number
|
||||
disabled?: boolean
|
||||
children?: PickerOption[]
|
||||
className?: string | number
|
||||
}
|
||||
|
||||
const listData1 = [
|
||||
[
|
||||
{ value: 1, text: '南京市' },
|
||||
{ value: 2, text: '无锡市' },
|
||||
{ value: 3, text: '海北藏族自治区' },
|
||||
{ value: 4, text: '北京市' },
|
||||
{ value: 5, text: '连云港市' },
|
||||
{ value: 8, text: '大庆市' },
|
||||
{ value: 9, text: '绥化市' },
|
||||
{ value: 10, text: '潍坊市' },
|
||||
{ value: 12, text: '乌鲁木齐市' },
|
||||
],
|
||||
]
|
||||
|
||||
const DealerOrder: React.FC = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false)
|
||||
const d = new Date()
|
||||
@@ -28,19 +50,6 @@ const DealerOrder: React.FC = () => {
|
||||
const [hasMore, setHasMore] = useState<boolean>(true)
|
||||
const [visible1, setVisible1] = useState(false)
|
||||
const [baseDesc, setBaseDesc] = useState('')
|
||||
const listData1 = [
|
||||
[
|
||||
{ value: 1, text: '南京市' },
|
||||
{ value: 2, text: '无锡市' },
|
||||
{ value: 3, text: '海北藏族自治区' },
|
||||
{ value: 4, text: '北京市' },
|
||||
{ value: 5, text: '连云港市' },
|
||||
{ value: 8, text: '大庆市' },
|
||||
{ value: 9, text: '绥化市' },
|
||||
{ value: 10, text: '潍坊市' },
|
||||
{ value: 12, text: '乌鲁木齐市' },
|
||||
],
|
||||
]
|
||||
|
||||
const {dealerUser} = useDealerUser()
|
||||
const {user} = useUser()
|
||||
@@ -127,6 +136,22 @@ const DealerOrder: React.FC = () => {
|
||||
return user.roles.some(role => role.roleCode === roleCode);
|
||||
}
|
||||
|
||||
const changePicker = (list: any[], option: any, columnIndex: number) => {
|
||||
console.log(list,'list>>>')
|
||||
console.log(columnIndex, option)
|
||||
}
|
||||
|
||||
const confirmPicker = (
|
||||
options: PickerOption[],
|
||||
values: (string | number)[]
|
||||
) => {
|
||||
let description = ''
|
||||
options.forEach((option: any) => {
|
||||
description += ` ${option.text}`
|
||||
})
|
||||
console.log(values,'values')
|
||||
setBaseDesc(description)
|
||||
}
|
||||
|
||||
// 初始化加载数据
|
||||
useEffect(() => {
|
||||
@@ -251,11 +276,11 @@ const DealerOrder: React.FC = () => {
|
||||
className={'p-4 flex items-center justify-between'}
|
||||
>
|
||||
<View className={'select-month'}>
|
||||
<Text className={'text-sm'} onClick={() => setShow1(true)}>{date ? `${date}` : '请选择'}</Text>
|
||||
<Text className={'text-sm mx-1'} onClick={() => setShow1(true)}>{date ? `${date}` : '请选择'}</Text>
|
||||
<ArrowDown size={10} className={'text-gray-400'} onClick={() => setShow1(true)}/>
|
||||
</View>
|
||||
<Space className={'select-user'}>
|
||||
<Button size={'mini'}>业务员</Button>
|
||||
<Button size={'mini'}>{baseDesc || '业务员'}</Button>
|
||||
<Button size={'mini'}>渠道一</Button>
|
||||
<Button size={'mini'} onClick={() => setVisible1(!visible1)}>渠道二</Button>
|
||||
</Space>
|
||||
@@ -305,6 +330,14 @@ const DealerOrder: React.FC = () => {
|
||||
setDate(`${values[0]}${values[1]}`)
|
||||
}}
|
||||
/>
|
||||
<Picker
|
||||
title="请选择城市"
|
||||
visible={visible1}
|
||||
options={listData1}
|
||||
onConfirm={(list, values) => confirmPicker(list, values)}
|
||||
onClose={() => setVisible1(false)}
|
||||
onChange={changePicker}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ const OrderConfirm = () => {
|
||||
removeFromCart
|
||||
} = useCart();
|
||||
|
||||
console.log(goods, 'goods>>>>')
|
||||
console.log(setPayment,'setPayment>>>')
|
||||
const reload = async () => {
|
||||
const address = await listShopUserAddress({isDefault: true});
|
||||
if (address.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user