index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. <template>
  2. <view class="sell-container">
  3. <!-- 顶部背景图 -->
  4. <image class="top-bg-image" src="/pages-sell/static/top-bg.png" mode="widthFix"></image>
  5. <!-- 导航栏 -->
  6. <view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
  7. <view class="navbar-content">
  8. <text class="navbar-title">书嗨</text>
  9. <!-- 右侧胶囊占位,保持布局平衡 -->
  10. <view class="nav-right-placeholder"></view>
  11. </view>
  12. </view>
  13. <!-- 主要内容区域 -->
  14. <view class="main-content" :style="{ paddingTop: (statusBarHeight + 44) + 'px' }">
  15. <!-- 顶部固定区域:导航栏背景和搜索框 -->
  16. <view class="fixed-header-area" :style="{
  17. paddingTop: statusBarHeight + 44 + 'px',
  18. backgroundImage: scrollTop > 0 ? 'url(/pages-sell/static/top-bg.png)' : 'none',
  19. backgroundPosition: `center top`
  20. }">
  21. <view class="search-wrapper" @click="navigateTo('/pages-sell/pages/search')">
  22. <view class="search-box-uview">
  23. <u-search placeholder="搜索关键字" :show-action="false" bg-color="transparent" height="40"
  24. :clearabled="true" v-model="keyword" :disabled="true"
  25. search-icon="/pages-sell/static/search-icon.png"></u-search>
  26. <view class="search-btn-overlay">
  27. <text>搜索</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 占位,防止内容被 fixed 区域遮挡 -->
  33. <view class="search-placeholder"></view>
  34. <!-- tab标签 -->
  35. <!-- <view class="tabs-wrapper">
  36. <u-tabs :list="hotTagList" :current="currentHotTag" @change="changeHotTag" bgColor="transparent"
  37. lineColor="transparent" :active-item-style="{ fontWeight: 'bold', color: '#333' }"
  38. inactive-color="#3C4F3E" :barStyle="barStyle" :bar-height="27" :bar-width="52"></u-tabs>
  39. </view> -->
  40. <!-- 顶部横幅 Banner -->
  41. <view class="top-banner-wrapper">
  42. <image src="/pages-sell/static/top-banner.png" class="top-banner-img" mode="widthFix"></image>
  43. </view>
  44. <!-- 金刚区分类图标 (2行5列) -->
  45. <view class="category-grid">
  46. <view class="grid-item" v-for="(item, index) in categoryList" :key="index"
  47. @click="handleCategory(item)">
  48. <view class="icon-circle">
  49. <image :src="item.imgUrl" class="cat-icon" mode="aspectFit"></image>
  50. </view>
  51. <text class="cat-name">{{ item.showCateName || '-' }}</text>
  52. </view>
  53. </view>
  54. <!-- 推广与热销双卡片 -->
  55. <view class="promo-dual-card">
  56. <!-- 左侧:推广卖书 -->
  57. <view class="card-left">
  58. <view class="card-content">
  59. <u-swiper :list="swiperList" :autoplay="true" :interval="3000" name="imgUrl"></u-swiper>
  60. </view>
  61. </view>
  62. <!-- 右侧:热销商品 -->
  63. <view class="card-right">
  64. <view class="right-header" @click="navigateTo('/pages-sell/pages/hot-sell')">
  65. <image src="/pages-sell/static/icon-fire.png" class="fire-icon" mode="widthFix"></image>
  66. <text class="right-title">热销商品</text>
  67. <image src="/pages-sell/static/icon-fire.png" class="fire-icon flip" mode="widthFix"></image>
  68. </view>
  69. <view class="products-container">
  70. <!-- 使用网络图片作为书的封面占位 -->
  71. <image v-for="(item, index) in bookList" :key="index" :src="item.imgUrl" class="product-cover"
  72. mode="aspectFill" @click="navigateTo(item.jumpUrl)"></image>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 健康与成长双卡片 -->
  77. <view class="info-dual-card">
  78. <swiper class="info-card-swiper" :autoplay="true" :interval="3000" :circular="true">
  79. <swiper-item v-for="(item, index) in leftBookList" :key="index">
  80. <view class="info-card bg-orange" @click="navigateTo(item.jumpUrl)">
  81. <view class="info-text-group">
  82. <text class="info-title text-orange">{{ item.showCateName }}</text>
  83. <text class="info-desc text-orange-light">{{ item.remark }}</text>
  84. </view>
  85. <image :src="item.imgUrl" class="info-icon" mode="aspectFit"
  86. style="width: 125rpx;height: 111rpx;"></image>
  87. </view>
  88. </swiper-item>
  89. </swiper>
  90. <swiper class="info-card-swiper" :autoplay="true" :interval="3500" :circular="true">
  91. <swiper-item v-for="(item, index) in rightBookList" :key="index">
  92. <view class="info-card bg-green" @click="navigateTo(item.jumpUrl)">
  93. <view class="info-text-group">
  94. <text class="info-title text-green">{{ item.showCateName }}</text>
  95. <text class="info-desc text-green-light">{{ item.remark }}</text>
  96. </view>
  97. <image :src="item.imgUrl" class="info-icon" mode="aspectFit"></image>
  98. </view>
  99. </swiper-item>
  100. </swiper>
  101. </view>
  102. <!-- 公众号横幅 -->
  103. <view class="gzh-section" @click="navigateToOfficialAccount">
  104. <view class="gzh-bg-wrapper">
  105. <image src="/pages-sell/static/gzh-banner.png" class="gzh-img-bg" mode="aspectFill"></image>
  106. <view class="gzh-content-overlay">
  107. <text class="gzh-title">关注公众号 ,定期领红包</text>
  108. <view class="gzh-subtitle-pill">
  109. <text class="gzh-subtitle">别让好书蒙尘 ,书嗨陪你逐页品读</text>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 书嗨推荐 -->
  115. <view class="recommend-section" @click="navigateTo(item.jumpUrl)" v-for="(item, index) in topicList"
  116. :key="index">
  117. <view class="section-header">
  118. <text class="section-title">{{ item.showCateName }}</text>
  119. <view class="view-more">
  120. <text>查看全部</text>
  121. <image src="/pages-sell/static/right-arrow.png" class="arrow-icon" mode="widthFix"></image>
  122. </view>
  123. </view>
  124. <view class="book-list">
  125. <view class="book-item" v-for="(book, index) in getDisplayBooks(item)" :key="index"
  126. @click.stop="navigateTo('/pages-sell/pages/detail?isbn=' + book.bookIsbn)">
  127. <image :src="book.bookImg" class="book-image" mode="aspectFill"></image>
  128. <text class="book-name">{{ book.bookName }}</text>
  129. <view class="price-row">
  130. <text class="currency">¥</text>
  131. <text class="price-val">{{ book.bookPrice }}</text>
  132. <text class="price-old">¥{{ book.bookOriginalPrice }}</text>
  133. </view>
  134. <view class="add-btn">
  135. <text>加入购物车</text>
  136. <image src="/pages-sell/static/shape-10.png" class="cart-symbol"></image>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 底部留白,防止遮挡 -->
  142. <view class="bottom-safe-area"></view>
  143. </view>
  144. <!-- 分享红包悬浮按钮 -->
  145. <FloatingDrag :width="126" :height="140" :initial-position="redPacketPosition"
  146. @position-change="handleRedPacketPositionChange" v-if="shareList.length > 0">
  147. <button class="red-packet-btn" @click="navigateToRedPacket">
  148. <image src="/packet/static/index/btn_share.png" mode="widthFix" style="width: 126rpx; height: 140rpx">
  149. </image>
  150. </button>
  151. </FloatingDrag>
  152. </view>
  153. </template>
  154. <script>
  155. import FloatingDrag from "@/components/floating-drag.vue";
  156. export default {
  157. name: 'SellContainer',
  158. components: {
  159. FloatingDrag
  160. },
  161. data() {
  162. return {
  163. // 红包悬浮按钮位置
  164. redPacketPosition: {
  165. left: 'auto',
  166. right: 0,
  167. bottom: '15%',
  168. },
  169. barStyle: {
  170. backgroundColor: 'transparent',
  171. background: "url('/pages-sell/static/tab-selected.png') no-repeat center",
  172. backgroundSize: '100% 100%',
  173. position: 'relative',
  174. top: '-6rpx',
  175. },
  176. swiperList: [],
  177. statusBarHeight: 20,
  178. keyword: '',
  179. // 记录滚动距离以实现背景错位效果
  180. scrollTop: 0,
  181. // u-tabs 需要对象数组 [{name: 'xxx'}]
  182. hotTagList: [
  183. { name: '热搜' },
  184. { name: '励志' },
  185. { name: '绘本' },
  186. { name: '诺贝尔文学奖' },
  187. { name: '茅盾奖' },
  188. { name: '童书' }
  189. ],
  190. currentHotTag: 0,
  191. // 临时的网络书封面图片
  192. bookCoverUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
  193. categoryList: [], //金刚区
  194. bookList: [], // 右侧推荐书籍
  195. recommendBooks: [
  196. { title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
  197. { title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
  198. { title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' }
  199. ],
  200. topicList: [], //专题推荐
  201. leftBookList: [], // 左侧推荐书籍
  202. rightBookList: [], // 右侧推荐书籍
  203. shareList: [], // 分享列表
  204. }
  205. },
  206. created() {
  207. const systemInfo = uni.getSystemInfoSync();
  208. this.statusBarHeight = systemInfo.statusBarHeight || 20;
  209. this.hasShareList()
  210. this.getIndexCateInfo()
  211. },
  212. methods: {
  213. // 接收外部传入的页面滚动事件
  214. onPageScroll(scrollTop) {
  215. this.scrollTop = scrollTop || 0;
  216. console.log(this.scrollTop)
  217. },
  218. async hasShareList() {
  219. const res = await this.$u.api.getShareRedBagListAjax();
  220. if (res.code === 200 || res.code === 0) {
  221. this.shareList = res.data || [];
  222. }
  223. },
  224. handleCategory(item) {
  225. if (!item.jumpUrl) return
  226. this.navigateTo(item.jumpUrl)
  227. },
  228. changeHotTag(index) {
  229. this.currentHotTag = index;
  230. console.log('切换标签:', index);
  231. },
  232. //跳转 URL
  233. navigateTo(url) {
  234. if (!url) return
  235. console.log(url)
  236. uni.navigateTo({
  237. url: url
  238. });
  239. },
  240. navigateToOfficialAccount() {
  241. // 打开公众号
  242. uni.getProvider({
  243. service: "oauth",
  244. success: function (res) {
  245. if (res.provider.includes("weixin")) {
  246. // 调用微信小程序的 wx.openOfficialAccountProfile
  247. wx.openOfficialAccountProfile({
  248. username: "bookersea",
  249. success: function (res) {
  250. console.log("打开公众号资料页成功", res);
  251. },
  252. fail: function (err) {
  253. console.log("打开公众号资料页失败", err);
  254. },
  255. complete: function () {
  256. console.log("接口调用结束");
  257. },
  258. });
  259. }
  260. },
  261. });
  262. },
  263. goRecommend() {
  264. uni.navigateTo({
  265. url: '/pages-sell/pages/recommend'
  266. });
  267. },
  268. goHotSell() {
  269. uni.navigateTo({
  270. url: '/pages-sell/pages/hot-sell'
  271. });
  272. },
  273. //获取首页装修信息
  274. getIndexCateInfo() {
  275. uni.$u.http.get('/token/shop/showIndex/getIndexCateInfo').then(res => {
  276. console.log(res)
  277. if (res.code == 200) {
  278. console.log(res.data)
  279. this.categoryList = res.data.find(item => item.position == 'diamond_area')?.shopIndexCateVo || []
  280. this.swiperList = res.data.find(item => item.position == 'left_banner')?.shopIndexCateVo || []
  281. this.bookList = res.data.find(item => item.position == 'right_banner')?.shopIndexCateVo || []
  282. this.leftBookList = res.data.find(item => item.position == 'left_book_list')?.shopIndexCateVo || []
  283. this.rightBookList = res.data.find(item => item.position == 'right_book_list')?.shopIndexCateVo || []
  284. //获取专题推荐
  285. this.topicList = res.data.find(item => item.position == 'topic')?.shopIndexCateVo || []
  286. }
  287. })
  288. },
  289. getDisplayBooks(item) {
  290. if (!item.bookInfoList) return []
  291. let limit = 3
  292. if (item.topicType === 2) {
  293. limit = 6
  294. }
  295. return item.bookInfoList.slice(0, limit)
  296. },
  297. // 跳转到红包分享页面
  298. navigateToRedPacket() {
  299. uni.navigateTo({
  300. url: '/packet/pages/share'
  301. });
  302. },
  303. // 红包按钮位置变化
  304. handleRedPacketPositionChange(position) {
  305. this.redPacketPosition = position;
  306. }
  307. }
  308. }
  309. </script>
  310. <style lang="scss" scoped>
  311. .sell-container {
  312. position: relative;
  313. min-height: 100vh;
  314. background-color: #F6F6F6;
  315. overflow-x: hidden;
  316. }
  317. /* 顶部大背景图 */
  318. .top-bg-image {
  319. position: absolute;
  320. top: 0;
  321. left: 0;
  322. width: 100%;
  323. z-index: 0;
  324. display: block;
  325. }
  326. /* 导航栏 */
  327. .custom-navbar {
  328. position: fixed;
  329. top: 0;
  330. left: 0;
  331. width: 100%;
  332. z-index: 100;
  333. display: flex;
  334. align-items: center;
  335. justify-content: center;
  336. .navbar-content {
  337. height: 44px;
  338. width: 100%;
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. position: relative;
  343. .navbar-title {
  344. color: #fff;
  345. font-size: 36rpx;
  346. font-weight: 600;
  347. }
  348. }
  349. }
  350. .main-content {
  351. position: relative;
  352. z-index: 1;
  353. padding: 0 24rpx;
  354. }
  355. /* 顶部固定区域:背景和搜索框 */
  356. .fixed-header-area {
  357. position: fixed;
  358. top: 0;
  359. left: 0;
  360. width: 100%;
  361. z-index: 99;
  362. background-size: 100% auto;
  363. background-repeat: no-repeat;
  364. padding-left: 24rpx;
  365. padding-right: 24rpx;
  366. padding-bottom: 16rpx;
  367. box-sizing: border-box;
  368. transition: background-color 0.2s;
  369. }
  370. .search-placeholder {
  371. height: 100rpx;
  372. }
  373. /* 搜索框 */
  374. .search-wrapper {
  375. margin-top: 10rpx;
  376. margin-bottom: 20rpx;
  377. .search-box-uview {
  378. height: 80rpx;
  379. background-color: #fff;
  380. border-radius: 40rpx;
  381. display: flex;
  382. align-items: center;
  383. padding: 0 10rpx 0 16rpx;
  384. position: relative;
  385. /* 覆盖 u-search 的 padding 以适配 */
  386. ::v-deep .u-search {
  387. flex: 1;
  388. /* 让输入框不遮挡右侧按钮 */
  389. padding-right: 140rpx !important;
  390. }
  391. .search-btn-overlay {
  392. position: absolute;
  393. right: 8rpx;
  394. top: 50%;
  395. transform: translateY(-50%);
  396. width: 140rpx;
  397. height: 64rpx;
  398. background: linear-gradient(0deg, #37C148 0%, #6ADD83 100%);
  399. border-radius: 32rpx;
  400. display: flex;
  401. align-items: center;
  402. justify-content: center;
  403. z-index: 2;
  404. text {
  405. color: #fff;
  406. font-size: 28rpx;
  407. font-weight: 500;
  408. }
  409. }
  410. }
  411. }
  412. /* 顶部横幅 */
  413. .top-banner-wrapper {
  414. width: 100%;
  415. margin-bottom: 30rpx;
  416. position: relative;
  417. .top-banner-img {
  418. width: 100%;
  419. border-radius: 40rpx;
  420. display: block;
  421. }
  422. }
  423. /* 分类图标 */
  424. .category-grid {
  425. display: flex;
  426. flex-wrap: wrap;
  427. margin-bottom: 10rpx;
  428. .grid-item {
  429. width: 20%;
  430. display: flex;
  431. flex-direction: column;
  432. align-items: center;
  433. margin-bottom: 30rpx;
  434. .icon-circle {
  435. width: 96rpx;
  436. height: 96rpx;
  437. display: flex;
  438. align-items: center;
  439. justify-content: center;
  440. margin-bottom: 12rpx;
  441. .cat-icon {
  442. width: 100%;
  443. height: 100%;
  444. }
  445. }
  446. .cat-name {
  447. font-size: 24rpx;
  448. color: #333;
  449. font-weight: 500;
  450. }
  451. }
  452. }
  453. /* 推广双卡片 */
  454. .promo-dual-card {
  455. display: flex;
  456. justify-content: space-between;
  457. margin-bottom: 24rpx;
  458. .card-left {
  459. width: 48%;
  460. height: 252rpx;
  461. border-radius: 20rpx;
  462. position: relative;
  463. overflow: hidden;
  464. }
  465. .card-right {
  466. width: 48%;
  467. height: 252rpx;
  468. /* Updated background per request */
  469. background: linear-gradient(to bottom, #FFD7C3 0%, #FFFFFF 32%);
  470. border-radius: 20rpx;
  471. padding: 20rpx;
  472. box-sizing: border-box;
  473. .right-header {
  474. display: flex;
  475. align-items: center;
  476. justify-content: center;
  477. margin-bottom: 20rpx;
  478. .right-title {
  479. font-size: 30rpx;
  480. font-weight: bold;
  481. color: #333;
  482. margin: 0 10rpx;
  483. }
  484. .fire-icon {
  485. width: 30rpx;
  486. height: 30rpx;
  487. }
  488. .flip {
  489. transform: scaleX(-1);
  490. }
  491. }
  492. .products-container {
  493. display: flex;
  494. justify-content: space-between;
  495. gap: 20rpx;
  496. .product-cover {
  497. flex: 1;
  498. height: 160rpx;
  499. border-radius: 12rpx;
  500. background-color: #f0f0f0;
  501. }
  502. }
  503. }
  504. }
  505. /* 信息双卡片 */
  506. .info-dual-card {
  507. display: flex;
  508. justify-content: space-between;
  509. margin-bottom: 24rpx;
  510. .info-card-swiper {
  511. width: 48%;
  512. height: 140rpx;
  513. border-radius: 12px;
  514. overflow: hidden;
  515. }
  516. .info-card {
  517. width: 100%;
  518. padding: 24rpx;
  519. border-radius: 12px;
  520. /* Updated radius */
  521. display: flex;
  522. justify-content: space-between;
  523. align-items: center;
  524. height: 140rpx;
  525. box-sizing: border-box;
  526. position: relative;
  527. /* For absolute icon */
  528. overflow: hidden;
  529. &.bg-orange {
  530. background: #FFF3E0;
  531. border: 1px solid #FFB72A;
  532. }
  533. &.bg-green {
  534. background: #D4F1D8;
  535. border: 1px solid #54A94E;
  536. }
  537. .info-text-group {
  538. flex: 1;
  539. z-index: 1;
  540. /* Ensure text is above */
  541. .info-title {
  542. font-size: 28rpx;
  543. font-weight: bold;
  544. display: block;
  545. margin-bottom: 6rpx;
  546. }
  547. .info-desc {
  548. font-size: 22rpx;
  549. line-height: 1.2;
  550. }
  551. .text-orange {
  552. color: #DB832D;
  553. }
  554. .text-orange-light {
  555. color: #DB832D;
  556. display: inline-block;
  557. width: 90%;
  558. //超出部分省略号显示
  559. overflow: hidden;
  560. white-space: nowrap;
  561. text-overflow: ellipsis;
  562. max-width: 200rpx;
  563. }
  564. .text-green {
  565. color: #1F8049;
  566. }
  567. .text-green-light {
  568. color: #1F8049;
  569. display: inline-block;
  570. width: 90%;
  571. //超出部分省略号显示
  572. overflow: hidden;
  573. white-space: nowrap;
  574. text-overflow: ellipsis;
  575. max-width: 200rpx;
  576. }
  577. }
  578. .info-icon {
  579. width: 100rpx;
  580. /* Slightly larger maybe */
  581. height: 100rpx;
  582. position: absolute;
  583. right: 0;
  584. bottom: 0;
  585. z-index: 0;
  586. opacity: 0.8;
  587. }
  588. }
  589. }
  590. /* 公众号 */
  591. .gzh-section {
  592. margin-bottom: 30rpx;
  593. height: 180rpx;
  594. /* Fixed height for consistency */
  595. border-radius: 20rpx;
  596. overflow: hidden;
  597. .gzh-bg-wrapper {
  598. width: 100%;
  599. height: 100%;
  600. position: relative;
  601. .gzh-img-bg {
  602. width: 100%;
  603. height: 100%;
  604. position: absolute;
  605. top: 0;
  606. left: 0;
  607. }
  608. .gzh-content-overlay {
  609. position: absolute;
  610. top: 0;
  611. left: 0;
  612. width: 60%;
  613. /* Only cover left side */
  614. height: 100%;
  615. padding: 30rpx;
  616. display: flex;
  617. flex-direction: column;
  618. justify-content: center;
  619. .gzh-title {
  620. font-size: 32rpx;
  621. font-weight: bold;
  622. color: #134E13;
  623. /* Dark green */
  624. margin-bottom: 16rpx;
  625. }
  626. .gzh-subtitle-pill {
  627. background: #FFF;
  628. border-radius: 24rpx;
  629. padding: 0 14rpx;
  630. line-height: 1.4;
  631. align-self: flex-start;
  632. .gzh-subtitle {
  633. font-size: 22rpx;
  634. color: #134E13;
  635. font-weight: 500;
  636. }
  637. }
  638. }
  639. }
  640. }
  641. /* 书嗨推荐 */
  642. .recommend-section {
  643. background-color: #fff;
  644. border-radius: 20rpx;
  645. padding: 30rpx;
  646. margin-bottom: 24rpx;
  647. .section-header {
  648. display: flex;
  649. justify-content: space-between;
  650. align-items: center;
  651. margin-bottom: 24rpx;
  652. .section-title {
  653. font-size: 32rpx;
  654. font-weight: bold;
  655. color: #333;
  656. }
  657. .view-more {
  658. display: flex;
  659. align-items: center;
  660. font-size: 24rpx;
  661. color: #8D8D8D;
  662. .arrow-icon {
  663. width: 12rpx;
  664. margin-left: 6rpx;
  665. }
  666. }
  667. }
  668. .book-list {
  669. display: flex;
  670. flex-wrap: wrap;
  671. justify-content: space-between;
  672. }
  673. .book-item {
  674. width: 200rpx;
  675. margin-bottom: 24rpx;
  676. display: flex;
  677. flex-direction: column;
  678. .book-image {
  679. width: 200rpx;
  680. height: 255rpx;
  681. border-radius: 2rpx;
  682. margin-bottom: 16rpx;
  683. background-color: #f9f9f9;
  684. }
  685. .book-name {
  686. font-family: 'Source Han Sans SC';
  687. font-weight: bold;
  688. font-size: 28rpx;
  689. color: #303030;
  690. margin-bottom: 10rpx;
  691. overflow: hidden;
  692. text-overflow: ellipsis;
  693. white-space: nowrap;
  694. }
  695. .price-row {
  696. display: flex;
  697. align-items: baseline;
  698. margin-bottom: 12rpx;
  699. .currency {
  700. font-family: 'Source Han Sans SC';
  701. font-weight: 500;
  702. font-size: 22rpx;
  703. color: #D81A00;
  704. }
  705. .price-val {
  706. font-family: 'Source Han Sans SC';
  707. font-weight: 500;
  708. font-size: 28rpx;
  709. color: #D81A00;
  710. margin-right: 12rpx;
  711. }
  712. .price-old {
  713. font-family: 'Source Han Sans SC';
  714. font-weight: 500;
  715. font-size: 22rpx;
  716. color: #999999;
  717. text-decoration: line-through;
  718. }
  719. }
  720. .add-btn {
  721. width: fit-content;
  722. height: 36rpx;
  723. line-height: 36rpx;
  724. background: linear-gradient(0deg, #4ED964 0%, #4ED964 100%);
  725. border-radius: 18rpx;
  726. padding: 0 20rpx;
  727. display: flex;
  728. align-items: center;
  729. justify-content: center;
  730. text {
  731. font-size: 22rpx;
  732. color: #fff;
  733. }
  734. .cart-symbol {
  735. width: 24rpx;
  736. height: 24rpx;
  737. margin-left: 6rpx;
  738. }
  739. }
  740. }
  741. }
  742. .bottom-safe-area {
  743. height: 30rpx
  744. }
  745. .red-packet-btn {
  746. width: 126rpx;
  747. height: 140rpx;
  748. background: transparent;
  749. border: none;
  750. padding: 0;
  751. margin: 0;
  752. display: flex;
  753. align-items: center;
  754. justify-content: center;
  755. &::after {
  756. border: none;
  757. }
  758. }
  759. </style>