From 7e104cfbbb02e382adab8c7021baccb63b9181ab Mon Sep 17 00:00:00 2001 From: ywyonui Date: Tue, 2 Sep 2025 23:10:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8A=A2=E8=AF=BE=E7=9A=84?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/xkApi.ts | 9 +++++++++ src/pages/base/xk/qk/index.vue | 1 + src/store/modules/common.ts | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/api/base/xkApi.ts b/src/api/base/xkApi.ts index 09bacf0..1fcce71 100644 --- a/src/api/base/xkApi.ts +++ b/src/api/base/xkApi.ts @@ -97,3 +97,12 @@ export const xkqddeleteApi = async (params: any) => { export const xkkclxFindAllApi = async () => { return await get("/api/xkkclx/findByXkkclx"); }; + +/** + * 获取课程详情 + * @param params + * @returns + */ +export const getXkkcDetailByIdApi = async (id: string) => { + return await get("/api/xkkc/getXkkcDetailById?id=" + id); +}; \ No newline at end of file diff --git a/src/pages/base/xk/qk/index.vue b/src/pages/base/xk/qk/index.vue index c9a8248..6267af0 100644 --- a/src/pages/base/xk/qk/index.vue +++ b/src/pages/base/xk/qk/index.vue @@ -181,6 +181,7 @@ const submit = debounce(async () => { title: error.message || "报名失败", icon: "none", }); + PageUtils.toHome(xklxId.value); } }); diff --git a/src/store/modules/common.ts b/src/store/modules/common.ts index 5421ae9..df5d548 100644 --- a/src/store/modules/common.ts +++ b/src/store/modules/common.ts @@ -1,6 +1,6 @@ import { defineStore } from "pinia"; import { jsFindByIdApi } from "@/api/base/jsApi"; -import { xkkclxFindAllApi } from "@/api/base/xkApi"; +import { xkkclxFindAllApi, getXkkcDetailByIdApi } from "@/api/base/xkApi"; interface CommonState { data: any; @@ -35,6 +35,14 @@ export const useCommonStore = defineStore({ } return Promise.resolve(this.data.xkkcLx); }, + async getXkkcDetailByIdApi(id: string) : Promise { + if (!this.data.xkkc || !this.data.xkkc[id]) { + this.data.xkkc = this.data.xkkc || {}; + const res = await getXkkcDetailByIdApi(id); + console.log(res); + } + return Promise.resolve(this.data.xkkc[id]); + }, }, persist: { enabled: true,