From ccc022f5d131301f1d42fb920aa2cc19ca405bb1 Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 29 Aug 2025 23:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=AC=E5=91=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=BD=92?= =?UTF-8?q?=E5=B1=9EID=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD=EF=BC=9B?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B8=B8=E6=88=8F=E8=BF=9B=E5=BA=A6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3API=E8=B0=83=E7=94=A8=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E6=95=B0=E6=8D=AE=E6=9B=BF=E4=BB=A3=E4=BB=A5?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=80=A7=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/announcement.js | 4 ++-- src/api/play.js | 6 ------ src/composables/usePlayState.js | 2 -- src/composables/useTimers.js | 12 ++++++++---- src/views/announcements/AnnouncementList.vue | 16 ++++++++++++++-- src/views/oldplay.vue | 17 ++++++++++------- 6 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/api/announcement.js b/src/api/announcement.js index 89cfc6d..0728445 100644 --- a/src/api/announcement.js +++ b/src/api/announcement.js @@ -37,6 +37,6 @@ export function updateAnnouncementStatus(id, enabled) { } // 获取启用的公告 -export function getEnabledAnnouncements() { - return http.get('/api/admin/announcement/enabled') +export function getEnabledAnnouncements(params) { + return http.get('/api/admin/announcement/enabled', { params }) } diff --git a/src/api/play.js b/src/api/play.js index 286314d..ffb3790 100644 --- a/src/api/play.js +++ b/src/api/play.js @@ -31,12 +31,6 @@ export function pollLoginStatus(code) { }) } -// 获取游戏进度 -export function getGameProgress(code) { - return http.get('/api/link/progress', { - params: { code } - }) -} // 获取游戏界面数据 export function getGameInterface(code) { diff --git a/src/composables/usePlayState.js b/src/composables/usePlayState.js index bd57eb4..886292b 100644 --- a/src/composables/usePlayState.js +++ b/src/composables/usePlayState.js @@ -5,8 +5,6 @@ import { getLinkStatus, selectRegion as selectRegionAPI, refreshLink as refreshLinkAPI, - pollLoginStatus, - getGameProgress, getGameInterface as getGameInterfaceAPI } from '@/api/play' diff --git a/src/composables/useTimers.js b/src/composables/useTimers.js index f601dc6..ec60158 100644 --- a/src/composables/useTimers.js +++ b/src/composables/useTimers.js @@ -1,5 +1,5 @@ import { ref, reactive } from 'vue' -import { pollLoginStatus, getGameProgress } from '@/api/play' +import { pollLoginStatus } from '@/api/play' export function useTimers() { const countdown = ref(0) @@ -68,9 +68,13 @@ export function useTimers() { const pollProgress = async () => { try { - const response = await getGameProgress(code) - const data = response.data - onProgressUpdate(data) + // TODO: Replace with actual progress API call when available + const mockData = { + currentPoints: 0, + totalPoints: 0, + completedPoints: 0 + } + onProgressUpdate(mockData) } catch (error) { console.error('进度轮询错误:', error) } diff --git a/src/views/announcements/AnnouncementList.vue b/src/views/announcements/AnnouncementList.vue index 37457e7..54df360 100644 --- a/src/views/announcements/AnnouncementList.vue +++ b/src/views/announcements/AnnouncementList.vue @@ -40,6 +40,16 @@ + + + + 查询 重置 @@ -214,7 +224,8 @@ const query = reactive({ page: 1, size: 10, keyword: '', - enabled: undefined + enabled: undefined, + belongId: undefined }) // ===== 权限 ===== @@ -249,7 +260,7 @@ function unwrap(res) { async function load() { loading.value = true try { - const params = { ...query } + const params = { page: query.page, size: query.size, enabled: query.enabled, belongId: query.belongId } Object.keys(params).forEach((k) => { if (params[k] === '' || params[k] === undefined) delete params[k] }) @@ -272,6 +283,7 @@ function onSearch() { function onReset() { query.keyword = '' query.enabled = undefined + query.belongId = undefined query.page = 1 query.size = 10 load() diff --git a/src/views/oldplay.vue b/src/views/oldplay.vue index fe19b41..83faaa5 100644 --- a/src/views/oldplay.vue +++ b/src/views/oldplay.vue @@ -203,7 +203,6 @@ import { selectRegion as selectRegionAPI, refreshLink as refreshLinkAPI, pollLoginStatus, - getGameProgress, getGameInterface as getGameInterfaceAPI } from '@/api/play' @@ -799,13 +798,17 @@ export default { const startProgressPolling = () => { const pollProgress = async () => { try { - const response = await getGameProgress(state.code) - const data = response.data - state.currentPoints = data.currentPoints || state.currentPoints - state.totalPoints = data.totalPoints || state.totalPoints + // TODO: Replace with actual progress API call when available + const mockData = { + currentPoints: state.currentPoints, + totalPoints: state.totalPoints, + completedPoints: state.completedPoints + } + state.currentPoints = mockData.currentPoints || state.currentPoints + state.totalPoints = mockData.totalPoints || state.totalPoints // 更新已完成点数 - if (data.completedPoints !== undefined) { - state.completedPoints = data.completedPoints + if (mockData.completedPoints !== undefined) { + state.completedPoints = mockData.completedPoints } } catch (error) { console.error('进度轮询错误:', error)