剪板流程
This commit is contained in:
@@ -127,6 +127,9 @@
|
||||
right: 20px;
|
||||
display: flex;
|
||||
color: #707070;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.mconfont{
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Image, Text, View } from "@tarojs/components"
|
||||
import { memo, useMemo, useState } from "react"
|
||||
import { memo, useEffect, useMemo, useRef, useState } from "react"
|
||||
import styles from './index.module.scss'
|
||||
import classnames from "classnames";
|
||||
import { formatDateTime, formatImgUrl } from "@/common/fotmat";
|
||||
import { ORDER_STATUS, PAYMENT_METHOD, PAYMENT_METHOD_PARAM } from "@/common/enum";
|
||||
import * as dayjs from 'dayjs'
|
||||
|
||||
type List = {
|
||||
status: string,
|
||||
@@ -17,21 +18,22 @@ type Param = {
|
||||
orderInfo?: {
|
||||
logistics_details:List[], //订单状态列表
|
||||
payment_method: 0|PAYMENT_METHOD_PARAM, //支付方式
|
||||
status: number //订单状态
|
||||
status: number, //订单状态
|
||||
expire_time: number
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default memo(({orderInfo = {logistics_details: [],payment_method: 0, status: 0}, onRefresh}:Param) => {
|
||||
export default memo(({orderInfo = {logistics_details: [],payment_method: 0, status: 0, delivery_time:0}, onRefresh}:Param) => {
|
||||
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const changeMore = () => {
|
||||
setShowMore(() => !showMore)
|
||||
}
|
||||
const dataList = useMemo(() => {
|
||||
return orderInfo?.logistics_details?.reverse()||[]
|
||||
}, [orderInfo])
|
||||
return orderInfo.logistics_details?orderInfo?.logistics_details.reverse():[]
|
||||
}, [orderInfo.logistics_details])
|
||||
|
||||
//订单状态枚举
|
||||
const {SaleorderstatusWaitingPrePayment} = ORDER_STATUS
|
||||
@@ -42,10 +44,35 @@ export default memo(({orderInfo = {logistics_details: [],payment_method: 0, stat
|
||||
PaymentMethodCashOnDelivery,
|
||||
} = PAYMENT_METHOD
|
||||
|
||||
|
||||
//倒计时
|
||||
const count_down = useMemo(() => {
|
||||
|
||||
}, [orderInfo])
|
||||
const timeObj:any = useRef()
|
||||
useEffect(() => {
|
||||
if(orderInfo.expire_time) {
|
||||
timeObj.current = setInterval(() => {
|
||||
count_down()
|
||||
}, 1000)
|
||||
}
|
||||
return () => {
|
||||
clearInterval(timeObj.current)
|
||||
}
|
||||
}, [orderInfo.expire_time])
|
||||
|
||||
|
||||
const count_down = () => {
|
||||
var startData = dayjs();
|
||||
var endDate = dayjs(orderInfo.expire_time);
|
||||
console.log('endDate::', endDate.format('YYYY-MM-DD HH:mm'))
|
||||
var _dd = endDate.diff(startData,'day');
|
||||
var _hh = endDate.diff(startData,'hour');
|
||||
var _mm = endDate.diff(startData,'minute');
|
||||
var _ss = endDate.diff(startData,'second');
|
||||
// 转换
|
||||
var hh = _hh - (_dd*24);
|
||||
var mm = _mm - (_hh*60);
|
||||
var ss = _ss - (_mm*60);
|
||||
console.log(`${_dd} ${hh} ${mm} ${ss}`)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -73,10 +100,10 @@ export default memo(({orderInfo = {logistics_details: [],payment_method: 0, stat
|
||||
{(orderInfo.payment_method == PaymentMethodCashOnDelivery.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status.png')} className={styles.image}/>}
|
||||
{(orderInfo.payment_method == PaymentMethodAccountPeriod.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status_7day.png')} className={styles.image}/>}
|
||||
</View>
|
||||
<View className={styles.refresh} onClick={onRefresh}>
|
||||
{(orderInfo.status == SaleorderstatusWaitingPrePayment.value)&&<View className={styles.refresh} onClick={onRefresh}>
|
||||
<Text className={classnames(styles.mconfont, 'iconfont icon-xianxiahuikuan')}></Text>
|
||||
<Text className={classnames(styles.refresh_text)}>刷新</Text>
|
||||
</View>
|
||||
</View>}
|
||||
</View>}
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -121,6 +121,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
|
||||
//是否显示七天账期
|
||||
const show_account_payment = useMemo(() => {
|
||||
console.log('orderInfo?.status::',orderInfo)
|
||||
//支付方式是账期支付,不显示
|
||||
if(orderInfo?.payment_method == PaymentMethodAccountPeriod.value) return false
|
||||
//支付方式是货到付款,不显示
|
||||
|
||||
Reference in New Issue
Block a user