feat: migrate comprehensive venue module

This commit is contained in:
gqt
2026-06-08 20:54:25 +08:00
parent c9650b0db1
commit 8e1443f7e5
43 changed files with 5017 additions and 0 deletions
@@ -0,0 +1,174 @@
<template>
<view class="order-detail container page-bottom-safe" v-if="order">
<view class="status-card card">
<text class="amount">¥{{ order.amount }}</text>
<text class="badge" :class="statusBadgeClass(order.status)">{{ order.status_label }}</text>
</view>
<view class="card">
<text class="card-title">订单信息</text>
<view class="info-row">
<text>订单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="info-row">
<text>创建时间</text>
<text>{{ formatDateTime(order.created_at) }}</text>
</view>
<view class="info-row">
<text>更新时间</text>
<text>{{ formatDateTime(order.updated_at) }}</text>
</view>
<view v-if="order.expire_at" class="info-row">
<text>支付过期</text>
<text>{{ formatDateTime(order.expire_at) }}</text>
</view>
</view>
<view class="card list-card">
<text class="card-title">支付记录</text>
<view v-if="order.payments.length === 0" class="placeholder">暂无支付记录</view>
<view v-for="payment in order.payments" :key="`${payment.method}-${payment.paid_at}`" class="record-row">
<view>
<text class="record-title">{{ payment.method_label || payment.method }}</text>
<text class="record-time">{{ formatDateTime(payment.paid_at || payment.created_at) }}</text>
</view>
<text class="record-amount">¥{{ payment.amount }}</text>
</view>
</view>
<view class="card list-card">
<text class="card-title">退款记录</text>
<view v-if="order.refunds.length === 0" class="placeholder">暂无退款记录</view>
<view v-for="refund in order.refunds" :key="refund.refund_no" class="record-row">
<view>
<text class="record-title">{{ refund.reason }}</text>
<text class="record-time">{{ formatDateTime(refund.refunded_at) }}</text>
</view>
<text class="record-amount">¥{{ refund.amount }}</text>
</view>
</view>
<view v-if="order.status === 'pending_pay'" class="fixed-action-bar">
<button class="ghost-button action-btn" @tap="closeCurrentOrder">关闭订单</button>
<button class="primary-button action-btn" @tap="goPay">去支付</button>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { orderApi } from '@/modules/comprehensive/api/order'
import { formatDateTime } from '@/modules/comprehensive/utils/date'
import { statusBadgeClass } from '@/modules/comprehensive/utils/status'
const orderId = ref('')
const order = ref(null)
onLoad(async (query) => {
orderId.value = query.id
await loadOrder()
})
const loadOrder = async () => {
order.value = await orderApi.getOrderDetail(orderId.value)
}
const goPay = () => {
uni.navigateTo({ url: `/pages/comprehensive/pay/index?order_id=${order.value.id}` })
}
const closeCurrentOrder = async () => {
await orderApi.closeOrder(order.value.id)
uni.showToast({ title: '订单已关闭', icon: 'none' })
await loadOrder()
}
</script>
<style lang="scss" scoped>
.status-card {
text-align: center;
margin-bottom: $spacing-md;
}
.amount {
display: block;
margin-bottom: $spacing-sm;
color: $text-color-main;
font-size: 64rpx;
font-weight: 900;
}
.card {
margin-bottom: $spacing-md;
}
.card-title {
display: block;
margin-bottom: $spacing-sm;
color: $text-color-main;
font-size: 30rpx;
font-weight: 900;
}
.info-row,
.record-row {
min-height: 70rpx;
display: flex;
align-items: center;
justify-content: space-between;
gap: $spacing-md;
border-bottom: 1rpx solid $bg-color-hover;
}
.info-row:last-child,
.record-row:last-child {
border-bottom: none;
}
.info-row {
color: $text-color-muted;
font-size: 25rpx;
}
.info-row text:last-child {
flex: 1;
color: $text-color-main;
font-weight: 700;
text-align: right;
}
.placeholder {
padding: $spacing-md 0;
color: $text-color-light;
font-size: 24rpx;
}
.record-title,
.record-time {
display: block;
}
.record-title {
color: $text-color-main;
font-size: 26rpx;
font-weight: 800;
}
.record-time {
margin-top: 4rpx;
color: $text-color-muted;
font-size: 22rpx;
}
.record-amount {
color: $text-color-main;
font-size: 28rpx;
font-weight: 900;
}
.action-btn {
flex: 1;
}
</style>