Compare commits

...

2 Commits

Author SHA1 Message Date
8b902be603 fix(ticket): 修复水票相关功能显示和交互问题
- 修改订单取消后水票退回提示图标为无图标模式
- 注释掉暂无可用水票时的弹窗提示逻辑
- 调整空状态按钮点击事件,在编辑模式下关闭弹窗而非跳转购买
- 优化下单按钮显示逻辑,区分编辑模式和普通模式的不同行为
- 修复提交按钮文案显示问题,确保编辑模式下显示正确文字
2026-03-11 16:36:22 +08:00
37ab933849 fix(ticket): 修复编辑模式下按钮文本显示问题
- 在无可用票据条件判断中添加编辑模式检查
- 根据编辑模式动态显示按钮文本为"确定修改"或"确定下单"
- 确保编辑模式下购买按钮也显示正确的操作文本
2026-03-11 16:23:24 +08:00
2 changed files with 38 additions and 35 deletions

View File

@@ -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({

View File

@@ -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])
@@ -1109,7 +1109,7 @@ const OrderConfirm = () => {
setTicketPopupVisible(true)
}}
/>
{noUsableTickets && (
{(noUsableTickets && !isEditMode) && (
<Cell
title={<Text className="text-gray-500"></Text>}
description="购买水票后即可在这里直接下单送水"
@@ -1185,8 +1185,11 @@ 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>
</View>
@@ -1268,25 +1271,25 @@ const OrderConfirm = () => {
</View>
</div>
<div className={'buy-btn mx-4'}>
{noUsableTickets ? (
<Button type="primary" size="large" onClick={goBuyTickets}>
</Button>
) : (
<Button
type="success"
size="large"
{noUsableTickets && !isEditMode ? (
<Button type="primary" size="large" onClick={goBuyTickets}>
{isEditMode ? '确定修改' : '确定下单'}
</Button>
) : (
<Button
type="success"
size="large"
loading={submitLoading || deliveryRangeChecking}
disabled={
deliveryRangeChecking ||
!address?.id ||
!addressHasCoords ||
(deliveryRangeCheckedAddressId === address?.id && inDeliveryRange === false) ||
availableTicketTotal <= 0 ||
!canStartOrder
}
onClick={onSubmit}
>
(deliveryRangeCheckedAddressId === address?.id && inDeliveryRange === false) ||
(!isEditMode && availableTicketTotal <= 0) ||
!canStartOrder
}
onClick={onSubmit}
>
{deliveryRangeChecking
? '校验配送范围...'
: (!address?.id
@@ -1295,12 +1298,12 @@ const OrderConfirm = () => {
? '地址缺少定位'
: ((deliveryRangeCheckedAddressId === address?.id && inDeliveryRange === false)
? '不在配送范围'
: (submitLoading ? '提交中...' : '立即提交')
)
)
)
}
</Button>
: (submitLoading ? '提交中...' : (isEditMode ? '确定修改' : '立即提交'))
)
)
)
}
</Button>
)}
</div>
</View>