提交1
This commit is contained in:
parent
3cd9db481d
commit
cb9a8de242
@ -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);
|
||||||
|
};
|
||||||
|
|||||||
@ -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.text == "教师档案") {
|
||||||
|
showLoading("加载中...");
|
||||||
|
const res = await findJsAllByPhoneApi({
|
||||||
|
phone: getUser.telephone,
|
||||||
|
});
|
||||||
|
hideLoading();
|
||||||
|
setFile(res.result);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
if (item.path) {
|
if (item.path) {
|
||||||
uni.navigateTo({ url: item.path });
|
uni.navigateTo({ url: item.path });
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
|
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
|
||||||
}
|
}
|
||||||
|
}, 200);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user