ArticleBookshelf.vue 23 KB

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