ArticleBookshelf.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. <template>
  2. <view class="bs-section">
  3. <!-- 书册头部 -->
  4. <view class="bs-header">
  5. <view class="bs-header-left">
  6. <text class="bs-book-icon">&#x1F4DA;</text>
  7. <view class="bs-header-text">
  8. <text class="bs-title">推荐阅读</text>
  9. <text class="bs-subtitle">Knowledge · 知识</text>
  10. </view>
  11. </view>
  12. <view class="bs-header-right" @click="$emit('moreArticles')">
  13. <text class="bs-more-text">书库</text>
  14. <text class="bs-more-arrow">&#x203A;</text>
  15. </view>
  16. </view>
  17. <!-- 无数据 -->
  18. <view v-if="(!articles || articles.length === 0) && !loading" class="bs-empty">
  19. <text class="bs-empty-text">书册整理中,敬请期待...</text>
  20. </view>
  21. <!-- 骨架屏 -->
  22. <view v-else-if="loading && (!articles || articles.length === 0)" class="bs-shelf-skeleton">
  23. <view class="bs-skeleton-shelf">
  24. <view v-for="n in 3" :key="n" class="bs-skeleton-book"></view>
  25. </view>
  26. </view>
  27. <!-- 书册展示区 -->
  28. <view v-else class="bs-bookcase">
  29. <!-- 书架装饰线 -->
  30. <view class="bs-shelf-top-border"></view>
  31. <!-- 书籍横向滚动(每屏3本) -->
  32. <scroll-view
  33. scroll-x
  34. class="bs-books-scroll"
  35. :scroll-left="scrollLeft"
  36. scroll-with-animation
  37. :show-scrollbar="false"
  38. @scroll="onScroll"
  39. >
  40. <view class="bs-books-inner">
  41. <!-- 左内边距起始 -->
  42. <view class="bs-book-spacer"></view>
  43. <!-- 书籍列表 -->
  44. <view
  45. v-for="(article, idx) in displayArticles"
  46. :key="idx"
  47. class="bs-book-wrap"
  48. @click="openSpread(idx)"
  49. >
  50. <!-- 竖版封面主体 -->
  51. <view
  52. class="bs-book-cover"
  53. :style="{
  54. background: getBookColor(article, idx)
  55. }"
  56. >
  57. <!-- 封面图 -->
  58. <image
  59. v-if="article.coverImage"
  60. class="bs-cover-img"
  61. :src="article.coverImage"
  62. mode="aspectFill"
  63. />
  64. <!-- 无封面图时:渐变底 + 书名 -->
  65. <view v-else class="bs-cover-text">
  66. <text
  67. class="bs-cover-title"
  68. :style="{ color: getTextColor(article, idx) }"
  69. >{{ article.title }}</text>
  70. </view>
  71. <!-- 底部分类标签 -->
  72. <view class="bs-cover-bottom">
  73. <text
  74. class="bs-cover-category"
  75. :style="{
  76. background: getTextColor(article, idx),
  77. color: getBookColor(article, idx)
  78. }"
  79. >{{ getCategoryLabel(article) }}</text>
  80. </view>
  81. <!-- 右侧书页切边(3D效果) -->
  82. <view class="bs-cover-edge"></view>
  83. </view>
  84. <!-- 封面底部阴影(书架效果) -->
  85. <view class="bs-book-shadow"></view>
  86. </view>
  87. <!-- 右内边距结尾 -->
  88. <view class="bs-book-spacer"></view>
  89. </view>
  90. </scroll-view>
  91. <!-- 书架底板装饰 -->
  92. <view class="bs-shelf-bottom">
  93. <view class="bs-shelf-plank"></view>
  94. <view class="bs-shelf-bracket bs-shelf-bracket-left"></view>
  95. <view class="bs-shelf-bracket bs-shelf-bracket-right"></view>
  96. </view>
  97. <!-- 翻页指示器 -->
  98. <view class="bs-page-dots" v-if="displayArticles.length > 3">
  99. <view
  100. v-for="n in dotCount"
  101. :key="n"
  102. class="bs-dot"
  103. :class="{ 'bs-dot-active': isActiveDot(n) }"
  104. ></view>
  105. </view>
  106. </view>
  107. <!-- 杂志展开页(点击书籍后显示) -->
  108. <view
  109. class="bs-spread-overlay"
  110. v-if="spreadActive"
  111. @click="closeSpread"
  112. >
  113. <view class="bs-spread" @click.stop="">
  114. <!-- 关闭按钮 -->
  115. <view class="bs-spread-close" @click="closeSpread">
  116. <text class="bs-spread-close-text">&#x2715;</text>
  117. </view>
  118. <!-- 杂志页眉 -->
  119. <view class="bs-spread-header">
  120. <view class="bs-spread-header-line"></view>
  121. <text class="bs-spread-header-title">&#x1F4DA; 阅读精选</text>
  122. <view class="bs-spread-header-line"></view>
  123. </view>
  124. <!-- 双页展开 -->
  125. <view class="bs-spread-pages">
  126. <!-- 左页 -->
  127. <view
  128. class="bs-spread-page bs-spread-page-left"
  129. v-if="spreadArticles[0]"
  130. @click="$emit('articleClick', spreadArticles[0])"
  131. >
  132. <view class="bs-spread-page-cover" v-if="spreadArticles[0].coverImage">
  133. <image
  134. class="bs-spread-cover-img"
  135. :src="spreadArticles[0].coverImage"
  136. mode="aspectFill"
  137. />
  138. <view
  139. class="bs-spread-cover-overlay"
  140. :style="{ background: getBookColor(spreadArticles[0], 0) }"
  141. ></view>
  142. </view>
  143. <view class="bs-spread-page-body">
  144. <text class="bs-spread-page-category" :style="{ color: getBookColor(spreadArticles[0], 0) }">
  145. {{ getCategoryLabel(spreadArticles[0]) }}
  146. </text>
  147. <text class="bs-spread-page-title">{{ spreadArticles[0].title }}</text>
  148. <text class="bs-spread-page-summary" v-if="spreadArticles[0].summary">
  149. {{ spreadArticles[0].summary }}
  150. </text>
  151. <view class="bs-spread-page-footer">
  152. <text class="bs-spread-page-author" v-if="spreadArticles[0].author">
  153. {{ spreadArticles[0].author }}
  154. </text>
  155. <text class="bs-spread-page-date" v-if="spreadArticles[0].date">
  156. {{ spreadArticles[0].date }}
  157. </text>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 书脊分隔 -->
  162. <view class="bs-spread-spine"></view>
  163. <!-- 右页 -->
  164. <view
  165. class="bs-spread-page bs-spread-page-right"
  166. v-if="spreadArticles[1]"
  167. @click="$emit('articleClick', spreadArticles[1])"
  168. >
  169. <view class="bs-spread-page-cover" v-if="spreadArticles[1].coverImage">
  170. <image
  171. class="bs-spread-cover-img"
  172. :src="spreadArticles[1].coverImage"
  173. mode="aspectFill"
  174. />
  175. <view
  176. class="bs-spread-cover-overlay"
  177. :style="{ background: getBookColor(spreadArticles[1], 1) }"
  178. ></view>
  179. </view>
  180. <view class="bs-spread-page-body">
  181. <text class="bs-spread-page-category" :style="{ color: getBookColor(spreadArticles[1], 1) }">
  182. {{ getCategoryLabel(spreadArticles[1]) }}
  183. </text>
  184. <text class="bs-spread-page-title">{{ spreadArticles[1].title }}</text>
  185. <text class="bs-spread-page-summary" v-if="spreadArticles[1].summary">
  186. {{ spreadArticles[1].summary }}
  187. </text>
  188. <view class="bs-spread-page-footer">
  189. <text class="bs-spread-page-author" v-if="spreadArticles[1].author">
  190. {{ spreadArticles[1].author }}
  191. </text>
  192. <text class="bs-spread-page-date" v-if="spreadArticles[1].date">
  193. {{ spreadArticles[1].date }}
  194. </text>
  195. </view>
  196. </view>
  197. </view>
  198. <!-- 无右页时占位 -->
  199. <view class="bs-spread-page bs-spread-page-right bs-spread-page-empty" v-else>
  200. <view class="bs-spread-empty-inner">
  201. <text class="bs-spread-empty-icon">&#x1F4D6;</text>
  202. <text class="bs-spread-empty-text">更多好文</text>
  203. <text class="bs-spread-empty-text2">即将上架</text>
  204. </view>
  205. </view>
  206. </view>
  207. <!-- 翻页提示 -->
  208. <view class="bs-spread-hint">
  209. <text class="bs-spread-hint-text">点击封面阅读全文</text>
  210. <text class="bs-spread-hint-text" @click="prevSpreadPair">&#x25C0; 上一页</text>
  211. <text class="bs-spread-hint-text" @click="nextSpreadPair">下一页 &#x25B6;</text>
  212. </view>
  213. </view>
  214. </view>
  215. </view>
  216. </template>
  217. <script>
  218. // 五维配色体系(书脊颜色)
  219. var DIMENSION_COLORS = {
  220. body: { bg: 'linear-gradient(180deg, #FF8C42 0%, #E8762A 100%)', text: '#FFF5EE' },
  221. mind: { bg: 'linear-gradient(180deg, #FF6B9D 0%, #E84A7F 100%)', text: '#FFF0F5' },
  222. wisdom: { bg: 'linear-gradient(180deg, #6366F1 0%, #4F46E5 100%)', text: '#EEF2FF' },
  223. action: { bg: 'linear-gradient(180deg, #10B981 0%, #059669 100%)', text: '#ECFDF5' },
  224. wealth: { bg: 'linear-gradient(180deg, #F59E0B 0%, #D97706 100%)', text: '#FFFBEB' }
  225. }
  226. // 回退渐变(用于无维度分类的文章)
  227. var FALLBACK_GRADIENTS = [
  228. { bg: 'linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%)', text: '#F5F3FF' },
  229. { bg: 'linear-gradient(180deg, #06B6D4 0%, #0891B2 100%)', text: '#ECFEFF' },
  230. { bg: 'linear-gradient(180deg, #EC4899 0%, #DB2777 100%)', text: '#FDF2F8' },
  231. { bg: 'linear-gradient(180deg, #14B8A6 0%, #0D9488 100%)', text: '#F0FDFA' },
  232. { bg: 'linear-gradient(180deg, #F97316 0%, #EA580C 100%)', text: '#FFF7ED' }
  233. ]
  234. export default {
  235. name: 'ArticleBookshelf',
  236. props: {
  237. articles: { type: Array, default: function() { return [] } },
  238. loading: { type: Boolean, default: false },
  239. isLoggedIn: { type: Boolean, default: false }
  240. },
  241. data: function() {
  242. return {
  243. spreadActive: false,
  244. spreadIndex: 0,
  245. scrollLeft: 0,
  246. activeDot: 1
  247. }
  248. },
  249. computed: {
  250. // 每屏 3 本,指示器数量 = ceil(n/3)
  251. dotCount: function() {
  252. return Math.max(1, Math.ceil(this.displayArticles.length / 3))
  253. },
  254. displayArticles: function() {
  255. if (!this.articles || this.articles.length === 0) {
  256. return [
  257. { title: '培养孩子自驱力的关键', category: '家庭成长', summary: '如何帮助孩子建立内在动机' },
  258. { title: '五维能量与家庭健康管理', category: '健康科普', summary: '科学理解健康的五个维度' },
  259. { title: '亲子沟通的心理学智慧', category: '心理养育', summary: '有效的倾听与表达技巧' },
  260. { title: '规划师推荐的书单', category: '成长规划', summary: '培养未来领导力的阅读路径' },
  261. { title: '儿童营养均衡完全指南', category: '营养健康', summary: '0-12岁各阶段营养需求' }
  262. ]
  263. }
  264. return this.articles.slice(0, 12)
  265. },
  266. spreadArticles: function() {
  267. var base = this.spreadIndex * 2
  268. return [
  269. this.displayArticles[base],
  270. this.displayArticles[base + 1]
  271. ].filter(function(a) { return a })
  272. },
  273. maxSpreadIndex: function() {
  274. return Math.floor((this.displayArticles.length - 1) / 2)
  275. }
  276. },
  277. methods: {
  278. getBookColor: function(article, idx) {
  279. if (article && article.relatedDimensions) {
  280. var dims = article.relatedDimensions.split(',')
  281. var firstDim = (dims[0] || '').trim().toLowerCase()
  282. if (DIMENSION_COLORS[firstDim]) {
  283. return DIMENSION_COLORS[firstDim].bg
  284. }
  285. }
  286. if (article && article.dimensionCode && DIMENSION_COLORS[article.dimensionCode]) {
  287. return DIMENSION_COLORS[article.dimensionCode].bg
  288. }
  289. return FALLBACK_GRADIENTS[idx % FALLBACK_GRADIENTS.length].bg
  290. },
  291. getTextColor: function(article, idx) {
  292. if (article && article.relatedDimensions) {
  293. var dims = article.relatedDimensions.split(',')
  294. var firstDim = (dims[0] || '').trim().toLowerCase()
  295. if (DIMENSION_COLORS[firstDim]) {
  296. return DIMENSION_COLORS[firstDim].text
  297. }
  298. }
  299. if (article && article.dimensionCode && DIMENSION_COLORS[article.dimensionCode]) {
  300. return DIMENSION_COLORS[article.dimensionCode].text
  301. }
  302. return FALLBACK_GRADIENTS[idx % FALLBACK_GRADIENTS.length].text
  303. },
  304. getCategoryLabel: function(article) {
  305. if (!article) return '推荐'
  306. if (article.categoryName) return article.categoryName
  307. if (article.category) return article.category
  308. return '推荐'
  309. },
  310. // 滚动时计算当前指示器位置(每 3 本一组)
  311. onScroll: function(e) {
  312. var scrollLeft = e.detail.scrollLeft || 0
  313. // 每本封面宽 200rpx + 间距 24rpx ≈ 224rpx/本;scrollLeft 为 px,需转 px 后按 3 本一组
  314. var groupWidth = uni.upx2px(224) * 3
  315. var groupIndex = Math.floor(scrollLeft / groupWidth)
  316. this.activeDot = Math.min(groupIndex + 1, this.dotCount)
  317. },
  318. openSpread: function(idx) {
  319. this.spreadIndex = Math.floor(idx / 2)
  320. this.spreadActive = true
  321. },
  322. closeSpread: function() {
  323. this.spreadActive = false
  324. },
  325. prevSpreadPair: function() {
  326. if (this.spreadIndex > 0) {
  327. this.spreadIndex--
  328. } else {
  329. this.spreadIndex = this.maxSpreadIndex
  330. }
  331. },
  332. nextSpreadPair: function() {
  333. if (this.spreadIndex < this.maxSpreadIndex) {
  334. this.spreadIndex++
  335. } else {
  336. this.spreadIndex = 0
  337. }
  338. },
  339. isActiveDot: function(dotIndex) {
  340. return dotIndex === this.activeDot
  341. }
  342. }
  343. }
  344. </script>
  345. <style scoped>
  346. /* ======================================
  347. ArticleBookshelf — 书册风格推荐阅读组件
  348. 浠艾福 (Care Family) 设计系统
  349. ====================================== */
  350. /* ---- Section Container ---- */
  351. .bs-section {
  352. margin: 24rpx 0;
  353. padding: 0 0 16rpx;
  354. }
  355. /* ---- Header ---- */
  356. .bs-header {
  357. display: flex;
  358. flex-direction: row;
  359. align-items: center;
  360. justify-content: space-between;
  361. padding: 0 32rpx 20rpx;
  362. }
  363. .bs-header-left {
  364. display: flex;
  365. flex-direction: row;
  366. align-items: center;
  367. }
  368. .bs-book-icon {
  369. font-size: 48rpx;
  370. margin-right: 14rpx;
  371. line-height: 1;
  372. }
  373. .bs-header-text {
  374. display: flex;
  375. flex-direction: column;
  376. }
  377. .bs-title {
  378. font-size: 34rpx;
  379. font-weight: 700;
  380. color: #1a1a2e;
  381. letter-spacing: 2rpx;
  382. line-height: 1.2;
  383. }
  384. .bs-subtitle {
  385. font-size: 20rpx;
  386. color: #9CA3AF;
  387. font-family: 'Georgia', serif;
  388. font-style: italic;
  389. margin-top: 2rpx;
  390. }
  391. .bs-header-right {
  392. display: flex;
  393. flex-direction: row;
  394. align-items: center;
  395. padding: 8rpx 16rpx;
  396. background: rgba(91, 155, 213, 0.08);
  397. border-radius: 20rpx;
  398. }
  399. .bs-more-text {
  400. font-size: 22rpx;
  401. color: #5B9BD5;
  402. font-weight: 500;
  403. }
  404. .bs-more-arrow {
  405. font-size: 28rpx;
  406. color: #5B9BD5;
  407. margin-left: 4rpx;
  408. }
  409. /* ---- Empty State ---- */
  410. .bs-empty {
  411. padding: 40rpx 0;
  412. display: flex;
  413. justify-content: center;
  414. }
  415. .bs-empty-text {
  416. font-size: 24rpx;
  417. color: #9CA3AF;
  418. font-family: 'Georgia', serif;
  419. font-style: italic;
  420. }
  421. /* ---- Skeleton ---- */
  422. .bs-shelf-skeleton {
  423. padding: 0 28rpx;
  424. }
  425. .bs-skeleton-shelf {
  426. display: flex;
  427. flex-direction: row;
  428. align-items: flex-start;
  429. gap: 24rpx;
  430. padding-top: 16rpx;
  431. }
  432. .bs-skeleton-book {
  433. width: 200rpx;
  434. height: 280rpx;
  435. border-radius: 8rpx;
  436. background: linear-gradient(180deg, #e8e8e8 0%, #f0f0f0 50%, #e8e8e8 100%);
  437. background-size: 200% 100%;
  438. animation: skeleton-wave 1.4s ease-in-out infinite;
  439. flex-shrink: 0;
  440. }
  441. @keyframes skeleton-wave {
  442. 0% { background-position: 200% 0; }
  443. 100% { background-position: -200% 0; }
  444. }
  445. /* ---- Bookcase ---- */
  446. .bs-bookcase {
  447. position: relative;
  448. }
  449. /* 书架顶部装饰线 */
  450. .bs-shelf-top-border {
  451. height: 6rpx;
  452. margin: 0 28rpx;
  453. background: linear-gradient(90deg,
  454. transparent 0%,
  455. #8B7355 10%,
  456. #A0896A 30%,
  457. #C4A882 50%,
  458. #A0896A 70%,
  459. #8B7355 90%,
  460. transparent 100%
  461. );
  462. border-radius: 3rpx;
  463. }
  464. /* ---- Books Scroll ---- */
  465. .bs-books-scroll {
  466. white-space: nowrap;
  467. padding: 20rpx 0 0;
  468. width: 100%;
  469. }
  470. .bs-books-inner {
  471. display: inline-flex;
  472. flex-direction: row;
  473. align-items: flex-start;
  474. }
  475. .bs-book-spacer {
  476. width: 28rpx;
  477. flex-shrink: 0;
  478. }
  479. /* ---- Single Book (竖版封面) ---- */
  480. .bs-book-wrap {
  481. display: flex;
  482. flex-direction: column;
  483. align-items: center;
  484. flex-shrink: 0;
  485. margin-right: 24rpx;
  486. position: relative;
  487. }
  488. .bs-book-cover {
  489. width: 200rpx;
  490. height: 280rpx;
  491. border-radius: 8rpx 8rpx 4rpx 4rpx;
  492. position: relative;
  493. display: flex;
  494. align-items: center;
  495. justify-content: center;
  496. overflow: hidden;
  497. box-shadow:
  498. 4rpx 0 10rpx rgba(0,0,0,0.18),
  499. -2rpx 0 4rpx rgba(0,0,0,0.08),
  500. 0 6rpx 14rpx rgba(0,0,0,0.12);
  501. transition: transform 0.18s, box-shadow 0.18s;
  502. }
  503. .bs-book-wrap:active .bs-book-cover {
  504. transform: translateY(-6rpx) scale(1.02);
  505. box-shadow:
  506. 6rpx 0 14rpx rgba(0,0,0,0.25),
  507. -3rpx 0 6rpx rgba(0,0,0,0.1),
  508. 0 10rpx 22rpx rgba(0,0,0,0.18);
  509. }
  510. /* 封面图 */
  511. .bs-cover-img {
  512. width: 100%;
  513. height: 100%;
  514. }
  515. /* 无封面图时:渐变底 + 书名 */
  516. .bs-cover-text {
  517. width: 100%;
  518. height: 100%;
  519. display: flex;
  520. align-items: center;
  521. justify-content: center;
  522. padding: 20rpx 16rpx;
  523. box-sizing: border-box;
  524. }
  525. .bs-cover-title {
  526. font-size: 24rpx;
  527. font-weight: 700;
  528. line-height: 1.5;
  529. letter-spacing: 1rpx;
  530. text-align: center;
  531. overflow: hidden;
  532. text-overflow: ellipsis;
  533. display: -webkit-box;
  534. -webkit-line-clamp: 4;
  535. -webkit-box-orient: vertical;
  536. word-break: break-all;
  537. }
  538. /* 底部分类标签 */
  539. .bs-cover-bottom {
  540. position: absolute;
  541. bottom: 0;
  542. left: 0;
  543. right: 0;
  544. display: flex;
  545. justify-content: center;
  546. padding: 10rpx 0 12rpx;
  547. background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.25) 100%);
  548. }
  549. .bs-cover-category {
  550. font-size: 16rpx;
  551. font-weight: 600;
  552. padding: 3rpx 8rpx;
  553. border-radius: 4rpx;
  554. max-width: 160rpx;
  555. overflow: hidden;
  556. text-overflow: ellipsis;
  557. white-space: nowrap;
  558. display: inline-block;
  559. text-align: center;
  560. }
  561. /* 右侧书页切边(3D效果) */
  562. .bs-cover-edge {
  563. position: absolute;
  564. top: 10rpx;
  565. bottom: 10rpx;
  566. right: 0;
  567. width: 6rpx;
  568. background: linear-gradient(180deg,
  569. rgba(0,0,0,0.25) 0%,
  570. rgba(0,0,0,0.1) 50%,
  571. rgba(0,0,0,0.2) 100%
  572. );
  573. border-radius: 0 4rpx 4rpx 0;
  574. }
  575. /* 封面底部投影(书架效果) */
  576. .bs-book-shadow {
  577. width: 160rpx;
  578. height: 14rpx;
  579. margin-top: 8rpx;
  580. border-radius: 50%;
  581. background: radial-gradient(ellipse at center, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 70%);
  582. flex-shrink: 0;
  583. }
  584. /* ---- 书架底板 ---- */
  585. .bs-shelf-bottom {
  586. position: relative;
  587. height: 24rpx;
  588. margin: 0 20rpx;
  589. }
  590. .bs-shelf-plank {
  591. position: absolute;
  592. bottom: 0;
  593. left: 0;
  594. right: 0;
  595. height: 14rpx;
  596. background: linear-gradient(180deg, #C4A882 0%, #A0896A 100%);
  597. border-radius: 2rpx;
  598. box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.15);
  599. }
  600. .bs-shelf-bracket {
  601. position: absolute;
  602. bottom: 6rpx;
  603. width: 16rpx;
  604. height: 20rpx;
  605. background: #8B7355;
  606. border-radius: 2rpx 2rpx 0 0;
  607. }
  608. .bs-shelf-bracket-left { left: 32rpx; }
  609. .bs-shelf-bracket-right { right: 32rpx; }
  610. /* ---- Page Dots ---- */
  611. .bs-page-dots {
  612. display: flex;
  613. flex-direction: row;
  614. justify-content: center;
  615. padding-top: 16rpx;
  616. gap: 8rpx;
  617. }
  618. .bs-dot {
  619. width: 10rpx;
  620. height: 10rpx;
  621. border-radius: 50%;
  622. background: #D1D5DB;
  623. transition: all 0.25s;
  624. }
  625. .bs-dot-active {
  626. background: #8B7355;
  627. width: 24rpx;
  628. border-radius: 5rpx;
  629. }
  630. /* ========================================
  631. Magazine Spread Overlay
  632. ======================================== */
  633. .bs-spread-overlay {
  634. position: fixed;
  635. top: 0;
  636. left: 0;
  637. right: 0;
  638. bottom: 0;
  639. background: rgba(0,0,0,0.6);
  640. z-index: 999;
  641. display: flex;
  642. align-items: center;
  643. justify-content: center;
  644. animation: fade-in 0.22s ease-out;
  645. }
  646. @keyframes fade-in {
  647. from { opacity: 0; }
  648. to { opacity: 1; }
  649. }
  650. .bs-spread {
  651. width: 90vw;
  652. height: 85vh;
  653. background: #FDFAF6;
  654. border-radius: 24rpx;
  655. position: relative;
  656. box-shadow: 0 20rpx 60rpx rgba(0,0,0,0.3);
  657. overflow: hidden;
  658. animation: slide-up 0.25s ease-out;
  659. }
  660. @keyframes slide-up {
  661. from { transform: translateY(40rpx); opacity: 0; }
  662. to { transform: translateY(0); opacity: 1; }
  663. }
  664. /* 关闭按钮 */
  665. .bs-spread-close {
  666. position: absolute;
  667. top: 20rpx;
  668. right: 24rpx;
  669. width: 56rpx;
  670. height: 56rpx;
  671. background: rgba(0,0,0,0.15);
  672. border-radius: 50%;
  673. display: flex;
  674. align-items: center;
  675. justify-content: center;
  676. z-index: 10;
  677. transition: background 0.15s;
  678. }
  679. .bs-spread-close:active {
  680. background: rgba(0,0,0,0.3);
  681. }
  682. .bs-spread-close-text {
  683. font-size: 28rpx;
  684. color: #fff;
  685. font-weight: bold;
  686. }
  687. /* 杂志页眉 */
  688. .bs-spread-header {
  689. display: flex;
  690. flex-direction: row;
  691. align-items: center;
  692. padding: 32rpx 48rpx 20rpx;
  693. gap: 16rpx;
  694. }
  695. .bs-spread-header-line {
  696. flex: 1;
  697. height: 2rpx;
  698. background: #C4A882;
  699. }
  700. .bs-spread-header-title {
  701. font-size: 26rpx;
  702. color: #8B7355;
  703. font-family: 'Georgia', serif;
  704. font-weight: 600;
  705. white-space: nowrap;
  706. }
  707. /* 双页布局 */
  708. .bs-spread-pages {
  709. display: flex;
  710. flex-direction: row;
  711. height: calc(100% - 140rpx);
  712. padding: 0 32rpx 24rpx;
  713. gap: 0;
  714. }
  715. .bs-spread-spine {
  716. width: 12rpx;
  717. background: linear-gradient(180deg, #C4A882 0%, #A0896A 50%, #8B7355 100%);
  718. flex-shrink: 0;
  719. box-shadow: 2rpx 0 8rpx rgba(0,0,0,0.2);
  720. border-radius: 2rpx;
  721. }
  722. .bs-spread-page {
  723. flex: 1;
  724. background: #FFFFFF;
  725. border-radius: 12rpx;
  726. overflow: hidden;
  727. display: flex;
  728. flex-direction: column;
  729. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.08);
  730. transition: transform 0.15s;
  731. }
  732. .bs-spread-page-left {
  733. border-radius: 12rpx 0 0 12rpx;
  734. }
  735. .bs-spread-page-right {
  736. border-radius: 0 12rpx 12rpx 0;
  737. }
  738. .bs-spread-page-empty {
  739. display: flex;
  740. align-items: center;
  741. justify-content: center;
  742. }
  743. .bs-spread-empty-inner {
  744. display: flex;
  745. flex-direction: column;
  746. align-items: center;
  747. }
  748. .bs-spread-empty-icon {
  749. font-size: 64rpx;
  750. margin-bottom: 16rpx;
  751. opacity: 0.3;
  752. }
  753. .bs-spread-empty-text {
  754. font-size: 28rpx;
  755. color: #C4A882;
  756. font-family: 'Georgia', serif;
  757. }
  758. .bs-spread-empty-text2 {
  759. font-size: 22rpx;
  760. color: #D1D5DB;
  761. margin-top: 8rpx;
  762. }
  763. .bs-spread-page-cover {
  764. width: 100%;
  765. height: 220rpx;
  766. position: relative;
  767. overflow: hidden;
  768. }
  769. .bs-spread-cover-img {
  770. width: 100%;
  771. height: 100%;
  772. }
  773. .bs-spread-cover-overlay {
  774. position: absolute;
  775. bottom: 0;
  776. left: 0;
  777. right: 0;
  778. height: 60rpx;
  779. opacity: 0.5;
  780. }
  781. .bs-spread-page-body {
  782. flex: 1;
  783. padding: 24rpx 28rpx;
  784. display: flex;
  785. flex-direction: column;
  786. }
  787. .bs-spread-page-category {
  788. font-size: 20rpx;
  789. font-weight: 700;
  790. margin-bottom: 10rpx;
  791. letter-spacing: 1rpx;
  792. }
  793. .bs-spread-page-title {
  794. font-size: 30rpx;
  795. font-weight: 700;
  796. color: #1a1a2e;
  797. line-height: 1.45;
  798. margin-bottom: 12rpx;
  799. display: block;
  800. overflow: hidden;
  801. text-overflow: ellipsis;
  802. display: -webkit-box;
  803. -webkit-line-clamp: 3;
  804. -webkit-box-orient: vertical;
  805. }
  806. .bs-spread-page-summary {
  807. font-size: 22rpx;
  808. color: #6B7280;
  809. line-height: 1.6;
  810. flex: 1;
  811. display: block;
  812. overflow: hidden;
  813. text-overflow: ellipsis;
  814. display: -webkit-box;
  815. -webkit-line-clamp: 4;
  816. -webkit-box-orient: vertical;
  817. }
  818. .bs-spread-page-footer {
  819. display: flex;
  820. flex-direction: row;
  821. align-items: center;
  822. justify-content: space-between;
  823. margin-top: 16rpx;
  824. padding-top: 12rpx;
  825. border-top: 1rpx solid #F3F4F6;
  826. }
  827. .bs-spread-page-author {
  828. font-size: 20rpx;
  829. color: #9CA3AF;
  830. }
  831. .bs-spread-page-date {
  832. font-size: 20rpx;
  833. color: #9CA3AF;
  834. }
  835. /* 翻页提示 */
  836. .bs-spread-hint {
  837. display: flex;
  838. flex-direction: row;
  839. align-items: center;
  840. justify-content: space-between;
  841. padding: 0 48rpx 24rpx;
  842. }
  843. .bs-spread-hint-text {
  844. font-size: 22rpx;
  845. color: #9CA3AF;
  846. }
  847. </style>