✨ feat(发货单详情): 已完成发货单详情

This commit is contained in:
xuan
2022-09-22 15:53:30 +08:00
parent d2a1441810
commit b51c53a73a
69 changed files with 651 additions and 369 deletions
+24
View File
@@ -0,0 +1,24 @@
.cell {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
font-size: 28px;
padding: 12px 0;
.title {
min-width: 140px;
flex: none;
color: #a9a9a9;
}
.desc {
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: flex-end;
flex: 1 1 auto;
color: $color_font_one;
}
}
.descText {
@include common_ellipsis(2);
}
+43
View File
@@ -0,0 +1,43 @@
import { View, Text } from '@tarojs/components'
import classNames from "classnames"
import { FC, useCallback, useMemo, useRef } from "react"
import IconFont, { IconNames } from "../iconfont/iconfont"
import styles from './index.module.scss'
interface CellPropsType {
title: string
desc: string
isLink?: boolean
onClick?: () => void
customStyle?: React.CSSProperties
customClassName?: string
iconName?: IconNames
}
const Cell:FC<CellPropsType> = (props) => {
const {title, desc, isLink = false, customClassName, customStyle, onClick, iconName} = props
const onClickRef = useRef(onClick)
onClickRef.current = onClick
// 防止函数的引用改变
const handleClick = useCallback(() => {
return isLink && onClickRef.current?.()
}, [isLink])
const CellElement = useMemo(() => {
return (
<View className={classNames(styles.cell, customClassName)} style={customStyle} onClick={handleClick}>
<View className={styles.title}>
{iconName && <IconFont name={iconName} size={46}></IconFont>}
<Text>{title}</Text>
</View>
<View className={styles.desc}>
<Text className={styles.descText}>{desc}</Text>
{isLink && <IconFont name='icon-chakanquanbukehu' size={46} color='inherit'></IconFont>}
</View>
</View>
)
}, [title, desc, handleClick, customStyle])
return <>{CellElement}</>
}
export default Cell
+2 -4
View File
@@ -1,13 +1,11 @@
import { FC } from "react"
import { View, Text } from '@tarojs/components'
import IconFont from '../iconfont/iconfont'
import IconFont, { IconNames } from '../iconfont/iconfont'
import styles from './index.module.scss'
import classnames from 'classnames'
type IconfontName = Parameters<typeof IconFont>['0']['name']
type PropsType = {
iconName: IconfontName
iconName: IconNames
iconSize?: number
svg?: boolean
text?: string
@@ -4,6 +4,8 @@
background-color: #fff;
padding: 32px;
margin-bottom: 20px;
margin-left: 24px;
margin-right: 24px;
&--row {
flex-flow: row nowrap;
}
+33
View File
@@ -0,0 +1,33 @@
import { EnumSaleMode } from "@/common/Enumerate"
import { FC } from "react"
import Tag, { TagSize } from "../tag"
interface SaleModeProps {
saleMode: number
size?: TagSize
children?: React.ReactNode
}
const SaleModeTag: FC<SaleModeProps> = (props) => {
const { saleMode, size = 'small' } = props
return (
<>
{saleMode === EnumSaleMode.Bulk && (
<Tag circle type='primary' plain size={size}>
大货
</Tag>
)}
{saleMode === EnumSaleMode.Plate && (
<Tag circle type='danger' plain size={size}>
剪板
</Tag>
)}
{saleMode === EnumSaleMode.BulkCut && (
<Tag circle type='warning' plain size={size}>
散剪
</Tag>
)}
</>
)
}
export default SaleModeTag
+1 -1
View File
@@ -3,7 +3,7 @@ import { FC, ReactNode } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
type TagSize = 'small' | 'normal'
export type TagSize = 'small' | 'normal'
type TagType = 'primary' | 'danger' | 'warning' | 'info'
interface PropsType {
+3 -3
View File
@@ -1,4 +1,4 @@
import Taro, { FC } from '@tarojs/taro'
import Taro from '@tarojs/taro'
import { memo, useEffect, useState } from 'react'
import useUploadCDNImg from '@/use/useUploadImage'
import { Image, Text, View } from '@tarojs/components'
@@ -10,9 +10,9 @@ import styles from './index.module.scss'
type ImageParam = {
onChange?: (val: string[]) => void
defaultList?: string[]
onlyRead?: false | true
onlyRead?: boolean
}
const PictureItem: FC<ImageParam> = memo(({ onChange, defaultList, onlyRead = false }) => {
const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false }) => {
const { getWxPhoto } = useUploadCDNImg()
const [imageList, setImageLise] = useState<string[]>([])