feat: 课程列表/课程预约详情/会员卡课程详情移除价格显示
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
VITE_ICE_API_BASE_URL=https://venue.test.chatgqt.top
|
||||
VITE_COMPREHENSIVE_API_BASE_URL=https://8002.frp.chatgqt.top
|
||||
VITE_COMPREHENSIVE_API_BASE_URL=https://venue2.test.chatgqt.top
|
||||
@@ -20,10 +20,6 @@
|
||||
<text>订单号</text>
|
||||
<text>{{ booking.order.order_no }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text>订单金额</text>
|
||||
<text>¥{{ booking.order.amount }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text>订单状态</text>
|
||||
<text>{{ booking.order.status_label }}</text>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<block>
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item" :class="{ active: activeTab === 'membership' }" @tap="switchTab('membership')">会员卡</view>
|
||||
<view class="tab-item" :class="{ active: activeTab === 'group' }" @tap="switchTab('group')">团课</view>
|
||||
<view class="tab-item" :class="{ active: activeTab === 'tickets' }" @tap="switchTab('tickets')">门票</view>
|
||||
</view>
|
||||
|
||||
@@ -85,7 +84,6 @@
|
||||
<text class="meta">{{ item.coach_name }}</text>
|
||||
<view class="course-bottom">
|
||||
<text class="meta">剩余 {{ item.remaining_count }}/{{ item.capacity }}</text>
|
||||
<text class="course-price">¥{{ item.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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;
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<view class="title-row">
|
||||
<text class="course-title">{{ sessionData.title }}</text>
|
||||
</view>
|
||||
<view class="price-row">
|
||||
<text class="price-text">¥{{ sessionData.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-card card">
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user