From 06c593e3d835616623d33157a9c9f0faa43ba68d Mon Sep 17 00:00:00 2001 From: xuan Date: Fri, 23 Sep 2022 16:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E5=8F=91=E8=B4=A7=E5=88=97?= =?UTF-8?q?=E8=A1=A8):=20=E5=AE=8C=E5=96=84=E9=9D=A2=E6=96=99=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/saleModeTag/index.tsx | 9 +++---- .../delivery/components/ItemList/index.tsx | 24 +++++-------------- src/pages/delivery/index.tsx | 1 - 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/components/saleModeTag/index.tsx b/src/components/saleModeTag/index.tsx index 89195ad..4f7927b 100644 --- a/src/components/saleModeTag/index.tsx +++ b/src/components/saleModeTag/index.tsx @@ -5,25 +5,26 @@ import Tag, { TagSize } from "../tag" interface SaleModeProps { saleMode: number size?: TagSize + customClassName?: string children?: React.ReactNode } const SaleModeTag: FC = (props) => { - const { saleMode, size = 'small' } = props + const { saleMode, size = 'small', customClassName } = props return ( <> {saleMode === EnumSaleMode.Bulk && ( - + 大货 )} {saleMode === EnumSaleMode.Plate && ( - + 剪板 )} {saleMode === EnumSaleMode.BulkCut && ( - + 散剪 )} diff --git a/src/pages/delivery/components/ItemList/index.tsx b/src/pages/delivery/components/ItemList/index.tsx index aad66eb..98f28a3 100644 --- a/src/pages/delivery/components/ItemList/index.tsx +++ b/src/pages/delivery/components/ItemList/index.tsx @@ -7,13 +7,14 @@ import NormalButton from '@/components/normalButton' import styles from './index.module.scss' import classnames from 'classnames' import { EnumSaleMode } from '@/common/Enumerate' -import { formatDateTime } from '@/common/format' +import { formatDateTime, formatMeterDiv } from '@/common/format' import { goLink } from '@/common/common' import { DeliveryNoticeOrderAudit } from '@/api/index' import Taro from '@tarojs/taro' +import SaleModeTag from '@/components/saleModeTag' type PropsType = { - itemData?: Record + itemData: Record onSuccess?: Function } @@ -63,22 +64,9 @@ const ItemList:FC = (props) => { 货品信息: - {itemData?.sale_mode === EnumSaleMode.Bulk && ( - - 大货 - - )} - {itemData?.sale_mode === EnumSaleMode.Plate && ( - - 剪板 - - )} - {itemData?.sale_mode === EnumSaleMode.BulkCut && ( - - 散剪 - - )} - 2种面料,4种颜色,共{itemData?.sale_mode === EnumSaleMode.Bulk ? `${itemData?.delivery_roll}条` : `${itemData?.delivery_length}米`} + + {itemData.delivery_product_nums}种面料,{itemData.delivery_product_color_nums}种颜色,共 + {itemData?.sale_mode === EnumSaleMode.Bulk ? `${itemData?.delivery_roll}条` : `${formatMeterDiv(itemData?.delivery_length)}米`} diff --git a/src/pages/delivery/index.tsx b/src/pages/delivery/index.tsx index 1bdc83f..918cdd9 100644 --- a/src/pages/delivery/index.tsx +++ b/src/pages/delivery/index.tsx @@ -1,7 +1,6 @@ import { View, Text } from '@tarojs/components' import { useCallback, useEffect, useMemo, useRef, useState, FC, memo } from 'react' import styles from './index.module.scss' -import classnames from 'classnames' import Search from '@/components/search' import { DeliverNoticeOrderList, EnumSaleorderStatus } from '@/api/index' import Taro from '@tarojs/taro'