✨ feat(码单优化调整):
This commit is contained in:
parent
16464f482a
commit
6ad9ecb830
@ -8,7 +8,7 @@
|
|||||||
width: 306px;
|
width: 306px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #337fff;
|
color: #337fff;
|
||||||
top: -290px;
|
transform: translateY(-100%);
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import IconFont from '../iconfont/iconfont'
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { goLink } from '@/common/common'
|
import { goLink } from '@/common/common'
|
||||||
import ViewCodeList from '@/components/viewCodeList/index'
|
import ViewCodeList from '@/components/viewCodeList/index'
|
||||||
|
import { GetCustomCodeDetailApi } from '@/api/codeManage'
|
||||||
|
|
||||||
interface param {
|
interface param {
|
||||||
y: number
|
y: number
|
||||||
@ -28,15 +29,50 @@ export default ({ y, orderObj = {} }: param) => {
|
|||||||
|
|
||||||
const [showPopup, setshowPopup] = useState(false)
|
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 (<>
|
return (<>
|
||||||
{showCode && <View className={styles.mask} catchMove onClick={() => setShowCode(!showCode)}></View>}
|
{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`}>
|
<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'])}>
|
{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} />
|
<IconFont name="icon-yuanshimadanyulan" size={46} />
|
||||||
<Text>原始码单预览</Text>
|
<Text>原始码单预览</Text>
|
||||||
</View>
|
</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} />
|
<IconFont name="icon-zidingyimadanyulan" size={46} />
|
||||||
<Text>自定义码单预览</Text>
|
<Text>自定义码单预览</Text>
|
||||||
</View>}
|
</View>}
|
||||||
@ -47,7 +83,7 @@ export default ({ y, orderObj = {} }: param) => {
|
|||||||
</View>}
|
</View>}
|
||||||
<View className={styles['code_list--text']} onClick={() => setShowCode(!showCode)}>码单</View>
|
<View className={styles['code_list--text']} onClick={() => setShowCode(!showCode)}>码单</View>
|
||||||
</MovableView>
|
</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 { Button, Image, MovableArea, MovableView, View } from '@tarojs/components'
|
||||||
import Taro, { useDidShow, useReady, useRouter } from '@tarojs/taro'
|
import Taro, { useDidShow, useReady, useRouter } from '@tarojs/taro'
|
||||||
import type { ReactElement } from 'react'
|
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 classnames from 'classnames'
|
||||||
import Customer from '../customer'
|
import Customer from '../customer'
|
||||||
import CodeSelect from '../codeSelect'
|
import CodeSelect from '../codeSelect'
|
||||||
@ -11,6 +11,7 @@ import useCommonData from '@/use/useCommonData'
|
|||||||
import { useSelector } from '@/reducers/hooks'
|
import { useSelector } from '@/reducers/hooks'
|
||||||
import { alert } from '@/common/common'
|
import { alert } from '@/common/common'
|
||||||
import { formatImgUrl } from '@/common/fotmat'
|
import { formatImgUrl } from '@/common/fotmat'
|
||||||
|
import { ORDER_STATUS } from '@/common/enum'
|
||||||
|
|
||||||
type ShowStatus = 'shop'|'customer'|'order'|'code'
|
type ShowStatus = 'shop'|'customer'|'order'|'code'
|
||||||
interface param {
|
interface param {
|
||||||
@ -68,6 +69,31 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m
|
|||||||
set_customer_service_show(false)
|
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 (
|
return (
|
||||||
<MovableArea className={styles.movableItem}>
|
<MovableArea className={styles.movableItem}>
|
||||||
{children}
|
{children}
|
||||||
@ -102,7 +128,7 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m
|
|||||||
>
|
>
|
||||||
<Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} />
|
<Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} />
|
||||||
</MovableView>}
|
</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} />
|
<Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} showCard={showCart} onClose={customerClose} />
|
||||||
</MovableArea>
|
</MovableArea>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user