优化:去掉不必要的loading
This commit is contained in:
@@ -220,18 +220,16 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onShow, onHide, onPullDownRefresh, onPageScroll, onLoad } from '@dcloudio/uni-app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { onShow, onHide, onPullDownRefresh, onPageScroll } from '@dcloudio/uni-app'
|
||||
import { courseApi } from '@/api/modules/course'
|
||||
import { courseSubjectClassificationApi } from '@/api/modules/cousre_subject_classification'
|
||||
import { commonApi } from '@/api/modules/common'
|
||||
import { getNotchHeight } from '@/utils/system'
|
||||
// import { onPageJump } from '@/utils'
|
||||
import type { IMedicalTag, ICourse, INews } from '@/types/course'
|
||||
import type { ICategory, ICourse, INews } from '@/types/course'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
// 系统信息
|
||||
const scrollTop = ref<number>(0) // 滚动位置
|
||||
@@ -246,10 +244,10 @@ const handleSearch = ({ value }: { value: string }) => {
|
||||
}
|
||||
|
||||
// 分类相关
|
||||
const curseTagList = ref<IMedicalTag[]>([]) // 一级分类标签列表
|
||||
const sbuMedicalTagsList = ref<IMedicalTag[]>([]) // 二级分类标签列表
|
||||
const curseTagList = ref<ICategory[]>([]) // 一级分类标签列表
|
||||
const sbuMedicalTagsList = ref<ICategory[]>([]) // 二级分类标签列表
|
||||
const currentIndex = ref<number>(0) // 当前选中的一级分类索引
|
||||
const currentItem = ref<IMedicalTag | null>(null) // 当前选中的一级分类项
|
||||
const currentItem = ref<ICategory | null>(null) // 当前选中的一级分类项
|
||||
|
||||
// 学科数据
|
||||
const firstLevelCategories = ref<string[]>(['医学', '心理学', '国学'])
|
||||
@@ -287,7 +285,7 @@ const getMedicineMenusSuccess = (res: any) => {
|
||||
* 医学
|
||||
* 一级分类点击处理
|
||||
*/
|
||||
const curseClick = (item: IMedicalTag, index: number) => {
|
||||
const curseClick = (item: ICategory, index: number) => {
|
||||
currentItem.value = item
|
||||
currentIndex.value = index
|
||||
|
||||
@@ -350,7 +348,7 @@ const handleFirstLevelClick = (item: string) => {
|
||||
/**
|
||||
* 终极分类点击处理
|
||||
*/
|
||||
const curseClickJump = (item: IMedicalTag) => {
|
||||
const curseClickJump = (item: ICategory) => {
|
||||
getPrompt()
|
||||
if(!uni.getStorageSync('token')) return
|
||||
uni.navigateTo({
|
||||
@@ -512,7 +510,7 @@ onPullDownRefresh(() => {
|
||||
/**
|
||||
* 页面滚动
|
||||
*/
|
||||
onPageScroll((e) => {
|
||||
onPageScroll((e: any) => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user