index.vue 23 KB

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