From d07356e9f1ff7b86152b197c40d8f662349ec178 Mon Sep 17 00:00:00 2001 From: gqt <3217233537@qq.com> Date: Mon, 27 Jul 2026 12:13:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8/?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A2=84=E7=BA=A6=E8=AF=A6=E6=83=85/?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=8D=A1=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/.env | 2 +- .../comprehensive/bookings/course-detail.vue | 4 -- .../src/pages/comprehensive/courses/index.vue | 8 ---- .../courses/membership-detail.vue | 8 ---- .../src/pages/comprehensive/private/index.vue | 45 ++++++++++--------- 5 files changed, 26 insertions(+), 41 deletions(-) diff --git a/miniprogram/.env b/miniprogram/.env index e405b71..7fda9c6 100644 --- a/miniprogram/.env +++ b/miniprogram/.env @@ -1,2 +1,2 @@ VITE_ICE_API_BASE_URL=https://venue.test.chatgqt.top -VITE_COMPREHENSIVE_API_BASE_URL=https://8002.frp.chatgqt.top \ No newline at end of file +VITE_COMPREHENSIVE_API_BASE_URL=https://venue2.test.chatgqt.top \ No newline at end of file diff --git a/miniprogram/src/pages/comprehensive/bookings/course-detail.vue b/miniprogram/src/pages/comprehensive/bookings/course-detail.vue index 7b7ef7a..709d3c7 100644 --- a/miniprogram/src/pages/comprehensive/bookings/course-detail.vue +++ b/miniprogram/src/pages/comprehensive/bookings/course-detail.vue @@ -20,10 +20,6 @@ 订单号 {{ booking.order.order_no }} - - 订单金额 - ¥{{ booking.order.amount }} - 订单状态 {{ booking.order.status_label }} diff --git a/miniprogram/src/pages/comprehensive/courses/index.vue b/miniprogram/src/pages/comprehensive/courses/index.vue index 859b448..f984848 100644 --- a/miniprogram/src/pages/comprehensive/courses/index.vue +++ b/miniprogram/src/pages/comprehensive/courses/index.vue @@ -3,7 +3,6 @@ 会员卡 - 团课 门票 @@ -85,7 +84,6 @@ {{ item.coach_name }} 剩余 {{ item.remaining_count }}/{{ item.capacity }} - ¥{{ item.price }} @@ -469,12 +467,6 @@ defineExpose({ refresh, loadMore }) margin-top: 6rpx; } -.course-price { - color: $text-color-main; - font-size: 28rpx; - font-weight: 900; -} - /* 篮球门票 */ .ticket-section { padding: $spacing-md; diff --git a/miniprogram/src/pages/comprehensive/courses/membership-detail.vue b/miniprogram/src/pages/comprehensive/courses/membership-detail.vue index e6ff895..ee9ad1b 100644 --- a/miniprogram/src/pages/comprehensive/courses/membership-detail.vue +++ b/miniprogram/src/pages/comprehensive/courses/membership-detail.vue @@ -6,9 +6,6 @@ {{ sessionData.title }} - - ¥{{ sessionData.price }} - @@ -172,7 +169,6 @@ const confirmBook = async () => { } .title-row, -.price-row, .info-row { display: flex; align-items: center; @@ -188,10 +184,6 @@ const confirmBook = async () => { line-height: 1.3; } -.price-row { - margin-top: $spacing-md; -} - .info-card, .rich-card { margin-top: $spacing-md; diff --git a/miniprogram/src/pages/comprehensive/private/index.vue b/miniprogram/src/pages/comprehensive/private/index.vue index e944762..2442350 100644 --- a/miniprogram/src/pages/comprehensive/private/index.vue +++ b/miniprogram/src/pages/comprehensive/private/index.vue @@ -93,6 +93,8 @@ import { computed, onMounted, ref } from 'vue' import dayjs from 'dayjs' import { privateBookingApi } from '@/modules/comprehensive/api/privateBooking' +import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session' +import { toAmountNumber } from '@/modules/comprehensive/utils/money' const HEADER_HEIGHT = 75 const CELL_HEIGHT = 107 @@ -100,10 +102,10 @@ const TIME_COL_WIDTH = 128 const COURT_COL_WIDTH = 149 const typeOptions = [ - { label: '羽毛球', value: 'badminton' }, - { label: '篮球', value: 'basketball' } + { label: '羽毛球', value: 'badminton' } ] +const session = useComprehensiveSessionStore() const courtType = ref('badminton') const selectedDate = ref(dayjs().format('YYYY-MM-DD')) const grid = ref(null) @@ -114,9 +116,11 @@ const now = ref(dayjs()) let loadRequestId = 0 const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'] +const hasPositiveBalance = computed(() => toAmountNumber(session.member?.balance) > 0) const dateOptions = computed(() => { const today = dayjs() - return Array.from({ length: 7 }).map((_, i) => { + const dateCount = hasPositiveBalance.value ? 7 : 1 + return Array.from({ length: dateCount }).map((_, i) => { const d = today.add(i, 'day') return { label: i === 0 ? '今天' : i === 1 ? '明天' : weekDays[d.day()], @@ -227,7 +231,7 @@ const selectionAmount = computed(() => { return total.toFixed(2) }) -onMounted(loadGrid) +onMounted(refresh) async function loadGrid() { const requestId = ++loadRequestId @@ -270,6 +274,7 @@ function getCellClass(courtId, slotIndex) { } function getCellPrice(courtId, slotIndex) { + if (cellStatus.value[courtId]?.[slotIndex] !== 'available') return '' const prices = grid.value?.slot_prices?.[courtId] || [] return prices[slotIndex] || '' } @@ -353,11 +358,17 @@ function normalizeClock(value) { return value.slice(0, 5) } -defineExpose({ - refresh() { - now.value = dayjs() - loadGrid() +async function refresh() { + await session.init() + if (!hasPositiveBalance.value && selectedDate.value !== dayjs().format('YYYY-MM-DD')) { + selectedDate.value = dayjs().format('YYYY-MM-DD') } + now.value = dayjs() + await loadGrid() +} + +defineExpose({ + refresh }) @@ -574,19 +585,13 @@ defineExpose({ background: $bg-color-main; } -.cell-occupied { - background: $color-danger-light; -} - -.cell-past { +.cell-occupied, +.cell-past, +.cell-locked, +.cell-no_price { background: $bg-color-hover; } -.cell-locked { - background: $bg-color-hover; - position: relative; -} - .cell-locked::after { content: '锁'; position: absolute; @@ -598,8 +603,8 @@ defineExpose({ color: $text-color-light; } -.cell-no_price { - background: $bg-color-hover; +.cell-locked { + position: relative; } .cell-selected {