feat: 课程列表/课程预约详情/会员卡课程详情移除价格显示
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
VITE_ICE_API_BASE_URL=https://venue.test.chatgqt.top
|
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>订单号</text>
|
||||||
<text>{{ booking.order.order_no }}</text>
|
<text>{{ booking.order.order_no }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
|
||||||
<text>订单金额</text>
|
|
||||||
<text>¥{{ booking.order.amount }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text>订单状态</text>
|
<text>订单状态</text>
|
||||||
<text>{{ booking.order.status_label }}</text>
|
<text>{{ booking.order.status_label }}</text>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<block>
|
<block>
|
||||||
<view class="tab-bar">
|
<view class="tab-bar">
|
||||||
<view class="tab-item" :class="{ active: activeTab === 'membership' }" @tap="switchTab('membership')">会员卡</view>
|
<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 class="tab-item" :class="{ active: activeTab === 'tickets' }" @tap="switchTab('tickets')">门票</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -85,7 +84,6 @@
|
|||||||
<text class="meta">{{ item.coach_name }}</text>
|
<text class="meta">{{ item.coach_name }}</text>
|
||||||
<view class="course-bottom">
|
<view class="course-bottom">
|
||||||
<text class="meta">剩余 {{ item.remaining_count }}/{{ item.capacity }}</text>
|
<text class="meta">剩余 {{ item.remaining_count }}/{{ item.capacity }}</text>
|
||||||
<text class="course-price">¥{{ item.price }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -469,12 +467,6 @@ defineExpose({ refresh, loadMore })
|
|||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-price {
|
|
||||||
color: $text-color-main;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 篮球门票 */
|
/* 篮球门票 */
|
||||||
.ticket-section {
|
.ticket-section {
|
||||||
padding: $spacing-md;
|
padding: $spacing-md;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@
|
|||||||
<view class="title-row">
|
<view class="title-row">
|
||||||
<text class="course-title">{{ sessionData.title }}</text>
|
<text class="course-title">{{ sessionData.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="price-row">
|
|
||||||
<text class="price-text">¥{{ sessionData.price }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-card card">
|
<view class="info-card card">
|
||||||
@@ -172,7 +169,6 @@ const confirmBook = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.title-row,
|
.title-row,
|
||||||
.price-row,
|
|
||||||
.info-row {
|
.info-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -188,10 +184,6 @@ const confirmBook = async () => {
|
|||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price-row {
|
|
||||||
margin-top: $spacing-md;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-card,
|
.info-card,
|
||||||
.rich-card {
|
.rich-card {
|
||||||
margin-top: $spacing-md;
|
margin-top: $spacing-md;
|
||||||
|
|||||||
@@ -93,6 +93,8 @@
|
|||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { privateBookingApi } from '@/modules/comprehensive/api/privateBooking'
|
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 HEADER_HEIGHT = 75
|
||||||
const CELL_HEIGHT = 107
|
const CELL_HEIGHT = 107
|
||||||
@@ -100,10 +102,10 @@ const TIME_COL_WIDTH = 128
|
|||||||
const COURT_COL_WIDTH = 149
|
const COURT_COL_WIDTH = 149
|
||||||
|
|
||||||
const typeOptions = [
|
const typeOptions = [
|
||||||
{ label: '羽毛球', value: 'badminton' },
|
{ label: '羽毛球', value: 'badminton' }
|
||||||
{ label: '篮球', value: 'basketball' }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const session = useComprehensiveSessionStore()
|
||||||
const courtType = ref('badminton')
|
const courtType = ref('badminton')
|
||||||
const selectedDate = ref(dayjs().format('YYYY-MM-DD'))
|
const selectedDate = ref(dayjs().format('YYYY-MM-DD'))
|
||||||
const grid = ref(null)
|
const grid = ref(null)
|
||||||
@@ -114,9 +116,11 @@ const now = ref(dayjs())
|
|||||||
let loadRequestId = 0
|
let loadRequestId = 0
|
||||||
|
|
||||||
const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||||
|
const hasPositiveBalance = computed(() => toAmountNumber(session.member?.balance) > 0)
|
||||||
const dateOptions = computed(() => {
|
const dateOptions = computed(() => {
|
||||||
const today = dayjs()
|
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')
|
const d = today.add(i, 'day')
|
||||||
return {
|
return {
|
||||||
label: i === 0 ? '今天' : i === 1 ? '明天' : weekDays[d.day()],
|
label: i === 0 ? '今天' : i === 1 ? '明天' : weekDays[d.day()],
|
||||||
@@ -227,7 +231,7 @@ const selectionAmount = computed(() => {
|
|||||||
return total.toFixed(2)
|
return total.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(loadGrid)
|
onMounted(refresh)
|
||||||
|
|
||||||
async function loadGrid() {
|
async function loadGrid() {
|
||||||
const requestId = ++loadRequestId
|
const requestId = ++loadRequestId
|
||||||
@@ -270,6 +274,7 @@ function getCellClass(courtId, slotIndex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCellPrice(courtId, slotIndex) {
|
function getCellPrice(courtId, slotIndex) {
|
||||||
|
if (cellStatus.value[courtId]?.[slotIndex] !== 'available') return ''
|
||||||
const prices = grid.value?.slot_prices?.[courtId] || []
|
const prices = grid.value?.slot_prices?.[courtId] || []
|
||||||
return prices[slotIndex] || ''
|
return prices[slotIndex] || ''
|
||||||
}
|
}
|
||||||
@@ -353,11 +358,17 @@ function normalizeClock(value) {
|
|||||||
return value.slice(0, 5)
|
return value.slice(0, 5)
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
async function refresh() {
|
||||||
refresh() {
|
await session.init()
|
||||||
now.value = dayjs()
|
if (!hasPositiveBalance.value && selectedDate.value !== dayjs().format('YYYY-MM-DD')) {
|
||||||
loadGrid()
|
selectedDate.value = dayjs().format('YYYY-MM-DD')
|
||||||
}
|
}
|
||||||
|
now.value = dayjs()
|
||||||
|
await loadGrid()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refresh
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -574,19 +585,13 @@ defineExpose({
|
|||||||
background: $bg-color-main;
|
background: $bg-color-main;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-occupied {
|
.cell-occupied,
|
||||||
background: $color-danger-light;
|
.cell-past,
|
||||||
}
|
.cell-locked,
|
||||||
|
.cell-no_price {
|
||||||
.cell-past {
|
|
||||||
background: $bg-color-hover;
|
background: $bg-color-hover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-locked {
|
|
||||||
background: $bg-color-hover;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cell-locked::after {
|
.cell-locked::after {
|
||||||
content: '锁';
|
content: '锁';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -598,8 +603,8 @@ defineExpose({
|
|||||||
color: $text-color-light;
|
color: $text-color-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-no_price {
|
.cell-locked {
|
||||||
background: $bg-color-hover;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-selected {
|
.cell-selected {
|
||||||
|
|||||||
Reference in New Issue
Block a user