Merge branch 'main' of https://git.hn12301.net/xuchao/pingxiangcard
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// xuchao: 萍乡超级玩家卡下单/预支付接口(open-api 渠道)。原为主包 api/order.ts,
|
||||
// 因仅被本分包页面引用导致主包整包扫描告警,迁入分包;与本地 order.ts(/order/* 旧接口)不是同一组接口,勿混用。
|
||||
import { post } from '../../../api/request'
|
||||
import { BASE_URL } from '../../../config'
|
||||
import type { CreateOrderParams, CreateOrderResult, PrepayParams, PrepayResult } from '../../../api/types'
|
||||
|
||||
export function createOrder(params: CreateOrderParams) {
|
||||
return post<CreateOrderResult>(`${BASE_URL}/open-api/pingXiang/createOrder`, params)
|
||||
}
|
||||
|
||||
export function prepay(params: PrepayParams) {
|
||||
return post<PrepayResult>(`${BASE_URL}/open-api/pingXiang/prepay`, params)
|
||||
}
|
||||
@@ -50,7 +50,7 @@ import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
||||
import { post, getToken } from '../../../api/request'
|
||||
import { BASE_URL } from '../../../config'
|
||||
import { useUserStore } from '../../../store/user'
|
||||
import { createOrder, prepay } from '../../../api/order'
|
||||
import { createOrder, prepay } from '../api/pingxiang-order'
|
||||
import type { BannerItem } from '../../../api/types'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -238,9 +238,6 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
|
||||
|
||||
onUnmounted(() => {
|
||||
clearTimer()
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.offUserCaptureScreen()
|
||||
// #endif
|
||||
})
|
||||
|
||||
const records = ref<ReserveRecord[]>([])
|
||||
@@ -303,15 +300,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) || ''
|
||||
|
||||
Reference in New Issue
Block a user