调整抢课的跳转

This commit is contained in:
ywyonui 2025-09-02 23:10:03 +08:00
parent ea059d2a80
commit 7e104cfbbb
3 changed files with 19 additions and 1 deletions

View File

@ -97,3 +97,12 @@ export const xkqddeleteApi = async (params: any) => {
export const xkkclxFindAllApi = async () => { export const xkkclxFindAllApi = async () => {
return await get("/api/xkkclx/findByXkkclx"); return await get("/api/xkkclx/findByXkkclx");
}; };
/**
*
* @param params
* @returns
*/
export const getXkkcDetailByIdApi = async (id: string) => {
return await get("/api/xkkc/getXkkcDetailById?id=" + id);
};

View File

@ -181,6 +181,7 @@ const submit = debounce(async () => {
title: error.message || "报名失败", title: error.message || "报名失败",
icon: "none", icon: "none",
}); });
PageUtils.toHome(xklxId.value);
} }
}); });

View File

@ -1,6 +1,6 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { jsFindByIdApi } from "@/api/base/jsApi"; import { jsFindByIdApi } from "@/api/base/jsApi";
import { xkkclxFindAllApi } from "@/api/base/xkApi"; import { xkkclxFindAllApi, getXkkcDetailByIdApi } from "@/api/base/xkApi";
interface CommonState { interface CommonState {
data: any; data: any;
@ -35,6 +35,14 @@ export const useCommonStore = defineStore({
} }
return Promise.resolve(this.data.xkkcLx); return Promise.resolve(this.data.xkkcLx);
}, },
async getXkkcDetailByIdApi(id: string) : Promise<any> {
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: { persist: {
enabled: true, enabled: true,