| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942 |
- <template>
- <view class="container">
- <!-- 顶部导航 Tab -->
- <view class="top-nav">
- <view class="nav-tabs">
- <view
- class="nav-item"
- :class="{ active: tabIndex === 0 }"
- @click="tabIndex = 0"
- >
- <text>精选视频</text>
- <view v-if="tabIndex === 0" class="nav-indicator"></view>
- </view>
- <view
- class="nav-item"
- :class="{ active: tabIndex === 1 }"
- @click="tabIndex = 1"
- >
- <text>浏览记录</text>
- <view v-if="tabIndex === 1" class="nav-indicator"></view>
- </view>
- </view>
- <view v-if="tabIndex === 0" class="category-wrap">
- <view class="category-tags" :class="{ collapsed: !categoryExpand }">
- <view
- v-for="(cat, idx) in categories"
- :key="idx"
- class="tag-item"
- :class="{ active: categoryIndex === idx }"
- @click="onSelectCategory(idx)"
- >
- <text>{{ cat }}</text>
- </view>
- </view>
- <view v-if="categories.length>9" class="expand-btn" @click="categoryExpand = !categoryExpand">
- <text>{{ categoryExpand ? '收起' : '展开' }}</text>
- <image :class="{ 'rotate-arrow': !categoryExpand }" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/expand.png"></image>
- <!-- <text class="arrow">{{ categoryExpand ? '▲' : '▼' }}</text> -->
- </view>
- </view>
- </view>
- <!-- 精品课程 内容 -->
- <scroll-view
- v-show="tabIndex === 0"
- scroll-y
- class="scroll-wrap"
- :show-scrollbar="false"
- lower-threshold="120"
- @scrolltolower="onCourseScrollToLower"
- >
- <!-- 分类标签区 -->
-
- <!-- 课程骨架屏 -->
- <view class="course-skeleton" v-if="courseSectionLoading && courseList.length === 0">
- <view class="sk-course-card" v-for="i in 3" :key="'sk-course-' + i">
- <view class="sk-thumb"></view>
- <view class="sk-info">
- <view class="sk-line sk-line-lg"></view>
- <view class="sk-line sk-line-md"></view>
- <view class="sk-foot">
- <view class="sk-line sk-line-sm"></view>
- <view class="sk-btn"></view>
- </view>
- </view>
- </view>
- </view>
- <view class="course-grid-wrap" v-else>
- <view class="course-grid" :class="{ 'list-dimmed': courseRefreshing }">
- <view
- v-for="(course, idx) in courseList"
- :key="course.courseId"
- class="course-card"
- @click="onCourseClick(course)"
- >
- <view class="card-cover">
- <image v-if="course.cover" :src="course.cover" mode="aspectFill" class="cover-img"></image>
- </view>
- <view class="course-info">
- <text class="card-title">{{ course.title }}</text>
- <view class="x-end" style="justify-content: space-between;">
- <view class="course-meta">
- <image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/renshu.png"></image>
- <text class="meta-count">{{ courseViewsDisplay(course.views) }}</text>
- </view>
- <view class="btn-watch" @click.stop="onCourseClick(course)">立即观看</view>
- </view>
- </view>
- </view>
- </view>
- <view class="refresh-mask" v-if="courseRefreshing">
- <view class="refresh-spinner"></view>
- </view>
- </view>
- <view v-if="courseList.length > 0" class="load-tip">
- <text v-if="courseLoading">加载中...</text>
- <text v-else-if="!courseHasMore">没有更多了</text>
- </view>
- <view class="bottom-placeholder"></view>
- </scroll-view>
- <!-- 最近浏览 内容 -->
- <scroll-view
- v-show="tabIndex === 1"
- scroll-y
- class="scroll-wrap"
- :show-scrollbar="false"
- lower-threshold="120"
- @scrolltolower="onRecentScrollToLower"
- >
- <!-- 最近浏览骨架屏 -->
- <view class="recent-skeleton" v-if="recentSectionLoading && recentList.length === 0">
- <view class="sk-recent-group" v-for="g in 2" :key="'sk-group-' + g">
- <view class="sk-date"></view>
- <view class="sk-recent-card" v-for="i in 2" :key="'sk-recent-' + g + '-' + i">
- <view class="sk-thumb"></view>
- <view class="sk-info">
- <view class="sk-line sk-line-lg"></view>
- <view class="sk-line sk-line-md"></view>
- <view class="sk-btn"></view>
- </view>
- </view>
- </view>
- </view>
- <!-- 有浏览记录:按日期分组列表 -->
- <template v-else-if="recentList.length > 0">
- <view v-for="(group, gIdx) in recentList" :key="gIdx" class="recent-group">
- <view class="group-date">
- <image class="date-icon" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/time.png"></image>
- <text class="date-text">{{ group.date }}</text>
- </view>
- <view
- v-for="(item, i) in group.courses"
- :key="i"
- class="recent-card"
- @click="onCourseClick(item)"
- >
- <view class="recent-thumb">
- <image :src="item.imgUrl" mode="aspectFill" class="thumb-img"></image>
- </view>
- <view class="recent-info">
- <text class="recent-title">{{ item.courseName }}</text>
- <text class="recent-progress">已看: {{ item.progress }}%</text>
- <view class="y-end">
- <view class="btn-watch" @click.stop="onCourseClick(item)">立即观看</view>
- </view>
- </view>
- </view>
- </view>
- <view class="load-tip">
- <text v-if="recentLoading">加载中...</text>
- <text v-else-if="!recentHasMore">没有更多了</text>
- </view>
- </template>
- <!-- 无浏览记录:空态 + 为您精选 -->
- <template v-else-if="!recentSectionLoading">
- <view class="empty-state">
- <!-- <view class="empty-icon"></view> -->
- <image class="empty-icon" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/nodata.png"></image>
- <text class="empty-text">暂无浏览内容</text>
- </view>
- <view class="recommend-section">
- <text class="recommend-title">为您精选</text>
- <view class="course-grid" style="padding: 0;">
- <view
- v-for="(course, idx) in recommendList"
- :key="idx"
- class="course-card"
- @click="onCourseClick(course)"
- >
- <view class="card-cover">
- <image :src="course.imgUrl" mode="aspectFill" class="cover-img"></image>
- </view>
-
- <view class="card-footer">
- <text class="card-title">{{ course.title }}</text>
- <view class="x-end" style="justify-content: space-between;">
- <view class="course-meta">
- <image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/renshu.png"></image>
- <text class="meta-count">{{ courseViewsDisplay(course.views) }}</text>
- </view>
- <view class="btn-watch" @click.stop="onCourseClick(course)">立即观看</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <view class="bottom-placeholder"></view>
- </scroll-view>
- </view>
- </template>
- <script>
- import { listPublicCourseCategory, listPublicCourse } from '@/api/home.js'
- import { getCourseStudyList } from '@/api/class.js'
- export default {
- data() {
- return {
- statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
- tabIndex: 0,
- categoryExpand: false,
- categoryIndex: 0,
- categories: [],
- categoryRows: [],
- courseList: [],
- coursePageNum: 1,
- coursePageSize: 10,
- courseLoading: false,
- courseRefreshing: false,
- courseSectionLoading: true,
- courseHasMore: true,
- courseQuerySubCateId: null,
- courseRequestId: 0,
- recentPageNum: 1,
- recentPageSize: 10,
- recentLoading: false,
- recentSectionLoading: true,
- recentHasMore: true,
- recentList: [
- // {
- // date: '2026-02-08',
- // list: [
- // { title: '歌唱家刘金的《0基础金曲演唱速练课》', progress: 87, cover: '' },
- // { title: '资深编辑邹方斌讲《毛笔书法修心课》', progress: 56, cover: '' }
- // ]
- // },
- // {
- // date: '2026-02-01',
- // list: [
- // { title: '张斌《元气八段锦》系列课', progress: 56, cover: '' }
- // ]
- // }
- ],
- recommendList: [
- // { title: '刘金的《0基础金曲演唱速练课》', views: '9239', cover: '' },
- // { title: '邹方斌讲《毛笔书法修心课》', views: '10.8w', cover: '' },
- // { title: '张斌《元气八段锦》系列课', views: '2.5w', cover: '' },
- // { title: '翔哥精讲摄影课-手机微距拍摄技巧...', views: '100w+', cover: '' }
- ]
- }
- },
- onLoad() {
- // 默认先查一次课程(不带分类参数),再加载分类标签
- this.initPublicCourseData()
- this.getNewCourseList()
- },
- methods: {
- courseViewsDisplay(views) {
- const raw = views;
- const n = Number(raw);
- if (!Number.isFinite(n) || n < 0) {
- return "0";
- }
- if (n < 100000) {
- return String(Math.floor(n));
- }
- if (n < 1000000) {
- return (n / 10000).toFixed(1) + "w";
- }
- return "100w+";
- },
- async initPublicCourseData() {
- await this.getCategoryList()
- this.courseQuerySubCateId = null
- await this.getCourseList({})
- await this.getCourseStudyList({})
- },
- async getNewCourseList() {
- try {
- const params = { pageNum: 1, pageSize:6 }
- const res = await listPublicCourse(params)
- const list = (res && res.data && res.data.list) || []
- this.recommendList = list.map(item => ({
- courseId: item.courseId,
- title: item.courseTitle || item.courseName || '',
- views: item.watchUserCount || 0,
- cover: item.imgUrl || ''
- }))
- } catch (e) {
- this.recommendList = []
- }
- },
- async getCategoryList() {
- try {
- const res = await listPublicCourseCategory({ pageNum: 1, pageSize: 50 ,yxxTag:0})
- const list = (res && res.data && res.data.list) || []
- this.categoryRows = [{ cateId: null, cateName: '全部' }, ...list]
- this.categories = this.categoryRows.map(item => item.cateName || '')
- } catch (e) {
- this.categoryRows = [{ cateId: null, cateName: '全部' }]
- this.categories = ['全部']
- }
- },
- countRecentCourses(groups) {
- if (!Array.isArray(groups)) return 0
- return groups.reduce((n, g) => n + (g && g.courses ? g.courses.length : 0), 0)
- },
- mergeRecentGroups(existing, incoming) {
- if (!Array.isArray(incoming) || incoming.length === 0) {
- return Array.isArray(existing) ? existing.slice() : []
- }
- if (!Array.isArray(existing) || existing.length === 0) {
- return incoming.map(g => ({
- date: g.date,
- courses: [...(g.courses || [])]
- }))
- }
- const result = existing.map(g => ({
- date: g.date,
- courses: [...(g.courses || [])]
- }))
- for (const ng of incoming) {
- const last = result[result.length - 1]
- if (last && last.date === ng.date) {
- last.courses = last.courses.concat(ng.courses || [])
- } else {
- result.push({ date: ng.date, courses: [...(ng.courses || [])] })
- }
- }
- return result
- },
- async getCourseList(options = {}) {
- const loadMore = !!options.loadMore
- if (this.courseLoading && loadMore) return
- if (loadMore && !this.courseHasMore) return
- const requestId = ++this.courseRequestId
- if (!loadMore) {
- this.coursePageNum = 1
- this.courseHasMore = true
- if (options.subCateId !== undefined) {
- this.courseQuerySubCateId = options.subCateId
- }
- if (this.courseList.length > 0) {
- this.courseRefreshing = true
- } else {
- this.courseSectionLoading = true
- }
- }
- const currentPageNum = this.coursePageNum
- const params = {
- yxxTag: 0,
- pageNum: currentPageNum,
- pageSize: this.coursePageSize
- }
- if (this.courseQuerySubCateId) {
- params.subCateId = this.courseQuerySubCateId
- }
- this.courseLoading = true
- try {
- const res = await listPublicCourse(params)
- if (requestId !== this.courseRequestId) return
- const list = (res && res.data && res.data.list) || []
- const mapped = list.map(item => ({
- courseId: item.courseId,
- title: item.courseTitle || item.courseName || '',
- views: item.watchUserCount || 0,
- cover: item.imgUrl || ''
- }))
- this.courseList = loadMore ? this.courseList.concat(mapped) : mapped
- const total = Number(res.data && res.data.total)
- if (Number.isFinite(total) && total >= 0) {
- this.courseHasMore = this.courseList.length < total
- } else {
- this.courseHasMore = mapped.length >= this.coursePageSize
- }
- if (mapped.length > 0) {
- this.coursePageNum = currentPageNum + 1
- } else {
- this.courseHasMore = false
- }
- } catch (e) {
- if (requestId !== this.courseRequestId) return
- if (!loadMore) {
- this.courseList = []
- }
- this.courseHasMore = false
- } finally {
- if (requestId !== this.courseRequestId) return
- this.courseLoading = false
- this.courseRefreshing = false
- if (!loadMore) this.courseSectionLoading = false
- }
- },
- onCourseScrollToLower() {
- if (this.tabIndex !== 0) return
- this.getCourseList({ loadMore: true })
- },
- async getCourseStudyList(options = {}) {
- const loadMore = !!options.loadMore
- if (this.recentLoading && !loadMore) return
- if (loadMore && !this.recentHasMore) return
- if (!loadMore) {
- this.recentPageNum = 1
- this.recentHasMore = true
- if (this.recentList.length === 0) {
- this.recentSectionLoading = true
- }
- }
- const currentPageNum = this.recentPageNum
- const params = {
- courseType: 0,
- pageNum: currentPageNum,
- pageSize: this.recentPageSize
- }
- this.recentLoading = true
- try {
- const res = await getCourseStudyList(params)
- const list = (res && res.data && res.data.list) || []
- const merged = loadMore ? this.mergeRecentGroups(this.recentList, list) : list
- this.recentList = merged
- const pageCourseCount = this.countRecentCourses(list)
- const total = Number(res.data && res.data.total)
- if (Number.isFinite(total) && total >= 0) {
- const loaded = this.countRecentCourses(this.recentList)
- this.recentHasMore = loaded < total
- } else {
- this.recentHasMore = pageCourseCount >= this.recentPageSize
- }
- if (pageCourseCount > 0) {
- this.recentPageNum = currentPageNum + 1
- } else {
- this.recentHasMore = false
- }
- } catch (e) {
- if (!loadMore) {
- this.recentList = []
- }
- this.recentHasMore = false
- } finally {
- this.recentLoading = false
- if (!loadMore) this.recentSectionLoading = false
- }
- },
- onRecentScrollToLower() {
- if (this.tabIndex !== 1) return
- if (!this.recentList.length) return
- this.getCourseStudyList({ loadMore: true })
- },
- onSelectCategory(idx) {
- if (idx === this.categoryIndex || this.courseRefreshing) return
- this.categoryIndex = idx
- const selected = this.categoryRows[idx]
- const subCateId = selected && selected.cateId ? selected.cateId : null
- this.getCourseList({ subCateId })
- },
- onCourseClick(course) {
- if (course && course.courseId) {
- uni.navigateTo({ url: '/pages_index/courseDetail?courseId=' + course.courseId + '&type=1' })
- return
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /* 图片箭头旋转类(展开时向上) */
- .rotate-arrow {
- transform: rotate(180deg);
- }
- .container {
- min-height: 100vh;
- background: #F5F5F5;
- display: flex;
- flex-direction: column;
- }
- /* 顶部 Tab */
- .top-nav {
- display: flex;
- flex-direction: column;
- background: #fff;
- /* border-bottom: 1rpx solid #f0f0f0; */
- }
- .nav-tabs {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-item {
- flex:1;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- padding: 24rpx 0;
- }
- .nav-item text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 36rpx;
- color: #030303;
- }
- .nav-item.active text {
- font-weight: 600;
- font-size: 40rpx;
- }
- .nav-indicator {
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 100rpx;
- height: 10rpx;
- background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
- border-radius: 6rpx;
- }
- .nav-actions {
- display: flex;
- align-items: center;
- gap: 24rpx;
- }
- .action-icon {
- font-size: 36rpx;
- color: #666;
- }
- /* 滚动区 */
- .scroll-wrap {
- flex: 1;
- height: 0;
- }
- /* 分类标签 */
- .category-wrap {
- padding:24rpx 24rpx 12rpx;
- border-radius: 0rpx 0rpx 20rpx 20rpx;
- background: #fff;
- display: flex;
- align-items: center;
- flex-direction: column;
- }
- .category-tags {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- gap:24rpx;
- flex-direction: row;
- justify-content: flex-start;
- }
- .category-tags.collapsed {
- max-height: 336rpx;
- overflow: hidden;
- }
- .tag-item {
- flex: 0 0 calc((100% - 2*24rpx)/3);
- padding: 20rpx 0;
- text-align: center;
- border-radius: 20rpx;
- background: #f0f0f0;
- }
- .tag-item text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 40rpx;
- color: rgba(0,0,0,0.85);
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .tag-item.active {
- background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
- }
- .tag-item.active text {
- color: #fff;
- }
- .expand-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 24rpx;
- width: 166rpx;
- height: 64rpx;
- border-radius: 32rpx;
- border: 2rpx solid #FF233C;
- }
- .expand-btn text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #FF233C;
- }
- .expand-btn .arrow {
- margin-left: 6rpx;
- font-size: 22rpx;
- }
- .expand-btn image{
- margin-left:10rpx ;
- width: 32rpx;
- height: 32rpx;
- }
- /* 课程网格 */
- .course-grid {
- display: flex;
- flex-wrap: wrap;
- padding:24rpx;
- gap: 24rpx 20rpx;
- flex-direction: column;
- }
- .course-card {
- display: flex;
- background: #fff;
- border-radius: 20rpx;
- overflow: hidden;
- padding: 20rpx;
- }
- .course-tag {
- position: absolute;
- left: 0;
- bottom: 0;
- right: 0;
- padding: 8rpx 12rpx;
- background: linear-gradient(transparent, rgba(0,0,0,0.6));
- font-size: 22rpx;
- color: #fff;
- }
- .course-info {
- flex: 1;
- padding-left: 24rpx;
- /* padding: 20rpx 24rpx; */
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- min-width: 0;
- }
- .course-meta {
- display: flex;
- align-items: center;
- image{
- width: 30rpx;
- height: 30rpx;
- }
-
- }
- .meta-icon {
- font-size: 24rpx;
- margin-right: 6rpx;
- color: #999;
- }
- .meta-count {
- margin-left: 10rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #666666;
- }
- .card-cover {
- position: relative;
- width: 296rpx;
- height: 222rpx;
- border-radius: 20rpx;
- overflow: hidden;
- flex-shrink: 0;
- }
- .cover-img {
- width: 100%;
- height: 100%;
- background: #BB6D6D;
- }
- .card-title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 36rpx;
- color: #222222;
- line-height: 50rpx;
- text-align: justify;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .card-footer {
- flex: 1;
- padding-left: 24rpx;
- /* padding: 20rpx 24rpx; */
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- min-width: 0;
- }
- .card-views {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #666666;
- line-height: 44rpx;
- }
- .btn-watch {
- width: 168rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
- border-radius: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 32rpx;
- color: #FFFFFF;
- }
- /* 最近浏览 - 按日期分组 */
- .recent-group {
- padding: 24rpx 24rpx 0;
- }
- .group-date {
- display: flex;
- align-items: center;
- margin-bottom: 24rpx;
- }
- .date-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 8rpx;
- }
- .date-text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 40rpx;
- line-height: 56rpx;
- color: #222222;
- }
- .recent-card {
- display: flex;
- background: #fff;
- border-radius: 20rpx;
- overflow: hidden;
- padding: 20rpx;
- margin-bottom: 24rpx;
- }
- .recent-card:last-child{
- margin-bottom: 0;
- }
- .recent-thumb {
- position: relative;
- width: 296rpx;
- height: 222rpx;
- border-radius: 20rpx;
- overflow: hidden;
- flex-shrink: 0;
- }
- .thumb-img {
- width: 100%;
- height: 100%;
- background: #BB6D6D;
- }
- .recent-info {
- flex: 1;
- padding-left: 24rpx;
- /* padding: 20rpx 24rpx; */
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- min-width: 0;
- }
- .recent-title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 36rpx;
- color: #222222;
- line-height: 50rpx;
- text-align: justify;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .recent-progress {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: rgba(0,0,0,0.65);
- line-height: 44rpx;
- }
- /* 空态 */
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 80rpx 0 48rpx;
- /* background: linear-gradient(180deg, #fff5f5 0%, #fff 100%); */
- }
- .empty-icon {
- width: 310rpx;
- height: 260rpx;
- margin-bottom: 30rpx;
- }
- .empty-text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 36rpx;
- color: rgba(0,0,0,0.25);
- line-height: 50rpx;
- }
- /* 为您精选 */
- .recommend-section {
- padding: 0 24rpx 32rpx;
- }
- .recommend-title {
- display: block;
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 40rpx;
- color: #222222;
- line-height: 56rpx;
- padding-bottom: 24rpx;
- }
- .bottom-placeholder {
- height: 120rpx;
- }
- .load-tip {
- padding: 24rpx 0 8rpx;
- text-align: center;
- font-size: 28rpx;
- color: #999;
- }
- @mixin sk-shimmer {
- background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
- background-size: 200% 100%;
- animation: skeleton-shimmer 1.2s ease-in-out infinite;
- }
- .sk-line {
- height: 28rpx;
- border-radius: 6rpx;
- @include sk-shimmer;
- }
- .sk-line-lg { width: 90%; }
- .sk-line-md { width: 70%; margin-top: 16rpx; }
- .sk-line-sm { width: 40%; }
- @keyframes skeleton-shimmer {
- 0% { background-position: 100% 0; }
- 100% { background-position: -100% 0; }
- }
- /* 精品课程骨架 */
- .course-skeleton {
- padding: 24rpx;
- display: flex;
- flex-direction: column;
- gap: 24rpx;
- }
- .sk-course-card,
- .sk-recent-card {
- display: flex;
- background: #fff;
- border-radius: 20rpx;
- padding: 20rpx;
- }
- .sk-thumb {
- width: 296rpx;
- height: 222rpx;
- border-radius: 20rpx;
- flex-shrink: 0;
- @include sk-shimmer;
- }
- .sk-info {
- flex: 1;
- padding-left: 24rpx;
- min-width: 0;
- }
- .sk-foot {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 40rpx;
- }
- .sk-btn {
- width: 168rpx;
- height: 64rpx;
- border-radius: 32rpx;
- @include sk-shimmer;
- }
- .course-grid-wrap {
- position: relative;
- }
- .course-grid.list-dimmed {
- opacity: 0.55;
- transition: opacity 0.2s ease;
- }
- .refresh-mask {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- pointer-events: none;
- }
- .refresh-spinner {
- width: 48rpx;
- height: 48rpx;
- border: 4rpx solid #e8e8e8;
- border-top-color: #FF233C;
- border-radius: 50%;
- animation: spin 0.8s linear infinite;
- }
- @keyframes spin {
- to { transform: rotate(360deg); }
- }
- /* 最近浏览骨架 */
- .recent-skeleton {
- padding: 24rpx 24rpx 0;
- }
- .sk-recent-group {
- margin-bottom: 24rpx;
- }
- .sk-date {
- width: 240rpx;
- height: 40rpx;
- margin-bottom: 24rpx;
- border-radius: 8rpx;
- @include sk-shimmer;
- }
- .sk-recent-card {
- margin-bottom: 24rpx;
- }
- .sk-recent-card:last-child {
- margin-bottom: 0;
- }
- .sk-recent-card .sk-btn {
- margin-top: 40rpx;
- }
- </style>
|