🐞 fix(#1000663#16#17#18#19#20): 修复发货列表|发货详情的样式问题

This commit is contained in:
xuan 2022-11-09 18:46:39 +08:00
parent 10a304a791
commit 851902873b
18 changed files with 320 additions and 51 deletions

View File

@ -177,4 +177,4 @@
height: 480px; height: 480px;
} }
} }
} }

View File

@ -0,0 +1,225 @@
import dayjs from 'dayjs'
// import { BaseEvent } from '@tarojs/components/types/common'
// #region Calendar
declare namespace Calendar {
export type DateArg = string | number | Date
export type classNameType =
| string
| Array<string>
| { [key: string]: boolean }
export interface Mark {
value: DateArg
}
export interface ValidDate {
value: DateArg
}
export interface Item {
value: string
_value: dayjs.Dayjs
text: number
type: number
marks: Array<Mark>
isActive?: boolean
isToday?: boolean
isBeforeMin?: boolean
isAfterMax?: boolean
isDisabled?: boolean
isSelected?: boolean
isSelectedHead?: boolean
isSelectedTail?: boolean
}
export interface GroupOptions {
validDates: Array<ValidDate>
marks: Array<Mark>
format: string
selectedDates: Array<SelectedDate>
minDate?: DateArg
maxDate?: DateArg
}
export type List<T> = Array<T>
export type ListInfo<T> = {
value: number
list: List<T>
}
export interface SelectedDate {
end?: Calendar.DateArg
start: Calendar.DateArg
}
}
export default Calendar
export { Calendar }
// #endregion
// #region AtCalendar
export interface AtCalendarPropsBase {
format?: string
validDates?: Array<Calendar.ValidDate>
minDate?: Calendar.DateArg
maxDate?: Calendar.DateArg
isSwiper?: boolean
marks?: Array<Calendar.Mark>
monthFormat?: string
hideArrow?: boolean
isVertical?: boolean
className?: Calendar.classNameType
onClickPreMonth?: () => void
onClickNextMonth?: () => void
onSelectDate?: (item: { value: Calendar.SelectedDate }) => void
onDayClick?: (item: { value: string }) => void
onDayLongClick?: (item: { value: string }) => void
onMonthChange?: (value: string) => void
}
export interface AtCalendarSingleSelectedProps extends AtCalendarPropsBase {
isMultiSelect?: false
currentDate?: Calendar.DateArg
}
export interface AtCalendarMutilSelectedProps extends AtCalendarPropsBase {
isMultiSelect?: true
currentDate?: Calendar.SelectedDate
}
export type AtCalendarProps =
| AtCalendarSingleSelectedProps
| AtCalendarMutilSelectedProps
export interface AtCalendarDefaultProps {
format: string
isSwiper: boolean
validDates: Array<Calendar.ValidDate>
marks: Array<Calendar.Mark>
currentDate: Calendar.DateArg | Calendar.SelectedDate
monthFormat: string
hideArrow: boolean
isVertical: boolean
isMultiSelect: boolean
selectedDates: Array<Calendar.SelectedDate>
}
export interface AtCalendarState {
generateDate: number
selectedDate: Calendar.SelectedDate
}
export type AtCalendarPropsWithDefaults = AtCalendarProps &
AtCalendarDefaultProps
// #endregion
// #region AtCalendarController
export interface AtCalendarControllerProps {
generateDate: Calendar.DateArg
minDate?: Calendar.DateArg
maxDate?: Calendar.DateArg
hideArrow: boolean
monthFormat: string
onPreMonth: () => void
onNextMonth: () => void
onSelectDate: (e: any) => void
}
export interface AtCalendarControllerState {}
// #endregion
// #region AtCalendarBody
export type AtCalendarBodyListGroup = Array<Calendar.ListInfo<Calendar.Item>>
export interface AtCalendarBodyProps {
format: string
validDates: Array<Calendar.ValidDate>
marks: Array<Calendar.Mark>
isSwiper: boolean
minDate?: Calendar.DateArg
maxDate?: Calendar.DateArg
isVertical: boolean
generateDate: number
selectedDate: Calendar.SelectedDate
selectedDates: Array<Calendar.SelectedDate> | []
onDayClick: (item: Calendar.Item) => void
onSwipeMonth: (vectorCount: number) => void
onLongClick: (item: Calendar.Item) => void
}
export interface AtCalendarBodyState {
isAnimate: boolean
offsetSize: number
listGroup: AtCalendarBodyListGroup
}
// #endregion

