This commit is contained in:
Net 2025-06-15 21:08:40 +08:00
parent 3cd9db481d
commit cb9a8de242
2 changed files with 23 additions and 6 deletions

View File

@ -66,3 +66,6 @@ export const updateUserApi = async (param: any) => {
export const findJsByPhoneApi = async (param: any) => {
return await get("/api/js/findJsByPhone", param);
};
export const findJsAllByPhoneApi = async (param: any) => {
return await get("/api/js/findJsAllByPhone", param);
};

View File

@ -88,8 +88,12 @@
</template>
<script lang="ts" setup>
import { findJsAllByPhoneApi } from "@/api/system/login";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";
import { imagUrl } from "@/utils";
import { hideLoading, showLoading } from "@/utils/uniapp";
import { set } from "lodash";
import { reactive, ref } from "vue";
interface GridItem {
@ -297,15 +301,25 @@ const getIconBgColor = (index: number) => {
];
return colors[index % colors.length];
};
const { setFile, getFile } = useDataStore();
//
const handleGridItemClick = (item: GridItem) => {
const handleGridItemClick = async (item: GridItem) => {
console.log("Clicked item:", item);
if (item.path) {
uni.navigateTo({ url: item.path });
} else {
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
if (item.text == "教师档案") {
showLoading("加载中...");
const res = await findJsAllByPhoneApi({
phone: getUser.telephone,
});
hideLoading();
setFile(res.result);
}
setTimeout(() => {
if (item.path) {
uni.navigateTo({ url: item.path });
} else {
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
}
}, 200);
};
</script>