feat: 添加悬浮按钮并修改页面跳转逻辑
fix: 修正页面导航栏状态更新逻辑
This commit is contained in:
parent
db3e2fdc13
commit
2b671bdf78
1
components.d.ts
vendored
1
components.d.ts
vendored
@ -19,6 +19,7 @@ declare module 'vue' {
|
|||||||
WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default']
|
WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default']
|
||||||
WdDropMenu: typeof import('wot-design-uni/components/wd-drop-menu/wd-drop-menu.vue')['default']
|
WdDropMenu: typeof import('wot-design-uni/components/wd-drop-menu/wd-drop-menu.vue')['default']
|
||||||
WdDropMenuItem: typeof import('wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue')['default']
|
WdDropMenuItem: typeof import('wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue')['default']
|
||||||
|
WdFab: typeof import('wot-design-uni/components/wd-fab/wd-fab.vue')['default']
|
||||||
WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default']
|
WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default']
|
||||||
WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
|
WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
|
||||||
WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']
|
WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']
|
||||||
|
@ -36,7 +36,8 @@ const nameLabelIconMap = {
|
|||||||
progress: {
|
progress: {
|
||||||
title: '进度管理',
|
title: '进度管理',
|
||||||
icon: 'transfer',
|
icon: 'transfer',
|
||||||
roles: ['teacher', 'admin', 'sysadmin'] as const // 校方教师、公司课程顾问、公司系统管理员
|
roles: ['teacher', 'sysadmin'] as const // 校方教师、公司课程顾问、公司系统管理员
|
||||||
|
// roles: ['teacher', 'admin', 'sysadmin'] as const // 校方教师、公司课程顾问、公司系统管理员
|
||||||
},
|
},
|
||||||
my: {
|
my: {
|
||||||
title: '我的',
|
title: '我的',
|
||||||
|
@ -5,7 +5,7 @@ export const useConfig = defineStore('config', () => {
|
|||||||
// const BASE_URL = ref<string>("https://ppmp.fenshenzhike.com/api");
|
// const BASE_URL = ref<string>("https://ppmp.fenshenzhike.com/api");
|
||||||
// const BASE_URL = ref<string>("http://localhost:1218/api");
|
// const BASE_URL = ref<string>("http://localhost:1218/api");
|
||||||
const BASE_URL = ref<string>("http://192.168.0.119:1218/api");
|
const BASE_URL = ref<string>("http://192.168.0.119:1218/api");
|
||||||
// const BASE_URL = ref<string>("http://192.30.5.20:1218/api");
|
// const BASE_URL = ref<string>("http://192.30.5.14:1218/api");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
BASE_URL
|
BASE_URL
|
||||||
|
@ -11,6 +11,7 @@ import { useToast } from 'wot-design-uni';
|
|||||||
import type { DropMenuItemBeforeToggle } from 'wot-design-uni/components/wd-drop-menu-item/types';
|
import type { DropMenuItemBeforeToggle } from 'wot-design-uni/components/wd-drop-menu-item/types';
|
||||||
import WdTag from 'wot-design-uni/components/wd-tag/wd-tag.vue';
|
import WdTag from 'wot-design-uni/components/wd-tag/wd-tag.vue';
|
||||||
|
|
||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const value = ref<number>(0)
|
const value = ref<number>(0)
|
||||||
@ -192,7 +193,6 @@ onPullDownRefresh(() => {
|
|||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
loadLessons()
|
loadLessons()
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -207,6 +207,7 @@ onLoad(() => {
|
|||||||
<wd-sort-button title="进度" allow-reset v-model="value" @change="handleChange" />
|
<wd-sort-button title="进度" allow-reset v-model="value" @change="handleChange" />
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<wd-collapse v-model="expandedCourse">
|
<wd-collapse v-model="expandedCourse">
|
||||||
<wd-status-tip v-if="Object.keys(groupedLessons).length === 0"
|
<wd-status-tip v-if="Object.keys(groupedLessons).length === 0"
|
||||||
image="https://registry.npmmirror.com/wot-design-uni-assets/*/files/content.png" tip="当前账号没有分配微课" />
|
image="https://registry.npmmirror.com/wot-design-uni-assets/*/files/content.png" tip="当前账号没有分配微课" />
|
||||||
@ -225,7 +226,6 @@ onLoad(() => {
|
|||||||
const hasCompleted = courses.some(lesson => calcLessonProgress(lesson) === 100)
|
const hasCompleted = courses.some(lesson => calcLessonProgress(lesson) === 100)
|
||||||
const hasNotStarted = courses.some(lesson => calcLessonProgress(lesson) === 0)
|
const hasNotStarted = courses.some(lesson => calcLessonProgress(lesson) === 0)
|
||||||
if (hasCompleted && hasNotStarted) return true
|
if (hasCompleted && hasNotStarted) return true
|
||||||
|
|
||||||
const hasInProgress = courses.some(lesson => {
|
const hasInProgress = courses.some(lesson => {
|
||||||
const progress = calcLessonProgress(lesson)
|
const progress = calcLessonProgress(lesson)
|
||||||
return progress > 0 && progress < 100
|
return progress > 0 && progress < 100
|
||||||
@ -286,9 +286,10 @@ onLoad(() => {
|
|||||||
class="w-full py-2 gap-12 flex justify-between items-center border-b border-b-solid border-neutral-100 last:border-b-0 first:pt-0 last:pb-0">
|
class="w-full py-2 gap-12 flex justify-between items-center border-b border-b-solid border-neutral-100 last:border-b-0 first:pt-0 last:pb-0">
|
||||||
<div class="flex items-center gap-1 self-center">
|
<div class="flex items-center gap-1 self-center">
|
||||||
<div>
|
<div>
|
||||||
<div v-if="calcLessonProgress(lesson) === 100" class="i-tabler-circle-check"></div>
|
<div v-if="calcLessonProgress(lesson) === 100" class="i-tabler-circle-check text-emerald"></div>
|
||||||
<div v-else-if="calcLessonProgress(lesson) === 0" class="i-tabler-circle-dashed"></div>
|
<div v-else-if="calcLessonProgress(lesson) === 0" class="i-tabler-circle-dashed text-neutral">
|
||||||
<div v-else class="i-tabler-hourglass-empty"></div>
|
</div>
|
||||||
|
<div v-else class="i-tabler-hourglass-empty text-blue"></div>
|
||||||
</div>
|
</div>
|
||||||
<wd-badge is-dot :hidden="true">
|
<wd-badge is-dot :hidden="true">
|
||||||
<span>{{ lesson.microLessonName || '无标题微课' }}</span>
|
<span>{{ lesson.microLessonName || '无标题微课' }}</span>
|
||||||
|
@ -30,7 +30,7 @@ const goProgress = (lessonId: number) => {
|
|||||||
lessonId: `${lessonId}`
|
lessonId: `${lessonId}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tabbar.activeTab = 'progress'
|
// tabbar.activeTab = 'progress'
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadLesson = async () => {
|
const loadLesson = async () => {
|
||||||
|
@ -8,6 +8,7 @@ import { useMessage, useToast } from 'wot-design-uni';
|
|||||||
import StatusBlock from './StatusBlock.vue';
|
import StatusBlock from './StatusBlock.vue';
|
||||||
import { useRoute } from 'uni-mini-router';
|
import { useRoute } from 'uni-mini-router';
|
||||||
import { useUser } from '@/stores/useUser';
|
import { useUser } from '@/stores/useUser';
|
||||||
|
import { useTabbar } from '@/stores/useTabbar'
|
||||||
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@ -15,6 +16,7 @@ const message = useMessage()
|
|||||||
const message_reject = useMessage('wd-message-box-slot')
|
const message_reject = useMessage('wd-message-box-slot')
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
|
const tabbar = useTabbar()
|
||||||
|
|
||||||
type GroupedLessons = { [key: string]: LessonTask[] }
|
type GroupedLessons = { [key: string]: LessonTask[] }
|
||||||
|
|
||||||
@ -374,6 +376,14 @@ const refresh = async () => {
|
|||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
refresh()
|
refresh()
|
||||||
})
|
})
|
||||||
|
const handleClick = () => {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
success: () => {
|
||||||
|
tabbar.activeTab = 'home'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -543,6 +553,8 @@ onPullDownRefresh(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</page-wrapper>
|
</page-wrapper>
|
||||||
|
<wd-fab position="left-bottom" @click="handleClick" :inactiveIcon="'home'" :expandable="false"
|
||||||
|
:gap="{ left: 20, bottom: 140 }" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
Loading…
Reference in New Issue
Block a user