|
|
@@ -0,0 +1,55 @@
|
|
|
+import {View, Text, Image} from '@tarojs/components';
|
|
|
+import Item from './item';
|
|
|
+import {Refresh} from '@components';
|
|
|
+import {useList} from './hooks';
|
|
|
+import filterIcon from '@assets/filter.svg';
|
|
|
+import classNames from 'classnames';
|
|
|
+import {useBoolean} from 'ahooks';
|
|
|
+import Filter from './filter';
|
|
|
+
|
|
|
+function LogList() {
|
|
|
+ const [{isFetching, data}, {refetch, onDateChange}] = useList();
|
|
|
+ const [visible, {setTrue, setFalse}] = useBoolean(false);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <View className='h-screen w-screen flex flex-col box-border'>
|
|
|
+ <View className='w-full flex text-xs py-1 text-gray-600'>
|
|
|
+ <Text className='text-center text-over flex-1 px-1'>到货日期</Text>
|
|
|
+ <Text className='text-center text-over w-28 px-1'>客户名称</Text>
|
|
|
+ <Text className='text-center text-over flex-1 px-1'>是否送达</Text>
|
|
|
+ <Text className='text-center text-over flex-1 px-1'>是否异常</Text>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View className='flex-1 overflow-hidden'>
|
|
|
+ <Refresh
|
|
|
+ className='h-full'
|
|
|
+ isRefreshing={isFetching}
|
|
|
+ onRefresh={refetch}
|
|
|
+ noMore={false}
|
|
|
+ empty={data.length === 0}
|
|
|
+ >
|
|
|
+ {data.map(function (data) {
|
|
|
+ return <Item key={data[0].id} data={data} />;
|
|
|
+ })}
|
|
|
+ <View className='h-20' />
|
|
|
+ </Refresh>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View
|
|
|
+ onClick={setTrue}
|
|
|
+ className={classNames(
|
|
|
+ 'fixed right-3 bottom-8 flex items-center justify-center bg-white rounded-3xl',
|
|
|
+ 'w-10 h-10 shadow-lg z-10',
|
|
|
+ )}
|
|
|
+ >
|
|
|
+ <Image src={filterIcon} mode='widthFix' className='w-5' />
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <Filter visible={visible} onClose={setFalse} onConfirm={onDateChange} />
|
|
|
+ </>
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+export default LogList;
|