11
This commit is contained in:
@@ -27,12 +27,10 @@ const data = ref<Array<any>>([]);
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
console.log('跳转到第', page, '页');
|
||||
};
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
var result = await PubService.GetNoticeData(currentPage.value, 10);
|
||||
console.log(result);
|
||||
const BindData = async (): Promise<void> => {
|
||||
var result = await PubService.GetNoticeData(currentPage.value, 10);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
totalPages.value = result.data.total;
|
||||
|
||||
@@ -1 +1,51 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="content">
|
||||
<Abar href="/news/">官方公告</Abar>>详情
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="common">
|
||||
[标题]:<strong>{{ noticeData.title }}</strong>
|
||||
</div>
|
||||
<div class="common">
|
||||
[时间]: {{noticeData.addTime}}
|
||||
</div>
|
||||
<div class="common" v-html="noticeData.sign"></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Abar href="/news/">返回公告列表</Abar>
|
||||
</div>
|
||||
<Abar href="/">返回游戏首页</Abar>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.empty,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
let noticeData = ref<any>({});
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
var noticeId = PageExtend.QueryString("id");
|
||||
var result = await PubService.GetNoticeInfo(noticeId);
|
||||
if (result.code == 0) {
|
||||
noticeData.value = result.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialogEvent("提示", "公告不存在!", () => {
|
||||
PageExtend.Redirect("/news/");
|
||||
}, "我知道了");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user