四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

936 lines
22 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="home-container">
  3. <!-- 開動頁面組件 -->
  4. <SplashScreen @close="onSplashClose" />
  5. <!-- 状态栏安全区域 -->
  6. <uv-status-bar></uv-status-bar>
  7. <!-- 顶部搜索栏 -->
  8. <view class="header">
  9. <view class="search-container" @click="goSearch">
  10. <uv-search
  11. placeholder="请输入要查询的内容"
  12. :show-action="false"
  13. shape="round"
  14. bg-color="#f5f5f5"
  15. color="#666"
  16. height="38"
  17. margin="0 200rpx 0 0"
  18. placeholderColor="#c6c6c6"
  19. ></uv-search>
  20. </view>
  21. </view>
  22. <!-- Tab栏 -->
  23. <view class="tab-container">
  24. <scroll-view show-scrollbar="false" class="tab-scroll" scroll-x="true" >
  25. <view class="tab-list">
  26. <view
  27. v-for="(tab, index) in tabs"
  28. :key="index"
  29. class="tab-item"
  30. :class="{ active: activeTab === index }"
  31. @click="switchTab(index)"
  32. >
  33. {{ tab.title }}
  34. </view>
  35. </view>
  36. </scroll-view>
  37. </view>
  38. <!-- 轮播图 -->
  39. <view class="swiper-container" :class="{ 'tablet-swiper': isTablet }">
  40. <uv-swiper
  41. :list="bannerList"
  42. keyName="image"
  43. :height="swiperConfig.height"
  44. :radius="swiperConfig.radius"
  45. :previousMargin="swiperConfig.previousMargin"
  46. :nextMargin="swiperConfig.nextMargin"
  47. :displayMultipleItems="swiperConfig.displayMultipleItems"
  48. indicator
  49. indicatorInactiveColor="#fff"
  50. :loading="false"
  51. indicatorMode="dot"
  52. indicatorActiveColor="#F95A01"
  53. :autoplay="true"
  54. :interval="4000"
  55. :circular="true"
  56. @click="onBannerClick"
  57. ></uv-swiper>
  58. </view>
  59. <!-- 根据labelBooksData动态渲染书籍区块 -->
  60. <view
  61. v-for="(labelData, labelIndex) in labelBooksData"
  62. :key="labelIndex"
  63. class="section"
  64. >
  65. <view class="section-header" @click="goLabel(labelData.labelInfo)">
  66. <text class="section-title">{{ labelData.labelInfo.title }}</text>
  67. <view class="section-more">
  68. <text>更多</text>
  69. <uv-icon name="arrow-right" size="14" color="#888"></uv-icon>
  70. </view>
  71. </view>
  72. <!-- 第一个label今日更新样式 -->
  73. <scroll-view
  74. v-if="labelIndex === 0"
  75. show-scrollbar="false"
  76. class="content-scroll"
  77. scroll-x="true"
  78. >
  79. <view class="content-list">
  80. <view
  81. v-for="(item, index) in labelData.books"
  82. :key="index"
  83. class="content-item"
  84. @click="goBook(item)"
  85. >
  86. <view class="item-cover">
  87. <image :src="item.booksImg || '/static/default-image.png'" mode="aspectFill"></image>
  88. </view>
  89. <view class="item-info">
  90. <text class="item-title">{{ item.booksName }}</text>
  91. <text class="item-author">{{ item.booksAuthor }}</text>
  92. <view class="item-duration">
  93. <image src="/static/play-icon.png" class="item-icon" />
  94. <text>{{ item.duration }}</text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </scroll-view>
  100. <!-- 第二个label推荐书籍样式 -->
  101. <scroll-view
  102. v-else-if="labelIndex === 1"
  103. show-scrollbar="false"
  104. class="content-scroll"
  105. scroll-x="true"
  106. >
  107. <view class="book-list">
  108. <view
  109. v-for="(book, index) in labelData.books"
  110. :key="index"
  111. class="book-item"
  112. @click="goBook(book)"
  113. >
  114. <view class="book-cover">
  115. <image :src="book.booksImg || '/static/default-image.png'" mode="aspectFill"></image>
  116. <view class="book-overlay">
  117. <view class="book-duration" v-if="book.duration">
  118. <image src="/static/alarm-icon.png" class="book-duration-icon" />
  119. <text class="book-duration-text">{{ book.duration }}</text>
  120. </view>
  121. <view class="book-title">{{ book.booksName }}</view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </scroll-view>
  127. <!-- 第三个及以后的label网格样式 -->
  128. <view v-else class="book-grid">
  129. <view
  130. v-for="(book, index) in labelData.books"
  131. :key="index"
  132. class="book-grid-item"
  133. @click="goBook(book)"
  134. >
  135. <view class="book-grid-cover">
  136. <image :src="book.booksImg || '/static/default-image.png'" mode="aspectFill"></image>
  137. </view>
  138. <!-- <view class="book-grid-info">
  139. <text class="book-grid-title">{{ book.booksName }}</text>
  140. <view class="book-grid-meta">
  141. <text class="book-grid-grade">{{ book.categoryName }}/</text>
  142. <image src="/static/play-icon.png" class="book-grid-duration-icon" />
  143. <text class="book-grid-duration">{{ book.duration }}</text>
  144. </view>
  145. </view> -->
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 推荐内容列表 -->
  150. <view class="section">
  151. <view class="recommend-list">
  152. <view
  153. @click="goPlan(item.id, item.type)"
  154. v-for="(item, index) in recommendList"
  155. :key="index"
  156. class="recommend-item"
  157. >
  158. <image :src="item.img" mode="aspectFill" class="recommend-image"></image>
  159. </view>
  160. </view>
  161. </view>
  162. <!-- 视频播放弹窗 -->
  163. <uv-popup
  164. ref="videoModal"
  165. title="视频播放"
  166. :show-cancel-button="false"
  167. :show-confirm-button="false"
  168. :close-on-click-overlay="true"
  169. :safeAreaInsetBottom="false"
  170. @close="closeVideoModal"
  171. >
  172. <template #default>
  173. <view class="video-container">
  174. <video
  175. v-if="currentVideo"
  176. :src="currentVideo"
  177. controls
  178. autoplay
  179. :show-fullscreen-btn="true"
  180. :show-play-btn="true"
  181. :show-center-play-btn="true"
  182. style="width: 100%; height: 400rpx; border-radius: 8rpx;"
  183. @error="onVideoError"
  184. @play="onVideoPlay"
  185. @pause="onVideoPause"
  186. ></video>
  187. <view v-else class="video-loading">
  188. <text>视频加载中...</text>
  189. </view>
  190. </view>
  191. </template>
  192. </uv-popup>
  193. </view>
  194. </template>
  195. <script>
  196. import SplashScreen from '../components/SplashScreen.vue'
  197. export default {
  198. components: {
  199. SplashScreen
  200. },
  201. data() {
  202. return {
  203. // Tab数据
  204. tabs: [ ],
  205. activeTab: 0,
  206. // 轮播图数据
  207. bannerList: [
  208. ],
  209. // 书籍分类
  210. labels: [
  211. ],
  212. // 根据label获取的书籍数据(二维数组)
  213. labelBooksData: [],
  214. // 推荐列表数据
  215. recommendList: [
  216. ],
  217. currentVideo: '',
  218. // 设备类型检测
  219. isTablet: false
  220. }
  221. },
  222. computed: {
  223. // 轮播图配置
  224. swiperConfig() {
  225. if (this.isTablet) {
  226. // 平板设备使用卡片式轮播
  227. return {
  228. height: "200",
  229. radius: "16",
  230. previousMargin: "60",
  231. nextMargin: "60",
  232. displayMultipleItems: 1.5
  233. }
  234. } else {
  235. // 手机设备使用普通轮播
  236. return {
  237. height: "121",
  238. radius: "12",
  239. previousMargin: "0",
  240. nextMargin: "0",
  241. displayMultipleItems: 1
  242. }
  243. }
  244. }
  245. },
  246. methods: {
  247. // 检测设备类型
  248. detectDevice() {
  249. // #ifdef H5
  250. const userAgent = navigator.userAgent
  251. const screenWidth = window.innerWidth || document.documentElement.clientWidth
  252. const screenHeight = window.innerHeight || document.documentElement.clientHeight
  253. // 判断是否为平板设备
  254. // 1. 屏幕宽度大于768px
  255. // 2. 或者是iPad设备
  256. this.isTablet = screenWidth >= 768 || /iPad|Android.*(?=.*\b(tablet|pad)\b)/i.test(userAgent)
  257. console.log('设备检测结果:', {
  258. screenWidth,
  259. screenHeight,
  260. userAgent,
  261. isTablet: this.isTablet
  262. })
  263. // #endif
  264. // #ifndef H5
  265. // 非H5环境,通过系统信息判断
  266. const systemInfo = uni.getSystemInfoSync()
  267. const screenWidth = systemInfo.screenWidth
  268. this.isTablet = screenWidth >= 768
  269. // #endif
  270. },
  271. // 開動頁面關閉處理
  272. onSplashClose() {
  273. console.log('開動頁面已關閉')
  274. // 可以在這裡添加其他邏輯,比如統計、初始化等
  275. },
  276. // 切换Tab
  277. async switchTab(index) {
  278. this.activeTab = index
  279. await this.getBooksByLabels()
  280. },
  281. // 轮播图点击事件
  282. onBannerClick(index) {
  283. console.log('点击轮播图:', index)
  284. const bannerItem = this.bannerList[index]
  285. if (!bannerItem) return
  286. // 根据 typ 字段判断跳转类型
  287. switch(bannerItem.typ) {
  288. case '1': // 课程详情
  289. if (bannerItem.bookId) {
  290. uni.navigateTo({
  291. url: '/subPages/home/directory?id=' + bannerItem.bookId
  292. })
  293. }
  294. break
  295. case '2': // 视频播放
  296. if (bannerItem.video) {
  297. this.currentVideo = bannerItem.video
  298. this.$refs.videoModal.open()
  299. }
  300. break
  301. case '0': // 富文本内容
  302. if (bannerItem.content) {
  303. uni.navigateTo({
  304. url: '/subPages/home/richtext?content=' + encodeURIComponent(bannerItem.content)
  305. })
  306. }
  307. break
  308. default:
  309. console.log('未知的轮播图类型:', bannerItem.typ)
  310. }
  311. },
  312. // 跳转计划定制
  313. goPlan(id, type) {
  314. uni.navigateTo({
  315. url: '/subPages/home/plan?id=' + id + '&type=' + type
  316. })
  317. },
  318. goSearch() {
  319. uni.navigateTo({
  320. url: '/subPages/home/search'
  321. })
  322. },
  323. goBook(book) {
  324. uni.navigateTo({
  325. url: '/subPages/home/directory?id=' + book.id
  326. })
  327. },
  328. async getBanner() {
  329. const bannerRes = await this.$api.home.getBanner()
  330. if (bannerRes.code === 200){
  331. this.bannerList = bannerRes.result.map(item => ({
  332. image: item.img,
  333. title: item.title,
  334. typ: item.typ,
  335. bookId: item.bookId,
  336. video: item.video,
  337. content: item.content,
  338. id: item.id
  339. }))
  340. }
  341. },
  342. async getSignup() {
  343. const signupRes = await this.$api.home.getLink()
  344. if (signupRes.code === 200){
  345. this.recommendList = signupRes.result.map(item => ({
  346. img: item.img,
  347. id: item.id,
  348. type: item.type
  349. }))
  350. }
  351. },
  352. // 获取书籍分类
  353. async getCategory() {
  354. const categoryRes = await this.$api.book.category()
  355. if (categoryRes.code === 200){
  356. this.tabs = categoryRes.result.map(item => ({
  357. title:item.title,
  358. id: item.id
  359. }))
  360. }
  361. },
  362. // 获取书籍标签
  363. async getLabel() {
  364. const labelRes = await this.$api.book.label()
  365. if (labelRes.code === 200){
  366. this.labels = labelRes.result.map(item => ({
  367. title:item.lable,
  368. id: item.id
  369. }))
  370. }
  371. },
  372. // 根据label数组获取书籍数据
  373. async getBooksByLabels() {
  374. if (!this.labels || this.labels.length === 0) {
  375. console.log('labels数据为空,无法获取书籍')
  376. return
  377. }
  378. try {
  379. // 创建请求数组,每个label发起一次请求
  380. const requests = this.labels.map(label =>
  381. this.$api.book.list({
  382. label: label.id,
  383. pageNo: 1,
  384. pageSize: 6,
  385. category: this.tabs[this.activeTab].id
  386. }, false)
  387. )
  388. // 并发执行所有请求
  389. const responses = await Promise.all(requests)
  390. // 创建二维数组存储结果
  391. this.labelBooksData = responses.map((response, index) => {
  392. if (response.code === 200) {
  393. return {
  394. labelInfo: this.labels[index],
  395. books: response.result.records || []
  396. }
  397. } else {
  398. console.error(`获取label ${this.labels[index].title} 的书籍失败:`, response)
  399. return {
  400. labelInfo: this.labels[index],
  401. books: []
  402. }
  403. }
  404. })
  405. console.log('根据label获取的书籍数据:', this.labelBooksData)
  406. } catch (error) {
  407. console.error('获取书籍数据失败:', error)
  408. this.labelBooksData = []
  409. }
  410. },
  411. goLabel(label){
  412. uni.navigateTo({
  413. url: '/subPages/home/search?label=' + label.id
  414. })
  415. },
  416. // 关闭视频弹窗
  417. closeVideoModal() {
  418. this.$refs.videoModal.close()
  419. this.currentVideo = ''
  420. },
  421. // 视频错误处理
  422. onVideoError(e) {
  423. console.error('视频播放错误:', e)
  424. uni.showToast({
  425. title: '视频播放失败',
  426. icon: 'error'
  427. })
  428. this.closeVideoModal()
  429. },
  430. // 视频开始播放
  431. onVideoPlay() {
  432. console.log('视频开始播放')
  433. },
  434. // 视频暂停
  435. onVideoPause() {
  436. console.log('视频暂停播放')
  437. }
  438. },
  439. async onShow() {
  440. // 检测设备类型
  441. this.detectDevice()
  442. // 先获取基础数据
  443. await Promise.all([this.getBanner(), this.getSignup(), this.getCategory(), this.getLabel()])
  444. // 根据label数据获取对应的书籍
  445. await this.getBooksByLabels()
  446. },
  447. mounted() {
  448. // 页面挂载时也检测一次设备类型
  449. this.detectDevice()
  450. // #ifdef H5
  451. // 监听窗口大小变化
  452. window.addEventListener('resize', this.detectDevice)
  453. // #endif
  454. },
  455. beforeDestroy() {
  456. // #ifdef H5
  457. // 移除事件监听
  458. window.removeEventListener('resize', this.detectDevice)
  459. // #endif
  460. }
  461. }
  462. </script>
  463. <style lang="scss" scoped>
  464. .home-container {
  465. background: #fff;
  466. min-height: 100vh;
  467. padding-bottom: 80rpx;
  468. }
  469. // 顶部搜索栏
  470. .header {
  471. display: flex;
  472. align-items: center;
  473. padding: 6rpx 32rpx;
  474. background: #fff;
  475. .search-container {
  476. flex: 1;
  477. }
  478. }
  479. // Tab栏
  480. .tab-container {
  481. background: #fff;
  482. // border-bottom: 1px solid #f0f0f0;
  483. top: 0;
  484. left: 0;
  485. right: 0;
  486. z-index: 999;
  487. .tab-scroll {
  488. white-space: nowrap;
  489. .tab-list {
  490. display: flex;
  491. padding: 0 20rpx;
  492. .tab-item {
  493. flex-shrink: 0;
  494. padding: 20rpx 20rpx;
  495. font-size: 32rpx;
  496. color: #666;
  497. position: relative;
  498. &.active {
  499. color: $primary-text-color;
  500. font-weight: 700;
  501. &::after {
  502. content: '';
  503. position: absolute;
  504. bottom: 0;
  505. left: 50%;
  506. transform: translateX(-50%);
  507. width: 22rpx;
  508. height: 4rpx;
  509. background: $primary-text-color;
  510. border-radius: 2rpx;
  511. }
  512. }
  513. }
  514. }
  515. }
  516. }
  517. // 轮播图容器
  518. .swiper-container {
  519. margin: 20rpx;
  520. border-radius: 12rpx;
  521. overflow: hidden;
  522. // 平板设备的轮播图样式
  523. &.tablet-swiper {
  524. margin: 30rpx 0;
  525. border-radius: 16rpx;
  526. // 卡片式轮播的额外样式
  527. :deep(.uv-swiper) {
  528. .swiper-slide {
  529. transition: all 0.3s ease;
  530. transform-origin: center;
  531. // 非激活状态的卡片
  532. &:not(.swiper-slide-active) {
  533. transform: scale(0.9);
  534. opacity: 0.7;
  535. }
  536. // 激活状态的卡片
  537. &.swiper-slide-active {
  538. transform: scale(1);
  539. opacity: 1;
  540. z-index: 2;
  541. }
  542. }
  543. // 调整指示器位置
  544. .uv-swiper__indicator {
  545. bottom: -40rpx;
  546. }
  547. }
  548. }
  549. }
  550. // 内容区块
  551. .section {
  552. margin-top: 40rpx;
  553. .section-header {
  554. display: flex;
  555. align-items: center;
  556. justify-content: space-between;
  557. padding: 0 30rpx ;
  558. margin-bottom: 24rpx;
  559. .section-title {
  560. font-size: 36rpx;
  561. // font-weight: 600;
  562. color: $primary-text-color;
  563. }
  564. .section-more {
  565. display: flex;
  566. align-items: center;
  567. gap: 4rpx;
  568. text {
  569. font-size: 24rpx;
  570. color: $secondary-text-color;
  571. }
  572. }
  573. }
  574. .content-scroll {
  575. white-space: nowrap;
  576. }
  577. }
  578. // 今日更新列表
  579. .content-list {
  580. display: flex;
  581. padding: 0 30rpx;
  582. gap: 32rpx;
  583. .content-item {
  584. flex-shrink: 0;
  585. width: 602rpx;
  586. height: 212rpx;
  587. display: flex;
  588. align-items: center;
  589. background: #F8F8F8;
  590. padding: 16rpx;
  591. border-radius: 16rpx;
  592. gap: 16rpx;
  593. .item-cover {
  594. width: 136rpx;
  595. height: 200rpx;
  596. border-radius: 16rpx;
  597. // overflow: hidden;
  598. image {
  599. width: 136rpx;
  600. height: 200rpx;
  601. }
  602. }
  603. .item-info {
  604. // padding-top: 20rpx;
  605. gap: 16rpx;
  606. display: flex;
  607. flex-direction: column;
  608. .item-title {
  609. font-size: 32rpx;
  610. font-weight: 700;
  611. color: $primary-text-color;
  612. letter-spacing: 0;
  613. line-height: 48rpx;
  614. // margin-bottom: 12rpx;
  615. overflow: hidden;
  616. text-overflow: ellipsis;
  617. white-space: nowrap;
  618. }
  619. .item-author {
  620. font-size: 24rpx;
  621. color: $secondary-text-color;
  622. // margin-bottom: 8rpx;
  623. letter-spacing: 0;
  624. overflow: hidden;
  625. text-overflow: ellipsis;
  626. white-space: nowrap;
  627. }
  628. .item-duration {
  629. gap: 12rpx;
  630. display: flex;
  631. align-items: center;
  632. font-size: 22rpx;
  633. letter-spacing: 0;
  634. color: $secondary-text-color;
  635. .item-icon{
  636. width: 22rpx;
  637. height: 25rpx;
  638. }
  639. }
  640. }
  641. }
  642. }
  643. // 推荐书籍列表
  644. .book-list {
  645. display: flex;
  646. padding: 0 30rpx;
  647. gap: 32rpx;
  648. .book-item {
  649. flex-shrink: 0;
  650. width: 270rpx;
  651. transition: transform 0.3s ease, box-shadow 0.3s ease;
  652. &:active {
  653. transform: scale(0.98);
  654. }
  655. .book-cover {
  656. width: 100%;
  657. height: 360rpx;
  658. border-radius: 16rpx;
  659. overflow: hidden;
  660. position: relative;
  661. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
  662. transition: box-shadow 0.3s ease, transform 0.3s ease;
  663. &:active {
  664. box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.25);
  665. transform: translateY(-2rpx);
  666. }
  667. image {
  668. width: 100%;
  669. height: 100%;
  670. transition: transform 0.3s ease;
  671. }
  672. .book-overlay {
  673. position: absolute;
  674. bottom: 0;
  675. left: 0;
  676. right: 0;
  677. width: 100%;
  678. height: 140rpx;
  679. padding: 20rpx 16rpx 12rpx;
  680. box-sizing: border-box;
  681. /* 优化的渐变遮罩效果 */
  682. background: linear-gradient(
  683. 180deg,
  684. rgba(0, 0, 0, 0) 0%,
  685. rgba(0, 0, 0, 0.3) 30%,
  686. rgba(0, 0, 0, 0.7) 70%,
  687. rgba(0, 0, 0, 0.85) 100%
  688. );
  689. /* 增强的毛玻璃效果 */
  690. backdrop-filter: blur(8px) saturate(1.2);
  691. -webkit-backdrop-filter: blur(8px) saturate(1.2);
  692. /* 添加微妙的边框 */
  693. border-top: 1px solid rgba(255, 255, 255, 0.1);
  694. /* 平滑过渡效果 */
  695. transition: all 0.3s ease;
  696. .book-duration{
  697. display: flex;
  698. align-items: center;
  699. gap: 6rpx;
  700. margin-bottom: 8rpx;
  701. &-icon{
  702. width: 22rpx;
  703. height: 22rpx;
  704. opacity: 0.9;
  705. }
  706. &-text{
  707. font-size: 20rpx;
  708. font-weight: 500;
  709. color: rgba(255, 255, 255, 0.9);
  710. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  711. }
  712. }
  713. .book-title {
  714. max-width: 220rpx;
  715. font-size: 24rpx;
  716. font-weight: 600;
  717. line-height: 1.3;
  718. color: #ffffff;
  719. text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  720. /* 文本截断优化 */
  721. display: -webkit-box;
  722. -webkit-box-orient: vertical;
  723. -webkit-line-clamp: 2;
  724. overflow: hidden;
  725. word-break: break-word;
  726. white-space: normal;
  727. }
  728. }
  729. }
  730. }
  731. }
  732. // 书籍网格布局
  733. .book-grid {
  734. display: flex;
  735. flex-wrap: wrap;
  736. padding: 0 30rpx;
  737. gap: 32rpx;
  738. .book-grid-item {
  739. width: 208rpx;
  740. display: flex;
  741. flex-direction: column;
  742. // backdrop-filter: red;
  743. .book-grid-cover {
  744. box-shadow: 0px 4px 4px 0px #C0BCBA75;
  745. width: 100%;
  746. height: 278rpx;
  747. border-radius: 16rpx;
  748. overflow: hidden;
  749. margin-bottom: 16rpx;
  750. image {
  751. width: 100%;
  752. height: 100%;
  753. }
  754. }
  755. .book-grid-info {
  756. width: 208rpx;
  757. padding: 6rpx;
  758. overflow: hidden;
  759. text-overflow: ellipsis;
  760. white-space: nowrap;
  761. .book-grid-title {
  762. font-size: 28rpx;
  763. font-weight: 700;
  764. color: $primary-text-color;
  765. margin-bottom: 14rpx;
  766. }
  767. .book-grid-meta {
  768. display: flex;
  769. align-items: center;
  770. // gap: 16rpx;
  771. .book-grid-duration-icon {
  772. width: 24rpx;
  773. height: 24rpx;
  774. margin-right: 12rpx;
  775. }
  776. .book-grid-grade {
  777. font-size: 24rpx;
  778. color: $secondary-text-color;
  779. margin-right: 8rpx;
  780. }
  781. .book-grid-duration {
  782. font-size: 24rpx;
  783. color: $secondary-text-color;
  784. }
  785. }
  786. }
  787. }
  788. }
  789. // 推荐列表样式
  790. .recommend-list {
  791. padding: 0 30rpx;
  792. .recommend-item {
  793. width: 100%;
  794. height: 200rpx;
  795. margin-bottom: 48rpx;
  796. border-radius: 32rpx;
  797. overflow: hidden;
  798. &:last-child {
  799. margin-bottom: 0;
  800. }
  801. .recommend-image {
  802. width: 100%;
  803. height: 100%;
  804. }
  805. }
  806. }
  807. // 视频弹窗样式
  808. .video-container {
  809. position: relative;
  810. // padding: 20rpx 0;
  811. width: 90vw;
  812. .video-loading {
  813. display: flex;
  814. align-items: center;
  815. justify-content: center;
  816. height: 400rpx;
  817. background: #f5f5f5;
  818. border-radius: 8rpx;
  819. text {
  820. font-size: 28rpx;
  821. color: #999;
  822. }
  823. }
  824. }
  825. </style>