index.jsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {Image, Text, View, Picker} from '@tarojs/components';
  2. import icon from '@assets/goods/sending.svg';
  3. import {Button} from '@antmjs/vantui';
  4. import {TextGroup as Item} from '@components';
  5. import {useDate} from './hooks';
  6. import dayjs from 'dayjs';
  7. import {useScanOrder} from '@hooks';
  8. export default function DeliverGoods() {
  9. const [{goodsList, customerNo, truckNo}, onScan] = useScanOrder();
  10. const [date, onDateChagne] = useDate(customerNo);
  11. return (
  12. <View className='h-screen overflow-auto bg-gray-100 flex flex-col'>
  13. <View className='py-4 bg-white'>
  14. <Image src={icon} mode='widthFix' className='w-14 mx-auto' />
  15. <Text className='px-3 text-center mt-2 block text-lg font-semibold text-[#333]'>
  16. 上传发货单
  17. </Text>
  18. </View>
  19. <View className='mt-px bg-white px-4 py-2'>
  20. <Item title='卡车号' content={truckNo} />
  21. <Item title='客户号' content={customerNo} />
  22. <Picker
  23. mode='date'
  24. value={date}
  25. onChange={onDateChagne}
  26. start={dayjs().format('YYYY-MM-DD')}
  27. >
  28. <Item title='到货时间' content={date} />
  29. </Picker>
  30. </View>
  31. {goodsList.length > 0 ? (
  32. <View className='mt-px bg-white p-4 mb-10'>
  33. <Text className='text-lg font-semibold'>货品信息</Text>
  34. <View className='mt-3'>
  35. {goodsList.map(function ({no, num}) {
  36. return (
  37. <View
  38. key={no}
  39. className='border-0 border-b border-dashed border-gray-100 last:border-none'
  40. >
  41. <Item title='品号' content={no} />
  42. <Item title='数量' content={Number(num)} />
  43. </View>
  44. );
  45. })}
  46. </View>
  47. </View>
  48. ) : null}
  49. <View className='flex mt-auto justify-around pb-12'>
  50. <Button className='w-36' onClick={onScan} round>
  51. 扫码
  52. </Button>
  53. <Button type='primary' className='w-36' color='#58C6EA' round>
  54. 发货
  55. </Button>
  56. </View>
  57. </View>
  58. );
  59. }