更新:1.课程详情增加骨架屏;2.图书首页和图书详情增加骨架屏;

This commit is contained in:
2025-12-11 16:13:40 +08:00
parent b3d9b0c100
commit b8dd0584aa
27 changed files with 897 additions and 649 deletions

1
types/book.d.ts vendored
View File

@@ -129,7 +129,6 @@ export interface IPageData<T> {
export interface IApiResponse<T = any> {
code: number
msg?: string
info?: string
[key: string]: any
}

13
types/course.d.ts vendored
View File

@@ -3,7 +3,8 @@
* 课程相关类型定义
*/
import type { IApiResponse } from './book'
import type { IApiResponse } from '@/api/types'
import type { IVideoInfo } from './video'
import type { IGoods } from './order'
/** 医学标签(课程分类) */
@@ -93,14 +94,6 @@ export interface IChapterDetail {
questions: string // 思考题内容
}
/** 视频信息 */
export interface IVideo {
id: number
title: string
url: string
duration?: number
}
/** VIP信息 */
export interface IVipInfo {
type: number // VIP类型 4-中医学 5-针灸学 6-肿瘤学 7-国学 8-心理学 9-中西汇通学
@@ -140,7 +133,7 @@ export interface IChapterListResponse extends IApiResponse {
export interface IChapterDetailResponse extends IApiResponse {
data: {
detail: IChapterDetail
videos: IVideo[]
videos: IVideoInfo[]
current?: number // 当前播放视频ID
}
}

11
types/video.d.ts vendored
View File

@@ -6,7 +6,7 @@
export interface IVideoInfo {
id: number
chapterId: number
type: 0 | 1 // 0: MP4, 1: M3U8
type: 0 | 1 | 2 // 0: MP4, 1: M3U8, 2: 音频
video: string // 视频ID
sort: number
duration: number // 视频时长(秒)
@@ -46,14 +46,7 @@ export interface IVideoCheckResponse {
* 视频播放器组件 Props
*/
export interface IVideoPlayerProps {
videoList: Array<{
id: number
chapterId: number
video: string
sort: number
type?: 0 | 1
duration?: number
}>
videoList: Array<IVideoInfo>
currentIndex: number
countdownSeconds?: number
showWatermark?: boolean