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