index.vue 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  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. <!-- 热搜词横向滚动区域 -->
  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"></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. async getHotSearchData() {
  249. try {
  250. const res = await this.$u.api.getHotSearchListAjax();
  251. if (res.code === 200 || res.code === 0) {
  252. this.hotSearchList = res.data || [];
  253. }
  254. } catch (error) {
  255. console.log('获取热搜词失败', error);
  256. }
  257. },
  258. goSearchResult(keyword) {
  259. if (!keyword) return;
  260. // 过滤可能带有的 <em> 等后端返回的 HTML 标签
  261. const cleanKey = keyword.replace(/<[^>]+>/g, '');
  262. uni.navigateTo({
  263. url: '/pages-sell/pages/search-result?keyword=' + encodeURIComponent(cleanKey)
  264. });
  265. },
  266. // 接收外部传入的页面滚动事件
  267. onPageScroll(scrollTop) {
  268. if (this.isDragging) return; // 拖动悬浮按钮时禁止滚动
  269. this.scrollTop = scrollTop || 0;
  270. console.log(this.scrollTop)
  271. },
  272. async hasShareList() {
  273. const res = await this.$u.api.getShareRedBagListAjax();
  274. if (res.code === 200 || res.code === 0) {
  275. this.shareList = res.data || [];
  276. }
  277. },
  278. handleCategory(item) {
  279. if (!item.jumpUrl) return
  280. this.navigateTo(item.jumpUrl)
  281. },
  282. changeHotTag(index) {
  283. this.currentHotTag = index;
  284. console.log('切换标签:', index);
  285. },
  286. //跳转 URL
  287. navigateTo(url) {
  288. if (!url) return
  289. console.log(url)
  290. uni.navigateTo({
  291. url: url
  292. });
  293. },
  294. navigateToOfficialAccount() {
  295. // 打开公众号
  296. uni.getProvider({
  297. service: "oauth",
  298. success: function (res) {
  299. if (res.provider.includes("weixin")) {
  300. // 调用微信小程序的 wx.openOfficialAccountProfile
  301. wx.openOfficialAccountProfile({
  302. username: "bookersea",
  303. success: function (res) {
  304. console.log("打开公众号资料页成功", res);
  305. },
  306. fail: function (err) {
  307. console.log("打开公众号资料页失败", err);
  308. },
  309. complete: function () {
  310. console.log("接口调用结束");
  311. },
  312. });
  313. }
  314. },
  315. });
  316. },
  317. goRecommend() {
  318. uni.navigateTo({
  319. url: '/pages-sell/pages/recommend'
  320. });
  321. },
  322. goHotSell() {
  323. uni.navigateTo({
  324. url: '/pages-sell/pages/hot-sell'
  325. });
  326. },
  327. //获取首页装修信息
  328. getIndexCateInfo() {
  329. uni.$u.http.get('/token/shop/showIndex/getIndexCateInfo').then(res => {
  330. console.log(res)
  331. if (res.code == 200) {
  332. console.log(res.data)
  333. this.categoryList = res.data.find(item => item.position == 'diamond_area')?.shopIndexCateVo || []
  334. this.swiperList = res.data.find(item => item.position == 'left_banner')?.shopIndexCateVo || []
  335. this.bookList = res.data.find(item => item.position == 'right_banner')?.shopIndexCateVo || []
  336. this.leftBookList = res.data.find(item => item.position == 'left_book_list')?.shopIndexCateVo || []
  337. this.rightBookList = res.data.find(item => item.position == 'right_book_list')?.shopIndexCateVo || []
  338. //获取专题推荐
  339. this.topicList = res.data.find(item => item.position == 'topic')?.shopIndexCateVo || []
  340. }
  341. })
  342. },
  343. getDisplayBooks(item) {
  344. if (!item.bookInfoList) return []
  345. let limit = 3
  346. if (item.topicType === 2) {
  347. limit = 6
  348. }
  349. return item.bookInfoList.slice(0, limit)
  350. },
  351. // 跳转到红包分享页面
  352. navigateToRedPacket() {
  353. uni.navigateTo({
  354. url: '/packet/pages/share'
  355. });
  356. },
  357. // 红包按钮位置变化
  358. handleRedPacketPositionChange(position) {
  359. this.redPacketPosition = position;
  360. },
  361. // 客服按钮位置变化
  362. handleServicePositionChange(position) {
  363. this.servicePosition = position;
  364. },
  365. // 拖动开始
  366. handleDragStart() {
  367. this.isDragging = true;
  368. },
  369. // 拖动结束
  370. handleDragEnd() {
  371. this.isDragging = false;
  372. },
  373. // 支付宝小程序的客服
  374. navigateToCustomerService() {
  375. uni.makePhoneCall({
  376. phoneNumber: '400-123-4567'
  377. });
  378. }
  379. }
  380. }
  381. </script>
  382. <style lang="scss" scoped>
  383. .sell-container {
  384. position: relative;
  385. min-height: 100vh;
  386. background-color: #F6F6F6;
  387. overflow-x: hidden;
  388. }
  389. /* 顶部大背景图 */
  390. .top-bg-image {
  391. position: absolute;
  392. top: 0;
  393. left: 0;
  394. width: 100%;
  395. z-index: 0;
  396. display: block;
  397. }
  398. /* 导航栏 */
  399. .custom-navbar {
  400. position: fixed;
  401. top: 0;
  402. left: 0;
  403. width: 100%;
  404. z-index: 100;
  405. display: flex;
  406. align-items: center;
  407. justify-content: center;
  408. .navbar-content {
  409. height: 44px;
  410. width: 100%;
  411. display: flex;
  412. align-items: center;
  413. justify-content: center;
  414. position: relative;
  415. .navbar-title {
  416. color: #fff;
  417. font-size: 36rpx;
  418. font-weight: 600;
  419. }
  420. }
  421. }
  422. .main-content {
  423. position: relative;
  424. z-index: 1;
  425. padding: 0 24rpx;
  426. }
  427. /* 顶部固定区域:背景和搜索框 */
  428. .fixed-header-area {
  429. position: fixed;
  430. top: 0;
  431. left: 0;
  432. width: 100%;
  433. z-index: 99;
  434. background-size: 100% auto;
  435. background-repeat: no-repeat;
  436. padding-left: 24rpx;
  437. padding-right: 24rpx;
  438. padding-bottom: 16rpx;
  439. box-sizing: border-box;
  440. transition: background-color 0.2s;
  441. }
  442. .search-placeholder {
  443. height: 160rpx;
  444. /* 增加高度以容纳热搜词 */
  445. }
  446. /* 热搜词横向滚动 */
  447. .hot-search-wrapper {
  448. margin-bottom: 24rpx;
  449. width: 100%;
  450. display: flex;
  451. align-items: center;
  452. }
  453. .hot-search-fixed-title {
  454. flex-shrink: 0;
  455. padding-left: 24rpx;
  456. position: relative;
  457. .select-icon {
  458. position: absolute;
  459. top: 36rpx;
  460. left: 50%;
  461. transform: translateX(-50%);
  462. }
  463. }
  464. .hot-search-scroll {
  465. flex: 1;
  466. white-space: nowrap;
  467. overflow: hidden;
  468. }
  469. .hot-search-list {
  470. display: inline-flex;
  471. align-items: center;
  472. padding: 0 20rpx;
  473. }
  474. .hot-tag {
  475. display: inline-block;
  476. margin-right: 30rpx;
  477. font-size: 26rpx;
  478. color: #666;
  479. font-weight: 500;
  480. }
  481. .hot-tag-highlight {
  482. color: #38C148;
  483. font-weight: bold;
  484. padding-right: 20rpx;
  485. margin-right: 0;
  486. position: relative;
  487. }
  488. .hot-tag-highlight::after {
  489. content: '';
  490. position: absolute;
  491. right: 0;
  492. top: 50%;
  493. transform: translateY(-50%);
  494. width: 2rpx;
  495. height: 24rpx;
  496. background-color: #E0E0E0;
  497. }
  498. /* 搜索框 */
  499. .search-wrapper {
  500. margin-top: 10rpx;
  501. margin-bottom: 20rpx;
  502. .search-box-uview {
  503. height: 80rpx;
  504. background-color: #fff;
  505. border-radius: 40rpx;
  506. display: flex;
  507. align-items: center;
  508. padding: 0 10rpx 0 16rpx;
  509. position: relative;
  510. /* 覆盖 u-search 的 padding 以适配 */
  511. ::v-deep .u-search {
  512. flex: 1;
  513. /* 让输入框不遮挡右侧按钮 */
  514. padding-right: 140rpx !important;
  515. }
  516. .search-btn-overlay {
  517. position: absolute;
  518. right: 8rpx;
  519. top: 50%;
  520. transform: translateY(-50%);
  521. width: 140rpx;
  522. height: 64rpx;
  523. background: linear-gradient(0deg, #37C148 0%, #6ADD83 100%);
  524. border-radius: 32rpx;
  525. display: flex;
  526. align-items: center;
  527. justify-content: center;
  528. z-index: 2;
  529. text {
  530. color: #fff;
  531. font-size: 28rpx;
  532. font-weight: 500;
  533. }
  534. }
  535. }
  536. }
  537. /* 顶部横幅 */
  538. .top-banner-wrapper {
  539. width: 100%;
  540. margin-bottom: 30rpx;
  541. position: relative;
  542. .top-banner-img {
  543. width: 100%;
  544. border-radius: 40rpx;
  545. display: block;
  546. }
  547. }
  548. /* 分类图标 */
  549. .category-grid {
  550. display: flex;
  551. flex-wrap: wrap;
  552. margin-bottom: 10rpx;
  553. .grid-item {
  554. width: 20%;
  555. display: flex;
  556. flex-direction: column;
  557. align-items: center;
  558. margin-bottom: 30rpx;
  559. .icon-circle {
  560. width: 96rpx;
  561. height: 96rpx;
  562. display: flex;
  563. align-items: center;
  564. justify-content: center;
  565. margin-bottom: 12rpx;
  566. .cat-icon {
  567. width: 100%;
  568. height: 100%;
  569. }
  570. }
  571. .cat-name {
  572. font-size: 24rpx;
  573. color: #333;
  574. font-weight: 500;
  575. }
  576. }
  577. }
  578. /* 推广双卡片 */
  579. .promo-dual-card {
  580. display: flex;
  581. justify-content: space-between;
  582. margin-bottom: 24rpx;
  583. .card-left {
  584. width: 48%;
  585. height: 252rpx;
  586. border-radius: 20rpx;
  587. position: relative;
  588. overflow: hidden;
  589. }
  590. .card-right {
  591. width: 48%;
  592. height: 252rpx;
  593. /* Updated background per request */
  594. background: linear-gradient(to bottom, #FFD7C3 0%, #FFFFFF 32%);
  595. border-radius: 20rpx;
  596. padding: 20rpx;
  597. box-sizing: border-box;
  598. .right-header {
  599. display: flex;
  600. align-items: center;
  601. justify-content: center;
  602. margin-bottom: 20rpx;
  603. .right-title {
  604. font-size: 30rpx;
  605. font-weight: bold;
  606. color: #333;
  607. margin: 0 10rpx;
  608. }
  609. .fire-icon {
  610. width: 30rpx;
  611. height: 30rpx;
  612. }
  613. .flip {
  614. transform: scaleX(-1);
  615. }
  616. }
  617. .products-container {
  618. display: flex;
  619. justify-content: space-between;
  620. gap: 20rpx;
  621. .product-cover {
  622. flex: 1;
  623. height: 160rpx;
  624. border-radius: 12rpx;
  625. background-color: #f0f0f0;
  626. }
  627. }
  628. }
  629. }
  630. /* 信息双卡片 */
  631. .info-dual-card {
  632. display: flex;
  633. justify-content: space-between;
  634. margin-bottom: 24rpx;
  635. .info-card-swiper {
  636. width: 48%;
  637. height: 140rpx;
  638. border-radius: 12px;
  639. overflow: hidden;
  640. }
  641. .info-card {
  642. width: 100%;
  643. padding: 24rpx;
  644. border-radius: 12px;
  645. /* Updated radius */
  646. display: flex;
  647. justify-content: space-between;
  648. align-items: center;
  649. height: 140rpx;
  650. box-sizing: border-box;
  651. position: relative;
  652. /* For absolute icon */
  653. overflow: hidden;
  654. &.bg-orange {
  655. background: #FFF3E0;
  656. border: 1px solid #FFB72A;
  657. }
  658. &.bg-green {
  659. background: #D4F1D8;
  660. border: 1px solid #54A94E;
  661. }
  662. .info-text-group {
  663. flex: 1;
  664. z-index: 1;
  665. /* Ensure text is above */
  666. .info-title {
  667. font-size: 28rpx;
  668. font-weight: bold;
  669. display: block;
  670. margin-bottom: 6rpx;
  671. }
  672. .info-desc {
  673. font-size: 22rpx;
  674. line-height: 1.2;
  675. }
  676. .text-orange {
  677. color: #DB832D;
  678. }
  679. .text-orange-light {
  680. color: #DB832D;
  681. display: inline-block;
  682. width: 90%;
  683. //超出部分省略号显示
  684. overflow: hidden;
  685. white-space: nowrap;
  686. text-overflow: ellipsis;
  687. max-width: 200rpx;
  688. }
  689. .text-green {
  690. color: #1F8049;
  691. }
  692. .text-green-light {
  693. color: #1F8049;
  694. display: inline-block;
  695. width: 90%;
  696. //超出部分省略号显示
  697. overflow: hidden;
  698. white-space: nowrap;
  699. text-overflow: ellipsis;
  700. max-width: 200rpx;
  701. }
  702. }
  703. .info-icon {
  704. width: 100rpx;
  705. /* Slightly larger maybe */
  706. height: 100rpx;
  707. position: absolute;
  708. right: 0;
  709. bottom: 0;
  710. z-index: 0;
  711. opacity: 0.8;
  712. }
  713. }
  714. }
  715. /* 公众号 */
  716. .gzh-section {
  717. margin-bottom: 30rpx;
  718. height: 180rpx;
  719. /* Fixed height for consistency */
  720. border-radius: 20rpx;
  721. overflow: hidden;
  722. .gzh-bg-wrapper {
  723. width: 100%;
  724. height: 100%;
  725. position: relative;
  726. .gzh-img-bg {
  727. width: 100%;
  728. height: 100%;
  729. position: absolute;
  730. top: 0;
  731. left: 0;
  732. }
  733. .gzh-content-overlay {
  734. position: absolute;
  735. top: 0;
  736. left: 0;
  737. width: 60%;
  738. /* Only cover left side */
  739. height: 100%;
  740. padding: 30rpx;
  741. display: flex;
  742. flex-direction: column;
  743. justify-content: center;
  744. .gzh-title {
  745. font-size: 32rpx;
  746. font-weight: bold;
  747. color: #134E13;
  748. /* Dark green */
  749. margin-bottom: 16rpx;
  750. }
  751. .gzh-subtitle-pill {
  752. background: #FFF;
  753. border-radius: 24rpx;
  754. padding: 0 14rpx;
  755. line-height: 1.4;
  756. align-self: flex-start;
  757. .gzh-subtitle {
  758. font-size: 22rpx;
  759. color: #134E13;
  760. font-weight: 500;
  761. }
  762. }
  763. }
  764. }
  765. }
  766. /* 书嗨推荐 */
  767. .recommend-section {
  768. background-color: #fff;
  769. border-radius: 20rpx;
  770. padding: 30rpx;
  771. margin-bottom: 24rpx;
  772. .section-header {
  773. display: flex;
  774. justify-content: space-between;
  775. align-items: center;
  776. margin-bottom: 24rpx;
  777. .section-title {
  778. font-size: 32rpx;
  779. font-weight: bold;
  780. color: #333;
  781. }
  782. .view-more {
  783. display: flex;
  784. align-items: center;
  785. font-size: 24rpx;
  786. color: #8D8D8D;
  787. .arrow-icon {
  788. width: 12rpx;
  789. margin-left: 6rpx;
  790. }
  791. }
  792. }
  793. .book-list {
  794. display: flex;
  795. flex-wrap: wrap;
  796. justify-content: space-between;
  797. }
  798. .book-item {
  799. width: 200rpx;
  800. margin-bottom: 24rpx;
  801. display: flex;
  802. flex-direction: column;
  803. .book-image {
  804. width: 200rpx;
  805. height: 255rpx;
  806. border-radius: 2rpx;
  807. margin-bottom: 16rpx;
  808. background-color: #f9f9f9;
  809. }
  810. .book-name {
  811. font-family: 'Source Han Sans SC';
  812. font-weight: bold;
  813. font-size: 28rpx;
  814. color: #303030;
  815. margin-bottom: 10rpx;
  816. overflow: hidden;
  817. text-overflow: ellipsis;
  818. white-space: nowrap;
  819. }
  820. .price-row {
  821. display: flex;
  822. align-items: baseline;
  823. margin-bottom: 12rpx;
  824. .currency {
  825. font-family: 'Source Han Sans SC';
  826. font-weight: 500;
  827. font-size: 22rpx;
  828. color: #D81A00;
  829. }
  830. .price-val {
  831. font-family: 'Source Han Sans SC';
  832. font-weight: 500;
  833. font-size: 28rpx;
  834. color: #D81A00;
  835. margin-right: 12rpx;
  836. }
  837. .price-old {
  838. font-family: 'Source Han Sans SC';
  839. font-weight: 500;
  840. font-size: 22rpx;
  841. color: #999999;
  842. text-decoration: line-through;
  843. }
  844. }
  845. .add-btn {
  846. width: fit-content;
  847. height: 36rpx;
  848. line-height: 36rpx;
  849. background: linear-gradient(0deg, #4ED964 0%, #4ED964 100%);
  850. border-radius: 18rpx;
  851. padding: 0 20rpx;
  852. display: flex;
  853. align-items: center;
  854. justify-content: center;
  855. text {
  856. font-size: 22rpx;
  857. color: #fff;
  858. }
  859. .cart-symbol {
  860. width: 24rpx;
  861. height: 24rpx;
  862. margin-left: 6rpx;
  863. }
  864. }
  865. }
  866. }
  867. .bottom-safe-area {
  868. height: 30rpx
  869. }
  870. .red-packet-btn {
  871. width: 126rpx;
  872. height: 140rpx;
  873. background: transparent;
  874. border: none;
  875. padding: 0;
  876. margin: 0;
  877. display: flex;
  878. align-items: center;
  879. justify-content: center;
  880. &::after {
  881. border: none;
  882. }
  883. }
  884. /* 客服悬浮按钮 */
  885. .service-btn {
  886. width: 126rpx;
  887. height: 140rpx;
  888. background: transparent;
  889. border: none;
  890. padding: 0;
  891. margin: 0;
  892. display: flex;
  893. align-items: center;
  894. justify-content: center;
  895. &::after {
  896. border: none;
  897. }
  898. .cs-icon {
  899. width: 126rpx;
  900. height: 140rpx;
  901. }
  902. }
  903. </style>