feat: 完善访谈与vlog模块页面,重组设备与图片公共资源,新增音频管理与一班对接工具

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhongyidianandClaude Opus 4.7 committed 2026-05-05 15:41:41 +08:00
1 parent c4c9be9d35
commit fc9633f371
159 files changed
+4823 -2535

No files matched your search

+37 -2
View File
@@ -1,6 +1,8 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import { BasicElements, Film, Interview, Vlog } from './modules'
import { allTrackedRouteNames, getModuleNameByRouteName } from '@/config/moduleStepMap'
import { useFilmStore, useInterviewStore, useVlogStore } from '@/stores'
const NotFound = {
path: '/:pathMatch(.*)*',
@@ -15,7 +17,7 @@ const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'Home',
component: () => import('@/views/home/index.vue'),
component: () => import('@/views/home/index.tsx'),
meta: {
title: '首页'
}
@@ -61,13 +63,46 @@ const router = createRouter({
routes
})
const VIEW_THRESHOLD_MS = 3000
let currentTrackedRouteName: string | null = null
let currentEnterAt = 0
// 路由守卫
router.beforeEach((to, _from, next) => {
router.beforeEach((to, from, next) => {
// 设置页面标题
if (to.meta?.title) {
document.title = `${to.meta.title} - 短视频达人`
}
// 结算离开:from 是上一个页面
const fromName = typeof from.name === 'string' ? from.name : null
if (
fromName &&
currentTrackedRouteName === fromName &&
allTrackedRouteNames.has(fromName) &&
currentEnterAt > 0
) {
const stayedMs = Date.now() - currentEnterAt
if (stayedMs >= VIEW_THRESHOLD_MS) {
const moduleName = getModuleNameByRouteName(fromName)
if (moduleName === 'film') useFilmStore().markViewed(fromName)
if (moduleName === 'vlog') useVlogStore().markViewed(fromName)
if (moduleName === 'interview') useInterviewStore().markViewed(fromName)
}
}
next()
})
router.afterEach(to => {
// 记录进入:to 是当前页面
const toName = typeof to.name === 'string' ? to.name : null
if (toName && allTrackedRouteNames.has(toName)) {
currentTrackedRouteName = toName
currentEnterAt = Date.now()
} else {
currentTrackedRouteName = null
currentEnterAt = 0
}
})
export default router