feat(theme-4): PC 列表详情弹窗、实心面板与收件箱样式修复
投注/资金/充值/返水列表点击改为海军蓝弹窗,深链 query 自动打开;修复冻结字段 i18n 与悬浮客服按钮过白问题。
This commit is contained in:
@@ -1,18 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onActivated } from 'vue';
|
||||
import { ref, onMounted, onActivated, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import Pagination from '../../components/desktop/Pagination.vue';
|
||||
import DesktopBetDetailModal from '../../components/desktop/DesktopBetDetailModal.vue';
|
||||
import { type BetHistoryItem } from '../../components/BetHistoryCard.vue';
|
||||
import { useOnLocaleChange } from '../../composables/useOnLocaleChange';
|
||||
|
||||
const COL_COUNT = 8;
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const detailModalVisible = ref(false);
|
||||
const detailBetNo = ref<string | null>(null);
|
||||
|
||||
function openDetail(betNo: string) {
|
||||
detailBetNo.value = betNo;
|
||||
detailModalVisible.value = true;
|
||||
}
|
||||
|
||||
function openDetailFromQuery() {
|
||||
const betNo = route.query.betNo;
|
||||
if (typeof betNo === 'string' && betNo) {
|
||||
openDetail(betNo);
|
||||
const { betNo: _removed, ...rest } = route.query;
|
||||
void router.replace({ path: route.path, query: rest });
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => route.query.betNo, openDetailFromQuery);
|
||||
watch(detailModalVisible, (visible) => {
|
||||
if (!visible) detailBetNo.value = null;
|
||||
});
|
||||
|
||||
const items = ref<BetHistoryItem[]>([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
@@ -62,7 +86,10 @@ useOnLocaleChange(() => {
|
||||
});
|
||||
|
||||
onActivated(() => { void loadPage(page.value); });
|
||||
onMounted(() => { void loadPage(1); });
|
||||
onMounted(() => {
|
||||
void loadPage(1);
|
||||
openDetailFromQuery();
|
||||
});
|
||||
|
||||
function statusClass(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
@@ -154,7 +181,7 @@ function statusLabel(status: string) {
|
||||
v-for="bet in items"
|
||||
:key="bet.betNo"
|
||||
class="hover-row clickable-row"
|
||||
@click="router.push(`/bets/${bet.betNo}`)"
|
||||
@click="openDetail(bet.betNo)"
|
||||
>
|
||||
<td class="id-cell">{{ bet.betNo }}</td>
|
||||
<td>{{ bet.matchTitle || '-' }}</td>
|
||||
@@ -187,6 +214,8 @@ function statusLabel(status: string) {
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<DesktopBetDetailModal v-model:visible="detailModalVisible" :bet-no="detailBetNo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user