fix(ticket): 修复水票相关功能显示和交互问题
- 修改订单取消后水票退回提示图标为无图标模式 - 注释掉暂无可用水票时的弹窗提示逻辑 - 调整空状态按钮点击事件,在编辑模式下关闭弹窗而非跳转购买 - 优化下单按钮显示逻辑,区分编辑模式和普通模式的不同行为 - 修复提交按钮文案显示问题,确保编辑模式下显示正确文字
This commit is contained in:
@@ -460,7 +460,7 @@ const UserTicketList = () => {
|
||||
}
|
||||
try {
|
||||
await rollbackUserTicketAfterOrderCancel(order, beforeTicket);
|
||||
Taro.showToast({ title: '订单已取消,水票已退回', icon: 'success' });
|
||||
Taro.showToast({ title: '订单已取消,水票已退回', icon: 'none' });
|
||||
} catch (e) {
|
||||
console.error('取消订单后退回水票失败:', e);
|
||||
await Taro.showModal({
|
||||
|
||||
@@ -918,17 +918,17 @@ const OrderConfirm = () => {
|
||||
if (noTicketPromptedRef.current) return
|
||||
noTicketPromptedRef.current = true
|
||||
|
||||
;(async () => {
|
||||
const r = await Taro.showModal({
|
||||
title: '暂无可用水票',
|
||||
content: '您当前没有可用水票,购买后再来下单更方便。',
|
||||
confirmText: '去购买',
|
||||
cancelText: '暂不'
|
||||
})
|
||||
if (r.confirm) {
|
||||
await goBuyTickets()
|
||||
}
|
||||
})()
|
||||
// ;(async () => {
|
||||
// const r = await Taro.showModal({
|
||||
// title: '暂无可用水票',
|
||||
// content: '您当前没有可用水票,购买后再来下单更方便。',
|
||||
// confirmText: '去购买',
|
||||
// cancelText: '暂不'
|
||||
// })
|
||||
// if (r.confirm) {
|
||||
// await goBuyTickets()
|
||||
// }
|
||||
// })()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [noUsableTickets, isEditMode])
|
||||
|
||||
@@ -1185,7 +1185,10 @@ const OrderConfirm = () => {
|
||||
<View className="py-10 text-center">
|
||||
<Empty description="暂无可用水票" />
|
||||
<View className="mt-4 flex justify-center">
|
||||
<Button type="primary" onClick={goBuyTickets}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={isEditMode ? () => setTicketPopupVisible(false) : goBuyTickets}
|
||||
>
|
||||
{isEditMode ? '确定修改' : '确定下单'}
|
||||
</Button>
|
||||
</View>
|
||||
@@ -1268,7 +1271,7 @@ const OrderConfirm = () => {
|
||||
</View>
|
||||
</div>
|
||||
<div className={'buy-btn mx-4'}>
|
||||
{noUsableTickets ? (
|
||||
{noUsableTickets && !isEditMode ? (
|
||||
<Button type="primary" size="large" onClick={goBuyTickets}>
|
||||
{isEditMode ? '确定修改' : '确定下单'}
|
||||
</Button>
|
||||
@@ -1282,7 +1285,7 @@ const OrderConfirm = () => {
|
||||
!address?.id ||
|
||||
!addressHasCoords ||
|
||||
(deliveryRangeCheckedAddressId === address?.id && inDeliveryRange === false) ||
|
||||
availableTicketTotal <= 0 ||
|
||||
(!isEditMode && availableTicketTotal <= 0) ||
|
||||
!canStartOrder
|
||||
}
|
||||
onClick={onSubmit}
|
||||
@@ -1295,7 +1298,7 @@ const OrderConfirm = () => {
|
||||
? '地址缺少定位'
|
||||
: ((deliveryRangeCheckedAddressId === address?.id && inDeliveryRange === false)
|
||||
? '不在配送范围'
|
||||
: (submitLoading ? '提交中...' : '立即提交')
|
||||
: (submitLoading ? '提交中...' : (isEditMode ? '确定修改' : '立即提交'))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user