✨ feat(发货列表): 已完成发货列表对接

This commit is contained in:
xuan
2022-09-21 19:19:58 +08:00
parent 25628dccdc
commit 5df6024528
12 changed files with 393 additions and 349 deletions
+19
View File
@@ -0,0 +1,19 @@
.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;
}
+47
View File
@@ -0,0 +1,47 @@
import Popup from '@/components/popup'
import { useState, memo } from 'react'
import { View } from '@tarojs/components'
import './index.scss'
import AtCalendar from '@/components/calendar/index'
import dayjs from 'dayjs'
type DateArg = string | number | Date
interface Props {
showTime: boolean
closePopup?: () => void
end?: DateArg
start?: DateArg
onSelectDate?: (any) => void
}
export default memo((props: Props) => {
let { showTime = false, closePopup, start = '', end = '', onSelectDate } = props
const [time, setTime] = useState<any>({})
const handTime = (e) => {
const { start, end } = e.value
// 如果选的是同一天的日期, end 自动加一天
if (start === end) {
e.value.end = `${dayjs(new Date(start)).add(1, 'day').format('YYYY-MM-DD')} 00:00:00`
}
setTime(e)
}
return (
<Popup title={'选择时间'} show={showTime} onClose={() => closePopup?.()}>
<View className='time-box'>
<AtCalendar
isMultiSelect
format='YYYY-MM-DD 00:00:00'
currentDate={{
start: start,
end: end,
}}
onSelectDate={(e) => handTime?.(e)}
/>
</View>
<View className='sure-box' onClick={() => onSelectDate?.(time)}>
确认
</View>
</Popup>
)
})