feat: 移除预约记录/详情页防截屏限制,预约日期条支持置灰显示已过预约时间
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
08e2f6888b
commit
64ac69db93
@@ -32,7 +32,7 @@
|
|||||||
>
|
>
|
||||||
<text class="date-week">{{ d.week }}</text>
|
<text class="date-week">{{ d.week }}</text>
|
||||||
<text class="date-day">{{ d.label }}</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 == null" class="date-stock">无限库存</text>
|
||||||
<text v-else-if="d.stock >= 50" 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>
|
<text v-else-if="d.stock > 0" class="date-stock">余{{ d.stock }}位</text>
|
||||||
@@ -155,6 +155,8 @@ interface DateOption {
|
|||||||
cards: CardOption[]
|
cards: CardOption[]
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
reason?: string
|
reason?: string
|
||||||
|
// xuchao: 已过预约截止时间(后端置灰补显的日期,不可点)
|
||||||
|
expired?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const scenic = ref({ name: '', address: '', hours: '', image: '' })
|
const scenic = ref({ name: '', address: '', hours: '', image: '' })
|
||||||
@@ -269,7 +271,8 @@ onLoad(async (query: any) => {
|
|||||||
userIdCard.value = res.userIdCard || ''
|
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 || '')
|
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 || ''
|
cardModelName.value = res.cardModelName || ''
|
||||||
appointmentDays.value = (res.dates || []).length
|
// xuchao: 近N日提示不含过截止置灰补显的日期
|
||||||
|
appointmentDays.value = (res.dates || []).filter((d: any) => !d.expired).length
|
||||||
reserveParams.value = {
|
reserveParams.value = {
|
||||||
scenicId: parseInt(resourceId),
|
scenicId: parseInt(resourceId),
|
||||||
channel: 'Channel_SZH',
|
channel: 'Channel_SZH',
|
||||||
@@ -287,6 +290,7 @@ onLoad(async (query: any) => {
|
|||||||
cards: d.cards || [],
|
cards: d.cards || [],
|
||||||
disabled: d.disabled,
|
disabled: d.disabled,
|
||||||
reason: d.reason,
|
reason: d.reason,
|
||||||
|
expired: d.expired,
|
||||||
}))
|
}))
|
||||||
const firstAvailable = dateOptions.value.find(d => d.stock == null || d.stock > 0)
|
const firstAvailable = dateOptions.value.find(d => d.stock == null || d.stock > 0)
|
||||||
if (firstAvailable) selectedDate.value = firstAvailable.key
|
if (firstAvailable) selectedDate.value = firstAvailable.key
|
||||||
|
|||||||
@@ -244,9 +244,6 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearTimer()
|
clearTimer()
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.offUserCaptureScreen()
|
|
||||||
// #endif
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const records = ref<ReserveRecord[]>([])
|
const records = ref<ReserveRecord[]>([])
|
||||||
@@ -308,15 +305,6 @@ async function fetchRecords(append = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.setVisualEffectOnCapture({ visualEffect: 'hidden' })
|
|
||||||
wx.onUserCaptureScreen(() => {
|
|
||||||
uni.showToast({ title: '该页面截图无效,请不要截图', icon: 'none' })
|
|
||||||
if (currentRecord.value) {
|
|
||||||
fetchCode(currentRecord.value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
fetchRecords()
|
fetchRecords()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -106,21 +106,9 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearTimer()
|
clearTimer()
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.offUserCaptureScreen()
|
|
||||||
// #endif
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(async (query: any) => {
|
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
|
const appointId = query?.appointId
|
||||||
if (!appointId) return
|
if (!appointId) return
|
||||||
const phone = (uni.getStorageSync('phone') as string) || ''
|
const phone = (uni.getStorageSync('phone') as string) || ''
|
||||||
|
|||||||
Reference in New Issue
Block a user