feat: 移除预约记录/详情页防截屏限制,预约日期条支持置灰显示已过预约时间

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-09-04 11:42:21 +08:00
co-authored by Claude Fable 5
parent 08e2f6888b
commit 64ac69db93
3 changed files with 6 additions and 26 deletions
+6 -2
View File
@@ -32,7 +32,7 @@
>
<text class="date-week">{{ d.week }}</text>
<text class="date-day">{{ d.label }}</text>
<text v-if="d.disabled" class="date-stock date-stock--empty">不可约</text>
<text v-if="d.disabled" class="date-stock date-stock--empty">{{ d.expired ? '已过预约时间' : '不可约' }}</text>
<text v-else-if="d.stock == null" class="date-stock">无限库存</text>
<text v-else-if="d.stock >= 50" class="date-stock">可预约</text>
<text v-else-if="d.stock > 0" class="date-stock">余{{ d.stock }}位</text>
@@ -155,6 +155,8 @@ interface DateOption {
cards: CardOption[]
disabled?: boolean
reason?: string
// xuchao: 已过预约截止时间(后端置灰补显的日期,不可点)
expired?: boolean
}
const scenic = ref({ name: '', address: '', hours: '', image: '' })
@@ -269,7 +271,8 @@ onLoad(async (query: any) => {
userIdCard.value = res.userIdCard || ''
bookingNotice.value = Array.isArray(res.bookingNotice) ? res.bookingNotice.map((n: any) => (typeof n === 'string' ? n : n?.content || n?.text || '')).join('<br/>') : (res.bookingNotice || '')
cardModelName.value = res.cardModelName || ''
appointmentDays.value = (res.dates || []).length
// xuchao: 近N日提示不含过截止置灰补显的日期
appointmentDays.value = (res.dates || []).filter((d: any) => !d.expired).length
reserveParams.value = {
scenicId: parseInt(resourceId),
channel: 'Channel_SZH',
@@ -287,6 +290,7 @@ onLoad(async (query: any) => {
cards: d.cards || [],
disabled: d.disabled,
reason: d.reason,
expired: d.expired,
}))
const firstAvailable = dateOptions.value.find(d => d.stock == null || d.stock > 0)
if (firstAvailable) selectedDate.value = firstAvailable.key
-12
View File
@@ -244,9 +244,6 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
onUnmounted(() => {
clearTimer()
// #ifdef MP-WEIXIN
wx.offUserCaptureScreen()
// #endif
})
const records = ref<ReserveRecord[]>([])
@@ -308,15 +305,6 @@ async function fetchRecords(append = false) {
}
onLoad(() => {
// #ifdef MP-WEIXIN
wx.setVisualEffectOnCapture({ visualEffect: 'hidden' })
wx.onUserCaptureScreen(() => {
uni.showToast({ title: '该页面截图无效,请不要截图', icon: 'none' })
if (currentRecord.value) {
fetchCode(currentRecord.value)
}
})
// #endif
fetchRecords()
})
@@ -106,21 +106,9 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
onUnmounted(() => {
clearTimer()
// #ifdef MP-WEIXIN
wx.offUserCaptureScreen()
// #endif
})
onLoad(async (query: any) => {
// #ifdef MP-WEIXIN
wx.setVisualEffectOnCapture({ visualEffect: 'hidden' })
wx.onUserCaptureScreen(() => {
uni.showToast({ title: '该页面截图无效,请不要截图', icon: 'none' })
if (codePopup.value) {
fetchCode()
}
})
// #endif
const appointId = query?.appointId
if (!appointId) return
const phone = (uni.getStorageSync('phone') as string) || ''