ArticleBookshelf.vue 24 KB

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