|
@@ -53,14 +53,16 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import navContainer from "@/businessComponents/navContainer"
|
|
import navContainer from "@/businessComponents/navContainer"
|
|
|
import { useRouter } from "vue-router"
|
|
import { useRouter } from "vue-router"
|
|
|
-import { ref, computed } from "vue"
|
|
|
|
|
|
|
+import { ref, computed, shallowRef } from "vue"
|
|
|
import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
|
import userStore from "@/store/modules/user"
|
|
import userStore from "@/store/modules/user"
|
|
|
import curriculum_gym from "./components/curriculum/curriculum_gym.vue"
|
|
import curriculum_gym from "./components/curriculum/curriculum_gym.vue"
|
|
|
import curriculum_gyt from "./components/curriculum/curriculum_gyt.vue"
|
|
import curriculum_gyt from "./components/curriculum/curriculum_gyt.vue"
|
|
|
import { getRemind_gyt, getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
import { getRemind_gyt, getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
|
-import { httpAjax } from "@/plugin/httpAjax"
|
|
|
|
|
|
|
+import { httpAjax, httpAjaxErrMsg } from "@/plugin/httpAjax"
|
|
|
import { format } from "@/libs/tools"
|
|
import { format } from "@/libs/tools"
|
|
|
|
|
+import { queryTree_klx } from "@/api/cloudPractice.api"
|
|
|
|
|
+import user from "@/store/modules/user"
|
|
|
|
|
|
|
|
const userStoreHook = userStore()
|
|
const userStoreHook = userStore()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -181,12 +183,15 @@ const classDataLoading = ref(true)
|
|
|
const isEmptyClassData = computed(() => {
|
|
const isEmptyClassData = computed(() => {
|
|
|
return !Object.keys(classData.value).length
|
|
return !Object.keys(classData.value).length
|
|
|
})
|
|
})
|
|
|
|
|
+const useAlbumList = shallowRef<any[]>([])
|
|
|
|
|
|
|
|
// 现在酷乐秀没有课表功能
|
|
// 现在酷乐秀没有课表功能
|
|
|
if (userStoreHook.roles !== "KLX") {
|
|
if (userStoreHook.roles !== "KLX") {
|
|
|
handleClassData()
|
|
handleClassData()
|
|
|
} else {
|
|
} else {
|
|
|
classDataLoading.value = false
|
|
classDataLoading.value = false
|
|
|
|
|
+ // 获取酷乐秀专辑列表 - 为了判断【云练习】、【云课堂】是否能操作
|
|
|
|
|
+ getKlxAlbumList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleClassData() {
|
|
function handleClassData() {
|
|
@@ -210,13 +215,24 @@ function handleClassData() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleRouter(url?: string) {
|
|
function handleRouter(url?: string) {
|
|
|
- url
|
|
|
|
|
- ? router.push(url)
|
|
|
|
|
- : useDialogConfirm({
|
|
|
|
|
- headImg: require("@/img/homePage/ts.png"),
|
|
|
|
|
- text: "该功能暂未开放,敬请期待哦~",
|
|
|
|
|
- btnShow: [true]
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ console.log(url, "url")
|
|
|
|
|
+ if (url) {
|
|
|
|
|
+ if (["/cloudPractice", "/cloudTextbooks"].includes(url) && userStoreHook.roles === "KLX" && useAlbumList.value.length <= 0) {
|
|
|
|
|
+ useDialogConfirm({
|
|
|
|
|
+ headImg: require("@/img/homePage/ts.png"),
|
|
|
|
|
+ text: "请联系平台客服开通权限",
|
|
|
|
|
+ btnShow: [true]
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ router.push(url)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ useDialogConfirm({
|
|
|
|
|
+ headImg: require("@/img/homePage/ts.png"),
|
|
|
|
|
+ text: "该功能暂未开放,敬请期待哦~",
|
|
|
|
|
+ btnShow: [true]
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
function handleRouterCurriculum() {
|
|
function handleRouterCurriculum() {
|
|
|
router.push({
|
|
router.push({
|
|
@@ -226,6 +242,30 @@ function handleRouterCurriculum() {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+async function getKlxAlbumList() {
|
|
|
|
|
+ await httpAjaxErrMsg(queryTree_klx, {
|
|
|
|
|
+ enable: true,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ parentId: 0,
|
|
|
|
|
+ rows: 999
|
|
|
|
|
+ }).then(async res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ const result = res.data || []
|
|
|
|
|
+ const currentDate = new Date()
|
|
|
|
|
+ const albumList: any[] = []
|
|
|
|
|
+ result.forEach((item: any) => {
|
|
|
|
|
+ if (item.endTime) {
|
|
|
|
|
+ const albumDate = new Date(item.endTime)
|
|
|
|
|
+ if (albumDate >= currentDate) {
|
|
|
|
|
+ albumList.push(item)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ useAlbumList.value = albumList
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.homePageNav.navContainer {
|
|
.homePageNav.navContainer {
|