✨ feat(码单优化调整):
This commit is contained in:
parent
16464f482a
commit
6ad9ecb830
@ -8,7 +8,7 @@
|
||||
width: 306px;
|
||||
background-color: #fff;
|
||||
color: #337fff;
|
||||
top: -290px;
|
||||
transform: translateY(-100%);
|
||||
right: 0;
|
||||
padding: 20px;
|
||||
font-size: 28px;
|
||||
|
||||
@ -5,6 +5,7 @@ import IconFont from '../iconfont/iconfont'
|
||||
import styles from './index.module.scss'
|
||||
import { goLink } from '@/common/common'
|
||||
import ViewCodeList from '@/components/viewCodeList/index'
|
||||
import { GetCustomCodeDetailApi } from '@/api/codeManage'
|
||||
|
||||
interface param {
|
||||
y: number
|
||||
@ -28,15 +29,50 @@ export default ({ y, orderObj = {} }: param) => {
|
||||
|
||||
const [showPopup, setshowPopup] = useState(false)
|
||||
|
||||
const [codeData, setCodeData] = useState<any>(null)
|
||||
|
||||
const { fetchData: getCustomCodeDetail } = GetCustomCodeDetailApi()
|
||||
const onGetCustomCodeDetail = async() => {
|
||||
const res = await getCustomCodeDetail({ id: orderObj.custom_print_id })
|
||||
const { data } = res
|
||||
setCodeData({
|
||||
dyelot_number_list: data.dyelot_number_list,
|
||||
total_number: data.roll,
|
||||
title: data.purchaser_name,
|
||||
sale_mode_name: data.sale_mode_name,
|
||||
purchaser_name: data.purchaser_name,
|
||||
purchaser_phone: data.purchaser_phone,
|
||||
create_time: data.create_time,
|
||||
bill_total_sale_price: data.total_amount,
|
||||
total_weight: data.total_sale_weight,
|
||||
total_settle_weight: data.total_settlement_weight,
|
||||
total_weight_error: data.total_weight_error,
|
||||
show_pay_type: false,
|
||||
show_order_no: false,
|
||||
show_shipment_mode: false,
|
||||
show_barcode: false,
|
||||
show_qrcode: false,
|
||||
})
|
||||
}
|
||||
|
||||
const openOldPrive = () => {
|
||||
setCodeData(orderObj)
|
||||
setshowPopup(true)
|
||||
}
|
||||
|
||||
const openNewPrive = () => {
|
||||
onGetCustomCodeDetail()
|
||||
setshowPopup(true)
|
||||
}
|
||||
return (<>
|
||||
{showCode && <View className={styles.mask} catchMove onClick={() => setShowCode(!showCode)}></View>}
|
||||
<MovableView className={classnames(styles.code_list, styles.fixed_btn)} direction="all" inertia x="630rpx" y={`${y}rpx`}>
|
||||
{showCode && <View className={classnames(styles.code_list__card, showCode && styles['code_list--open'])}>
|
||||
<View className={styles['code_list__card--item']} onClick={() => setshowPopup(true)}>
|
||||
<View className={styles['code_list__card--item']} onClick={openOldPrive}>
|
||||
<IconFont name="icon-yuanshimadanyulan" size={46} />
|
||||
<Text>原始码单预览</Text>
|
||||
</View>
|
||||
{!!orderObj?.custom_print_id && <View className={styles['code_list__card--item']} >
|
||||
{!!orderObj?.custom_print_id && <View className={styles['code_list__card--item']} onClick={openNewPrive}>
|
||||
<IconFont name="icon-zidingyimadanyulan" size={46} />
|
||||
<Text>自定义码单预览</Text>
|
||||
</View>}
|
||||
@ -47,7 +83,7 @@ export default ({ y, orderObj = {} }: param) => {
|
||||
</View>}
|
||||
<View className={styles['code_list--text']} onClick={() => setShowCode(!showCode)}>码单</View>
|
||||
</MovableView>
|
||||
<ViewCodeList orderObj={orderObj} showPopup={showPopup} handClose={() => setshowPopup(false)}></ViewCodeList>
|
||||
<ViewCodeList orderObj={codeData} showPopup={showPopup} handClose={() => setshowPopup(false)}></ViewCodeList>
|
||||
|
||||
</>)
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Button, Image, MovableArea, MovableView, View } from '@tarojs/components'
|
||||
import Taro, { useDidShow, useReady, useRouter } from '@tarojs/taro'
|
||||
import type { ReactElement } from 'react'
|
||||
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
|
||||
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import Customer from '../customer'
|
||||
import CodeSelect from '../codeSelect'
|
||||
@ -11,6 +11,7 @@ import useCommonData from '@/use/useCommonData'
|
||||
import { useSelector } from '@/reducers/hooks'
|
||||
import { alert } from '@/common/common'
|
||||
import { formatImgUrl } from '@/common/fotmat'
|
||||
import { ORDER_STATUS } from '@/common/enum'
|
||||
|
||||
type ShowStatus = 'shop'|'customer'|'order'|'code'
|
||||
interface param {
|
||||
@ -68,6 +69,31 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m
|
||||
set_customer_service_show(false)
|
||||
}
|
||||
|
||||
// 订单状态枚举
|
||||
const {
|
||||
SaleOrderStatusArranged, // 已配布
|
||||
SaleOrderStatusWaitingPayment, // 待付款
|
||||
SaleOrderStatusTaking, // 提货中
|
||||
SaleOrderStatusWaitingDelivery, // 待发货
|
||||
SaleOrderStatusWaitingReceipt, // 待收货
|
||||
SaleOrderStatusAlreadyReceipt, // 已收货
|
||||
SaleOrderStatusComplete, // 已完成
|
||||
SaleOrderStatusRefund, // 已退款
|
||||
} = ORDER_STATUS
|
||||
|
||||
const showCode = useMemo(() => {
|
||||
return onShow('code') && [
|
||||
SaleOrderStatusArranged.value,
|
||||
SaleOrderStatusWaitingPayment.value,
|
||||
SaleOrderStatusTaking.value,
|
||||
SaleOrderStatusWaitingDelivery.value,
|
||||
SaleOrderStatusWaitingReceipt.value,
|
||||
SaleOrderStatusAlreadyReceipt.value,
|
||||
SaleOrderStatusComplete.value,
|
||||
SaleOrderStatusRefund.value,
|
||||
].includes(orderObj.status)
|
||||
}, [orderObj.status])
|
||||
|
||||
return (
|
||||
<MovableArea className={styles.movableItem}>
|
||||
{children}
|
||||
@ -102,7 +128,7 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m
|
||||
>
|
||||
<Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} />
|
||||
</MovableView>}
|
||||
{onShow('code') && <CodeSelect orderObj={orderObj} y={screenHeight.code as number} />}
|
||||
{showCode && <CodeSelect orderObj={orderObj} y={screenHeight.code as number} />}
|
||||
<Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} showCard={showCart} onClose={customerClose} />
|
||||
</MovableArea>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user