🎈 perf(ID1000823客服窗口优化):

This commit is contained in:
czm 2022-12-14 17:15:07 +08:00
parent 6b73799112
commit 9d03caee74
4 changed files with 10 additions and 10 deletions

View File

@ -16,11 +16,11 @@ interface param {
children?: ReactElement | null children?: ReactElement | null
onShopClick?: () => void onShopClick?: () => void
showList?: ShowStatus[] showList?: ShowStatus[]
messageTitle: string messageTitle?: string
messagePath: string messagePath?: string
showCart: false|true showCart?: false|true
} }
const MoveBtn = ({ children = null, onShopClick, showList = [], messageTitle = '', messagePath = '', showCart }: param) => { const MoveBtn = ({ children = null, onShopClick, showList = [], messageTitle = '', messagePath = '', showCart = false }: param) => {
const userInfo = useSelector(state => state.userInfo) const userInfo = useSelector(state => state.userInfo)
// 获取购物车数据数量 // 获取购物车数据数量
const { getShopCount, commonData } = useCommonData() const { getShopCount, commonData } = useCommonData()
@ -82,7 +82,7 @@ const MoveBtn = ({ children = null, onShopClick, showList = [], messageTitle = '
</MovableView>} </MovableView>}
{onShow('order') && <MovableView {onShow('order') && <MovableView
onClick={() => set_customer_service_show(true) } onClick={() => set_customer_service_show(true) }
className={styles.moveBtn} className={classnames(styles.moveBtn, styles.no_bg_moveBtn)}
direction="all" direction="all"
inertia inertia
x="630rpx" x="630rpx"
@ -92,7 +92,7 @@ const MoveBtn = ({ children = null, onShopClick, showList = [], messageTitle = '
</MovableView>} </MovableView>}
{onShow('customer') && <MovableView {onShow('customer') && <MovableView
onClick={onPhone} onClick={onPhone}
className={styles.moveBtn} className={classnames(styles.moveBtn, styles.no_bg_moveBtn)}
direction="all" direction="all"
inertia inertia
x="630rpx" x="630rpx"
@ -100,7 +100,7 @@ const MoveBtn = ({ children = null, onShopClick, showList = [], messageTitle = '
> >
<Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} /> <Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} />
</MovableView>} </MovableView>}
<Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} onClose={customerClose} /> <Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} showCard={showCart} onClose={customerClose} />
</MovableArea> </MovableArea>
) )
} }

View File

@ -95,7 +95,7 @@ const Index = () => {
categoryList() categoryList()
}, []) }, [])
return ( return (
<MoveBtn showList={['shop']} onClick={() => setShowShopCart(!showShopCart)}> <MoveBtn showList={['shop']} onShopClick={() => setShowShopCart(!showShopCart)}>
<View className={styles.main}> <View className={styles.main}>
<View className={styles.header}> <View className={styles.header}>
<View className={styles.search}> <View className={styles.search}>

View File

@ -287,7 +287,7 @@ const Order = () => {
[orderDetail], [orderDetail],
) )
return ( return (
<MoveBtn showList={['order']}> <MoveBtn showList={['order']} messageTitle={orderDetail?.order_no} messagePath={`/pages/order/index?id=${orderDetail?.id}`} showCart>
<View className={styles.order_main}> <View className={styles.order_main}>
{(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && <OrderState orderInfo={orderDetail} />) || ( {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && <OrderState orderInfo={orderDetail} />) || (
<AdvanceOrderState orderInfo={orderDetail} onRefresh={refresh} /> <AdvanceOrderState orderInfo={orderDetail} onRefresh={refresh} />

View File

@ -189,7 +189,7 @@ const SalesAfter = () => {
if (orderDetail) { formatData() } if (orderDetail) { formatData() }
}, [orderDetail]) }, [orderDetail])
return ( return (
<MoveBtn showList={['customer']}> <MoveBtn showList={['order']} messageTitle={orderDetail?.return_order_no} messagePath={`/pages/salesAfter/index?id=${orderDetail?.id}`} showCart>
<View className={styles.order_main}> <View className={styles.order_main}>
<OrderState orderInfo={orderDetail} /> <OrderState orderInfo={orderDetail} />
<AddressInfoDetail orderInfo={orderDetail} onLogistics={onShowLogistics} /> <AddressInfoDetail orderInfo={orderDetail} onLogistics={onShowLogistics} />