View File

@ -1,7 +1,7 @@
import classnames from 'classnames' import classnames from 'classnames'
import React from 'react' import React from 'react'
import { Text, View } from '@tarojs/components' import { Text, View } from '@tarojs/components'
import { Calendar } from '../../../../../types/calendar' import { Calendar } from '../../types/calendar'
import * as constant from '../../common/constant' import * as constant from '../../common/constant'
const MAP: { [key: number]: string } = { const MAP: { [key: number]: string } = {
@ -66,7 +66,7 @@ export default class AtCalendarList extends React.Component<Props> {
<View className='extra-marks'> <View className='extra-marks'>
{item.marks.map((mark, key) => ( {item.marks.map((mark, key) => (
<Text key={key} className='mark'> <Text key={key} className='mark'>
{mark.value} {mark.value as React.ReactNode}
</Text> </Text>
))} ))}
</View> </View>

View File

@ -49,6 +49,7 @@ $am-ms: 200ms;
justify-content: center; justify-content: center;
height: 80px; height: 80px;
font-size: 29px; font-size: 29px;
font-weight: bold;
color: #000000; color: #000000;
padding-top: 10px; padding-top: 10px;
} }

View File

@ -14,17 +14,17 @@ const SaleModeTag: FC<SaleModeProps> = (props) => {
return ( return (
<> <>
{saleMode === EnumSaleMode.Bulk && ( {saleMode === EnumSaleMode.Bulk && (
<Tag circle type='primary' size={size} customClassName={customClassName}> <Tag circle type='bulk' size={size} customClassName={customClassName}>
</Tag> </Tag>
)} )}
{saleMode === EnumSaleMode.Plate && ( {saleMode === EnumSaleMode.Plate && (
<Tag circle type='danger' size={size} customClassName={customClassName}> <Tag circle type='plate' size={size} customClassName={customClassName}>
</Tag> </Tag>
)} )}
{saleMode === EnumSaleMode.BulkCut && ( {saleMode === EnumSaleMode.BulkCut && (
<Tag circle type='warning' size={size} customClassName={customClassName}> <Tag circle type='bulkCut' size={size} customClassName={customClassName}>
</Tag> </Tag>
)} )}

View File

@ -35,6 +35,24 @@
background-color: $color_warning; background-color: $color_warning;
color: white; color: white;
} }
// 大货
&--bulk {
border: 1px solid $color_bulk;
background-color: $color_bulk;
color: white;
}
// 剪板
&--plate {
border: 1px solid $color_plate;
background-color: $color_plate;
color: white;
}
// 散剪
&--bulkCut {
border: 1px solid $color_bulkCut;
background-color: $color_bulkCut;
color: white;
}
&--info { &--info {
border: 1px solid $color_info; border: 1px solid $color_info;
background-color: $color_info; background-color: $color_info;
@ -54,6 +72,18 @@
border: 1px solid $color_warning; border: 1px solid $color_warning;
color: $color_warning; color: $color_warning;
} }
&.tag--bulk {
border: 1px solid $color_bulk;
color: $color_bulk;
}
&.tag--plate {
border: 1px solid $color_plate;
color: $color_plate;
}
&.tag--bulkCut {
border: 1px solid $color_bulkCut;
color: $color_bulkCut;
}
&.tag--info { &.tag--info {
border: 1px solid $color_info; border: 1px solid $color_info;
color: $color_info; color: $color_info;

View File

@ -4,7 +4,7 @@ import classnames from 'classnames'
import styles from './index.module.scss' import styles from './index.module.scss'
export type TagSize = 'small' | 'normal' export type TagSize = 'small' | 'normal'
type TagType = 'primary' | 'danger' | 'warning' | 'info' type TagType = 'primary' | 'danger' | 'warning' | 'info' | 'bulk' | 'plate' | 'bulkCut'
interface PropsType { interface PropsType {
type?: TagType type?: TagType

View File

@ -0,0 +1,12 @@
.time-box {
padding: 40px;
}
.sure-box {
margin-left: 102px;
margin-right: 102px;
font-size: 28px;
font-weight: 500;
}

View File

@ -1,19 +0,0 @@
.time-box {
padding: 40px;
}
.sure-box {
// padding: 16px 102px 30px 102px;
margin-left: 102px;
margin-right: 102px;
height: 80px;
background: #337FFF;
border-radius: 44px;
font-size: 28px;
font-weight: 500;
color: #FFFFFF;
text-align: center;
line-height: 80px;
}

View File

@ -1,9 +1,10 @@
import Popup from '@/components/popup' import Popup from '@/components/popup'
import { useState, memo } from 'react' import { useState, memo } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import './index.scss' import styles from './index.module.scss'
import AtCalendar from '@/components/calendar/index' import AtCalendar from '@/components/calendar/index'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import NormalButton from '../normalButton'
type DateArg = string | number | Date type DateArg = string | number | Date
interface Props { interface Props {
@ -32,7 +33,7 @@ export default memo((props: Props) => {
return ( return (
<> <>
<View className='time-box'> <View className={styles['time-box']}>
<AtCalendar <AtCalendar
isMultiSelect isMultiSelect
format='YYYY-MM-DD 00:00:00' format='YYYY-MM-DD 00:00:00'
@ -43,9 +44,10 @@ export default memo((props: Props) => {
onSelectDate={(e) => handTime?.(e)} onSelectDate={(e) => handTime?.(e)}
/> />
</View> </View>
<View className='sure-box' onClick={() => onSelectDate?.(time)}> <NormalButton type='primary' onClick={() => onSelectDate?.(time)} size="normal" round customClassName={styles['sure-box']}></NormalButton>
{/* <View className='sure-box' onClick={() => onSelectDate?.(time)}>
</View> </View> */}
</> </>
) )
}) })

View File

@ -48,11 +48,12 @@
font-size: 28px; font-size: 28px;
height: 72px; height: 72px;
&--text { &--text {
color: #909090; color: #696969;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-weight: lighter;
} }
&:hover { &:hover {
opacity: 0.7; opacity: 0.7;
@ -62,6 +63,7 @@
background-color: #eaf2ff; background-color: #eaf2ff;
.filterButton--text { .filterButton--text {
color: $color_main; color: $color_main;
font-weight: 550;
} }
} }
} }
@ -74,11 +76,13 @@
justify-content: space-around; justify-content: space-around;
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
.btn {
width: 40%;
&:hover{
filter: blur(.7);
}
btn:hover{
filter: blur(.7);
} }
.rest_btn { .rest_btn {
font-size: 28px; font-size: 28px;
} }

View File

@ -1,5 +1,6 @@
.layoutBlock{ .layoutBlock{
margin: 24px; margin: 20px;
padding: 24px;
} }
.topBar { .topBar {
font-size: 28px; font-size: 28px;
@ -8,13 +9,16 @@
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
color: $color_font_one; color: $color_font_one;
.orderNo{
font-weight: bold;
}
} }
&__orderType { &__orderType {
color: rgba($color: #000000, $alpha: 0.6); color: #6e6e6e;
font-weight: 550; font-weight: bold;
} }
&__orderStatus { &__orderStatus {
font-weight: 550; font-weight: bold;
&--toBeAudited{ &--toBeAudited{
color: #e42945; color: #e42945;
} }

View File

@ -53,13 +53,13 @@ const ItemList:FC<PropsType> = (props) => {
<LayoutBlock circle customClassName={styles.layoutBlock}> <LayoutBlock circle customClassName={styles.layoutBlock}>
<View className={styles.topBar}> <View className={styles.topBar}>
<View className={styles.topBar__orderNo}> <View className={styles.topBar__orderNo}>
<View>{itemData?.order_no}</View> <View className={styles.orderNo}>{itemData?.order_no}</View>
{itemData?.status === 1 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--finish'])}></View>} {itemData?.status === 1 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--finish'])}></View>}
{itemData?.status === 0 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--toBeAudited'])}></View>} {itemData?.status === 0 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--toBeAudited'])}></View>}
</View> </View>
<Text className={styles.topBar__orderType}>{itemData?.type_name}</Text> <Text className={styles.topBar__orderType}>{itemData?.type_name}</Text>
</View> </View>
<Divider direction='horizontal' customStyles={{ margin: '30rpx 0' }}></Divider> <Divider direction='horizontal' customStyles={{ margin: '20rpx 0 10rpx 0' }}></Divider>
<View className={styles.content}> <View className={styles.content}>
<View className={classnames(styles.content__row, styles.bord)}> <View className={classnames(styles.content__row, styles.bord)}>
<View className={styles.content__row__left}></View> <View className={styles.content__row__left}></View>
@ -83,7 +83,7 @@ const ItemList:FC<PropsType> = (props) => {
customClassName={styles.bottomBar__button} customClassName={styles.bottomBar__button}
plain plain
type='info' type='info'
customStyles={{ color: '#8e8e8e', borderColor: '#8e8e8e' }} customStyles={{ color: '#636363', borderColor: '#c8c8c8' }}
round round
onClick={() => handleDetail(itemData)}> onClick={() => handleDetail(itemData)}>

View File

@ -25,7 +25,7 @@ page {
height: 100%; height: 100%;
&--total { &--total {
display: block; display: block;
margin-top: 24px; margin-top: 20px;
padding: 0 24px; padding: 0 24px;
font-size: 24px; font-size: 24px;
color: #9d9d9d; color: #9d9d9d;

View File

@ -41,7 +41,7 @@ const Delivery: FC = () => {
const { fetchData: FetchDeliveryOrderList, state: orderState } = DeliverNoticeOrderList() const { fetchData: FetchDeliveryOrderList, state: orderState } = DeliverNoticeOrderList()
//数据加载状态 //数据加载状态
const statusMore = useMemo(() => { const statusMore = useMemo(() => {
return dataLoadingStatus({ list: deliveryOrderList.list, total: deliveryOrderList.total, status: orderState.loading }) return dataLoadingStatus({ list: deliveryOrderList.list, total: deliveryOrderList.total, status: orderState.loading! })
}, [deliveryOrderList, orderState]) }, [deliveryOrderList, orderState])
//输入搜索关键字 //输入搜索关键字

View File

@ -38,6 +38,8 @@ page {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-size: 28px; font-size: 28px;
font-weight: bold;
color: #424242;
padding: 10px 0; padding: 10px 0;
} }
&--detail { &--detail {
@ -47,6 +49,7 @@ page {
align-items: center; align-items: center;
padding: 10px 0; padding: 10px 0;
font-size: 28px; font-size: 28px;
color: #6e6e6e;
} }
&--name{ &--name{
@ -69,19 +72,22 @@ page {
.orderNo { .orderNo {
font-size: 28px; font-size: 28px;
font-weight: 550; font-weight: 550;
color: #424242;
} }
.status { .status {
font-size: 28px; font-size: 28px;
&--toBeAudit { &--toBeAudit {
color: $color_danger; color: $color_danger;
font-weight: bold;
} }
&--audited { &--audited {
color: $color_main; color: $color_main;
font-weight: bold;
} }
} }
.divider { .divider {
margin: 24px 0; margin: 20px 0 10px 0;
} }
.total { .total {
margin-top: 24px; margin-top: 24px;

View File

@ -132,7 +132,7 @@ const DeliveryDetail: FC = () => {
return ( return (
<View className={styles.deliveryDetail}> <View className={styles.deliveryDetail}>
<View className={styles.content}> <View className={styles.content}>
<LayoutBlock circle> <LayoutBlock circle customStyle={{padding: '24rpx'}}>
<View className={styles.detailTop}> <View className={styles.detailTop}>
<View className={styles.orderNo}>{detailInfo?.order_no}</View> <View className={styles.orderNo}>{detailInfo?.order_no}</View>
{detailInfo?.status === 0 ? <View className={styles['status--toBeAudit']}></View> : <View className={styles['status--audited']}></View>} {detailInfo?.status === 0 ? <View className={styles['status--toBeAudit']}></View> : <View className={styles['status--audited']}></View>}
@ -147,17 +147,17 @@ const DeliveryDetail: FC = () => {
</Text> </Text>
</View> </View>
</LayoutBlock> </LayoutBlock>
<LayoutBlock circle> <LayoutBlock circle customStyle={{padding: '24rpx'}}>
<View className={styles.orderInfoTop}></View> <View className={styles.orderInfoTop}></View>
<Divider direction='horizontal' customClassName={styles.divider}></Divider> <Divider direction='horizontal' customClassName={styles.divider}></Divider>
<View className='orderInfoDetail'> <View className='orderInfoDetail'>
<Cell title='订单备注:' desc={detailInfo?.sale_order_remark}></Cell> <Cell title='订单备注:' desc={detailInfo?.sale_order_remark || '暂无备注信息'}></Cell>
<Cell title='创建时间:' desc={formatDateTime(detailInfo?.create_time)}></Cell> <Cell title='创建时间:' desc={formatDateTime(detailInfo?.create_time) || '暂无创建时间'}></Cell>
<Cell title='发货方式:' desc={detailInfo?.shipment_mode_name}></Cell> <Cell title='发货方式:' desc={detailInfo?.shipment_mode_name || '暂无发货方式'}></Cell>
<Cell title='发货地址:' desc={`${detailInfo.province_name}${detailInfo.city_name}${detailInfo.district_name}${detailInfo.address_detail}`}></Cell> <Cell title='发货地址:' desc={`${detailInfo.province_name}${detailInfo.city_name}${detailInfo.district_name}${detailInfo.address_detail}` || '暂无发货地址'}></Cell>
</View> </View>
</LayoutBlock> </LayoutBlock>
<LayoutBlock circle> <LayoutBlock circle customStyle={{padding: '24rpx'}}>
<View className={styles.orderInfoTop}></View> <View className={styles.orderInfoTop}></View>
<Divider direction='horizontal' customClassName={styles.divider}></Divider> <Divider direction='horizontal' customClassName={styles.divider}></Divider>
<UploadImage onlyRead={detailInfo?.status !== 0} onChange={handleUploadChange} defaultList={detailInfo?.delivery_appendix_url}></UploadImage> <UploadImage onlyRead={detailInfo?.status !== 0} onChange={handleUploadChange} defaultList={detailInfo?.delivery_appendix_url}></UploadImage>

View File

@ -9,6 +9,10 @@ $color_warning: #e6a23c;
$color_money: #F64861; $color_money: #F64861;
$color_info: #909090; $color_info: #909090;
$color_bulk: #0D7CFF; // 大货
$color_plate: #F79B31; // 剪板
$color_bulkCut: #0AC76F; // 散剪
$opacity-disabled: 0.3; $opacity-disabled: 0.3;
$borderStyle: solid; $borderStyle: solid;
$borderColor: #ebebeb; $borderColor: #ebebeb;