index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <view class="ps-wrapper">
  3. <view id="headerBox" ref="headerBox" :class="[mpCommonClass]" :style="{
  4. background: `url(${bgImg}) no-repeat center top`,
  5. backgroundSize: '100% 400rpx',
  6. backgroundColor: '#F7F7F7',
  7. }" class="header-box">
  8. <view>
  9. <view :height=" '1225rpx'" class="banner-container">
  10. <u-swiper :autoplay="true" :current="current" :height=" '1225rpx'" :list="bannerList" circular
  11. duration="1000" interval="5000" @change="(data) => (current = data.current)" @click="bannerClick">
  12. <template #indicator>
  13. <view class="custom-indicator">
  14. <text v-for="item in bannerList.length" v-show="bannerList.length > 0" :key="item"
  15. :class="{ 'banner-active': item === current }" class="custom-indicator-item"></text>
  16. </view>
  17. </template>
  18. </u-swiper>
  19. <view class="logo-search-container">
  20. <view class="centered-image">
  21. <van-image
  22. :src="logoImg"
  23. fit="contain"
  24. height="20px"
  25. width="83px"
  26. />
  27. </view>
  28. <view :style="{
  29. width: '75%',
  30. height: '100%',
  31. }" class="search-box" @click="toSearchList">
  32. <u-icon name="search" size="20"></u-icon>
  33. <text>请输入关键词</text>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 商品分类 -->
  38. <view class="goods-list">
  39. <view class="goods-list-item" @click="jumpPage('haowu')">
  40. <van-image
  41. height="136rpx"
  42. src="/static/hd1.png"
  43. width="84rpx"
  44. />
  45. <view style=" margin-top: 14rpx">芳香好物</view>
  46. </view>
  47. <view class="goods-list-item" @click="jumpPage('xueyuan')">
  48. <van-image
  49. height="136rpx"
  50. src="/static/hd2.png"
  51. width="84rpx"
  52. />
  53. <view style=" margin-top: 14rpx"> 芳香学院</view>
  54. </view>
  55. <view class="goods-list-item" @click="jumpPage('huodong')">
  56. <van-image
  57. height="136rpx"
  58. src="/static/hd3.png"
  59. width="84rpx"
  60. />
  61. <view style=" margin-top: 14rpx"> 芳香活动</view>
  62. </view>
  63. <view class="goods-list-item" @click="jumpPage('shenghuo')">
  64. <van-image
  65. height="136rpx"
  66. src="/static/hd5.png"
  67. width="84rpx"
  68. />
  69. <view style=" margin-top: 14rpx"> 芳香生活
  70. </view>
  71. </view>
  72. <view class="goods-list-item" @click="jumpPage('peiban')">
  73. <van-image
  74. height="136rpx"
  75. src="/static/hd4.png"
  76. width="84rpx"
  77. />
  78. <view style=" margin-top: 14rpx">陪伴营</view>
  79. </view>
  80. </view>
  81. <view class="biaoti">
  82. <van-image
  83. height="85.94rpx"
  84. src="/static/biaoti1.png"
  85. width="171.3rpx"
  86. />
  87. </view>
  88. <view class="content-box">
  89. <view v-for="(item, index) in activityList" :key="index" :style="{width: '95%', margin: '0rpx auto', height: '378rpx' ,borderRadius: '24rpx 24rpx 24rpx 24rpx',backgroundColor: '#F2FAF2'}"
  90. @click="toHuodong(item)">
  91. <van-image
  92. height="280rpx"
  93. :src="item.pic"
  94. width="100%"
  95. />
  96. <view >
  97. <van-row>
  98. <van-col span="16">
  99. <view class="huodongText">
  100. {{ item.name }}
  101. </view>
  102. </van-col>
  103. <van-col span="8">
  104. <van-row>
  105. <van-col span="12">
  106. <view class="huodongText2">
  107. <van-image
  108. class="huodongText2-img"
  109. height="28rpx"
  110. src="/static/hdlist2.png" width="28rpx"
  111. />
  112. {{item.hits }}
  113. </view>
  114. </van-col>
  115. <van-col span="12">
  116. <view class="huodongText2">
  117. <van-image
  118. class="huodongText2-img"
  119. height="28rpx"
  120. src="/static/hdlist3.png" width="28rpx"
  121. />
  122. {{item.entry_num }}
  123. </view>
  124. </van-col>
  125. </van-row>
  126. </van-col>
  127. </van-row>
  128. </view>
  129. </view>
  130. <view class="biaoti">
  131. <van-image
  132. height="85.94rpx"
  133. src="/static/biaoti2.png"
  134. width="171.3rpx"
  135. />
  136. </view>
  137. <view
  138. :style="{width: '95%', margin: '0rpx auto'}">
  139. <view style="width: 100%;">
  140. <view v-for="(item, index) in goods_class" :key="index">
  141. <view style="margin-bottom: 24rpx" @click="toKecheng(item)">
  142. <van-image
  143. :src="item.cover"
  144. height="200rpx"
  145. width="100%"
  146. />
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <view class="biaoti">
  152. <van-image
  153. height="85.94rpx"
  154. src="/static/biaoti3.png"
  155. width="171.3rpx"
  156. />
  157. </view>
  158. <view
  159. :style="{width: '95%', margin: '0rpx auto'}">
  160. <CommercePart :data="commonDataList"></CommercePart>
  161. <!-- 赠品专区 -->
  162. <image v-if="giftBanner.pic" :src="giftBanner.pic" mode="aspectFill"
  163. style="width: 100%; height: 206rpx" @click="toSubpages('giftZone')">
  164. </image>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. <tabbarCom current="0"></tabbarCom>
  170. <van-toast id="van-toast"/>
  171. </view>
  172. </template>
  173. <script>
  174. import tabbarCom from "@/components/tabbar/tabbar.vue"
  175. import CommercePart from "@/components/CommercePart.vue";
  176. // import FlowPart from "@/components/FlowPart.vue";
  177. import {
  178. goodsList
  179. } from "./config";
  180. import {
  181. getBanner
  182. } from "@/common/api/home.js";
  183. import {
  184. getNewsList
  185. } from "@/common/api/news.js";
  186. import {getActivityList} from "@/common/api/activity";
  187. import Toast from "wxcomponents/vant/dist/toast/toast";
  188. // 获取系统状态栏的高度
  189. let systemInfo = uni.getSystemInfoSync();
  190. let menuButtonInfo = {};
  191. // 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
  192. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
  193. menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  194. // #endif
  195. export default {
  196. components: {
  197. tabbarCom,
  198. CommercePart
  199. },
  200. data() {
  201. return {
  202. bgImg: '',
  203. logoImg: '',
  204. shopName: '',
  205. shopShareImg: '',
  206. ponitsBanner: {}, // 积分兑换
  207. giftBanner: {}, // 赠品
  208. partGoodsList: [],
  209. msGoodsList: [],
  210. bannerList: [],
  211. topData: {
  212. top: 0,
  213. height: 0,
  214. },
  215. current: 0,
  216. titleTabCurrentIndex: 0,
  217. goodsList: goodsList,
  218. imageUrl: this.$C.imageUrl,
  219. userInfo: {},
  220. keyword: "",
  221. commonPage: {
  222. pageNum: 1,
  223. pageSize: 4,
  224. total: 0,
  225. },
  226. flowPage: {
  227. pageNum: 1,
  228. pageSize: 4,
  229. total: 0,
  230. },
  231. status: "loadmore",
  232. filterData: {},
  233. loadText: {
  234. loadmore: "点击加载更多",
  235. loading: "努力加载中",
  236. nomore: "没有更多了",
  237. },
  238. selectedType: "",
  239. activeTabStyle: {
  240. fontSize: "36rpx",
  241. fontWeight: "600",
  242. },
  243. mainHeightStyle: {},
  244. mainHeight: "",
  245. commonDataList: [],
  246. flowDataList: [],
  247. statusBarHeight: systemInfo.statusBarHeight,
  248. menuButtonInfo: menuButtonInfo,
  249. searchInputStyle: {
  250. backgroundColor: "transparent",
  251. color: "#1D161F",
  252. },
  253. prevData: [],
  254. advList: [],
  255. goods_class: [],
  256. sourceBanner: [],
  257. activityList:[]
  258. };
  259. },
  260. computed: {
  261. // 导航栏内部盒子的样式
  262. navbarInnerStyle() {
  263. let style = {};
  264. // 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
  265. style.height = this.navbarHeight + "px";
  266. // // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
  267. // #ifdef MP
  268. let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
  269. style.marginRight = rightButtonWidth + "px";
  270. // #endif
  271. return style;
  272. },
  273. // 转换字符数值为真正的数值
  274. navbarHeight() {
  275. // #ifdef APP-PLUS || H5
  276. return this.height ? this.height : 44;
  277. // #endif
  278. // #ifdef MP
  279. // 小程序特别处理,让导航栏高度 = 胶囊高度 + 两倍胶囊顶部与状态栏底部的距离之差(相当于同时获得了导航栏底部与胶囊底部的距离)
  280. // 此方法有缺陷,暂不用(会导致少了几个px),采用直接固定值的方式
  281. // return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//导航高度
  282. let height = systemInfo.platform == "ios" ? 44 : 48;
  283. return this.height ? this.height : height;
  284. // #endif
  285. },
  286. token() {
  287. return this.$U.getStorage("token");
  288. },
  289. mpCommonClass() {
  290. return this.$C.mpCommonClass || ''
  291. }
  292. },
  293. watch: {
  294. titleTabCurrentIndex() {
  295. if (this.titleTabCurrentIndex == 0) {
  296. this.getCommonData(true);
  297. } else {
  298. this.getFlowData(true);
  299. }
  300. },
  301. },
  302. onLoad() {
  303. this.getBanner();
  304. this.getActivityList();
  305. this.getNewsList();
  306. },
  307. onShow() {
  308. uni
  309. .createSelectorQuery()
  310. .in(this)
  311. .select("#headerBox")
  312. .boundingClientRect((data) => {
  313. let height = (data.height + 20) * 2 + "rpx";
  314. this.mainHeight = `calc(100vh - ${height})`;
  315. })
  316. .exec();
  317. const topData = uni.getMenuButtonBoundingClientRect();
  318. this.topData.top = topData.top;
  319. this.topData.height = topData.height;
  320. if (this.token) {
  321. this.userInfo = this.$U.getStorage("userInfo");
  322. }
  323. // this.getMsData()
  324. // this.getCommonData(true);
  325. },
  326. onReachBottom() {
  327. this.getCommonData();
  328. },
  329. onShareAppMessage(res) {
  330. if (res.from === 'button') { // 来自页面内分享按钮
  331. }
  332. let userInfo = uni.getStorageSync('userInfo')
  333. userInfo = userInfo && JSON.parse(userInfo) || {}
  334. let params = {}
  335. if (userInfo.id) {
  336. params = {
  337. id: userInfo.id
  338. }
  339. }
  340. return {
  341. title: this.shopName,
  342. path: `/pages/home/index${this.$stringPageOptions(params)}`,
  343. imageUrl: this.shopShareImg,
  344. }
  345. },
  346. onShareTimeline(res) {
  347. if (res.from === 'button') { // 来自页面内分享按钮
  348. }
  349. let userInfo = uni.getStorageSync('userInfo')
  350. userInfo = userInfo && JSON.parse(userInfo) || {}
  351. let params = {}
  352. if (userInfo.id) {
  353. params = {
  354. id: userInfo.id
  355. }
  356. }
  357. return {
  358. title: this.shopName,
  359. imageUrl: this.shopShareImg,
  360. path: `/pages/home/index${this.$stringPageOptions(params)}`
  361. }
  362. },
  363. methods: {
  364. toMsList() {
  365. uni.navigateTo({
  366. url: `/subPages/msGoodsList/msGoodsList`,
  367. });
  368. },
  369. toMsDetail(item) {
  370. // 秒杀详情
  371. uni.navigateTo({
  372. url: `/subPages/goodsDetail/goodsDetail?code=${item.id}&type=msGoods`,
  373. });
  374. },
  375. toDetails(item) {
  376. // 秒杀详情
  377. uni.navigateTo({
  378. url: `/subPages/goodsDetail/goodsDetail?code=${item.code}&type=common`,
  379. });
  380. },
  381. toSubpages(type) {
  382. if (type == "pointsZone") {
  383. uni.navigateTo({
  384. url: `/subPages/pointsZone/pointsZone?id=${this.ponitsBanner.pstn_id}`,
  385. });
  386. } else {
  387. uni.navigateTo({
  388. url: `/subPages/giftZone/giftZone?id=${this.giftBanner.pstn_id}`,
  389. });
  390. }
  391. },
  392. jumpPage(type) {
  393. if (type == "haowu") {
  394. uni.switchTab({
  395. url: '/pages/productCenter/productCenter',
  396. })
  397. } else if( type == "xueyuan"){
  398. uni.navigateTo({url: `/subPages/course/course`,})
  399. } else if( type == "huodong"){
  400. uni.switchTab({
  401. url: '/pages/activity/activity',
  402. })
  403. }else if (type == "peiban"){
  404. uni.navigateTo({url: `/subPages/accompanyingCamp/accompanyingCamp`,})
  405. }else if (type == "shenghuo"){
  406. uni.navigateTo({url: `/subPages/fragrantLife/fragrantLife`,})
  407. }
  408. else {
  409. Toast('敬请期待');
  410. }
  411. },
  412. toHuodong(item) {
  413. uni.navigateTo({url: `/subPages/activityDetail/activityDetail?activityId=${ item.id}`,})
  414. },
  415. toKecheng(item) {
  416. uni.navigateTo({url: `/subPages/courseDetail/courseDetail?goods_code=${ item.code}`,})
  417. },
  418. bannerClick(index) {
  419. const currentUrl = this.sourceBanner[index].pic_url
  420. if (currentUrl != '#') {
  421. uni.navigateTo({
  422. url: currentUrl
  423. })
  424. }
  425. },
  426. getBanner() {
  427. getBanner().then((res) => {
  428. const {
  429. slider = [],
  430. goods_class = [],
  431. goods_cate = [],
  432. goods_online = [],
  433. seckill_goods = [],
  434. integral_page = [],
  435. gifts_page = [],
  436. shop_name,
  437. shop_home_logo,
  438. shop_share_img,
  439. shop_bgimg
  440. } = res.data;
  441. const configs = uni.getStorageSync("configs");
  442. if (configs) {
  443. this.logoImg = configs.shop_home_logo
  444. this.bgImg = configs.shop_bgimg
  445. this.shopName = configs.shop_share_title
  446. this.shopShareImg = configs.shop_share_img
  447. } else {
  448. this.logoImg = shop_home_logo
  449. this.bgImg = shop_bgimg
  450. this.shopName = shop_name
  451. this.shopShareImg = shop_share_img
  452. }
  453. this.bannerList = slider.map(item => item.pic);
  454. this.sourceBanner = slider
  455. this.goodsList = goods_cate;
  456. this.commonDataList = goods_online;
  457. this.msGoodsList = seckill_goods;
  458. this.goods_class = goods_class;
  459. this.ponitsBanner = integral_page.length && integral_page[0];
  460. this.giftBanner = gifts_page.length && gifts_page[0];
  461. uni.setStorageSync('mpInfo', {
  462. shopName: this.shopName,
  463. shareImg: this.shopShareImg
  464. })
  465. });
  466. // const data = {
  467. // name: 'sliderread'
  468. // };
  469. // this.$api.getData(data)
  470. // .then((res) => {
  471. // uni.hideLoading();
  472. // console.log("getBanner==>", res.data)
  473. // if (res.data) {
  474. // this.bannerList = res.data;
  475. // } else {}
  476. // })
  477. // .catch(() => {
  478. // uni.hideLoading();
  479. // });
  480. },
  481. toSearchList() {
  482. uni.navigateTo({
  483. url: "/subPages/searchList/searchList",
  484. });
  485. },
  486. getActivityList() {
  487. getActivityList({ page: 1, pageSize: 1}).then(({ data }) => {
  488. this.activityList =data.list
  489. });
  490. },
  491. getMsData() {
  492. uni.showLoading({
  493. title: "加载中",
  494. });
  495. this.$api
  496. .getPSMsList()
  497. .then((res) => {
  498. uni.hideLoading();
  499. // this.msGoodsList = res.data && res.data.list || []
  500. })
  501. .catch(() => {
  502. uni.hideLoading();
  503. });
  504. },
  505. getNewsList() {
  506. getNewsList({
  507. cid: 1,
  508. page: 1,
  509. pageSize: 100,
  510. }).then(({
  511. data = {}
  512. }) => {
  513. this.advList = data.list || [];
  514. });
  515. },
  516. getCommonData(initFlag) {
  517. if (!initFlag) {
  518. if (
  519. this.commonPage.pageNum * this.commonPage.pageSize <
  520. this.commonPage.total
  521. ) {
  522. this.commonPage.pageNum++;
  523. } else {
  524. return;
  525. }
  526. } else {
  527. this.commonPage.pageNum = 1;
  528. this.commonPage.total = 0;
  529. this.commonDataList = [];
  530. }
  531. let sendData = {
  532. limit: this.commonPage.pageSize,
  533. page: this.commonPage.pageNum,
  534. };
  535. uni.showLoading({
  536. title: "加载中",
  537. });
  538. this.$api
  539. .getPSGoodsList(sendData)
  540. .then((res) => {
  541. uni.hideLoading();
  542. if (res.code == 1) {
  543. const {
  544. list = [], page = {}
  545. } = res.data;
  546. this.commonDataList = this.commonDataList.concat(list);
  547. this.commonPage.total = page.total;
  548. }
  549. })
  550. .catch((err) => {
  551. uni.hideLoading();
  552. });
  553. },
  554. getFlowData(initFlag) {
  555. if (!initFlag) {
  556. if (
  557. this.flowPage.pageNum * this.flowPage.pageSize <
  558. this.flowPage.total
  559. ) {
  560. this.flowPage.pageNum++;
  561. } else {
  562. return;
  563. }
  564. } else {
  565. this.flowPage.pageNum = 1;
  566. this.flowPage.total = 0;
  567. this.flowDataList = [];
  568. }
  569. let sendData = {
  570. limit: this.flowPage.pageSize,
  571. page: this.flowPage.pageNum,
  572. };
  573. uni.showLoading({
  574. title: "加载中",
  575. });
  576. this.$api
  577. .getFlowData(sendData)
  578. .then((res) => {
  579. uni.hideLoading();
  580. if (res.code == 1) {
  581. const {
  582. list = [], page = {}
  583. } = res.data;
  584. this.flowDataList = this.flowDataList.concat(list);
  585. this.flowPage.total = page.total;
  586. }
  587. })
  588. .catch((err) => {
  589. uni.hideLoading();
  590. });
  591. },
  592. searchChange() {
  593. },
  594. toDetail(item) {
  595. uni.navigateTo({
  596. url: "../../subPages/commerceDetail/commerceDetail?id=" + item.id,
  597. });
  598. },
  599. toList(item) {
  600. uni.setStorageSync('currentCateid', item.id)
  601. uni.switchTab({
  602. url: `/pages/productCenter/productCenter?cateid=${item.id}`,
  603. });
  604. },
  605. handleAdv(index) {
  606. const activeAdv = this.advList[index];
  607. uni.navigateTo({
  608. url: `/pages/article/article?id=${activeAdv.id}`,
  609. });
  610. },
  611. },
  612. };
  613. </script>
  614. <style lang="scss" scoped>
  615. .ps-wrapper {
  616. background-color: $primary-bg-color;
  617. padding-top: 60rpx;
  618. .adv-box {
  619. position: relative;
  620. // padding: 0 33rpx 20rpx;
  621. height: 64rpx;
  622. background-color: white;
  623. padding: 0 20rpx 0;
  624. border-radius: 16rpx;
  625. margin: 40rpx 0 20rpx;
  626. font-weight: 500;
  627. .adv-icon {
  628. position: absolute;
  629. left: 6rpx;
  630. top: 50%;
  631. transform: translateY(-50%);
  632. }
  633. ::v-deep {
  634. .u-notice__left-icon {
  635. width: 19px;
  636. .u-icon__icon {
  637. display: none;
  638. }
  639. }
  640. }
  641. }
  642. .custom-indicator {
  643. position: absolute;
  644. left: 0rpx;
  645. right: 0rpx;
  646. bottom: 29rpx;
  647. width: 712rpx;
  648. display: flex;
  649. margin: 0 20rpx 0 20rpx;
  650. flex-direction: row;
  651. justify-content: center;
  652. transform: translateX(-48rpx);
  653. .custom-indicator-item {
  654. width: 16rpx;
  655. height: 16rpx;
  656. margin: 0 6rpx;
  657. border-radius: 12rpx;
  658. background-color: #666666;
  659. }
  660. .banner-active {
  661. width: 48rpx;
  662. background-color: #222222;
  663. }
  664. }
  665. .slot-wrap {
  666. background-color: red;
  667. }
  668. .content-box {
  669. // overflow-y: auto;
  670. background-color: $primary-bg-color;
  671. padding: 20rpx 0 0;
  672. .part-box {
  673. background: linear-gradient(180deg, #fdd118 0%, #f7f7f7 100%);
  674. border-radius: 10rpx 10rpx 10rpx 10rpx;
  675. padding: 18rpx 14rpx;
  676. .part-list {
  677. display: flex !important;
  678. flex-direction: row !important;
  679. // justify-content: space-between;
  680. background-color: #fff;
  681. border-radius: 10rpx;
  682. padding: 15rpx 15rpx 30rpx;
  683. font-size: 24rpx;
  684. color: #1d161f;
  685. margin-top: 15rpx;
  686. &-item {
  687. width: calc(33% - 10rpx);
  688. margin-right: 10rpx;
  689. }
  690. }
  691. }
  692. }
  693. .header-box {
  694. width: 100%;
  695. .banner-container {
  696. position: relative;
  697. width: 100%;
  698. .logo-search-container {
  699. position: absolute;
  700. top: 8%;
  701. left: 0;
  702. width: 100%;
  703. display: flex;
  704. justify-content: space-between;
  705. align-items: center;
  706. padding: 0 20rpx;
  707. box-sizing: border-box;
  708. .search-box {
  709. margin: 0 auto 0rpx;
  710. height: 61rpx;
  711. background: rgba(255, 255, 255, 0.3);
  712. border-radius: 30rpx;
  713. opacity: 1;
  714. display: flex;
  715. align-items: center;
  716. flex-direction: row;
  717. text {
  718. font-size: 24rpx;
  719. font-family: PingFang SC-Regular, PingFang SC;
  720. font-weight: 400;
  721. color: #9D9D9D;
  722. line-height: 61rpx;
  723. margin-left: 11rpx;
  724. }
  725. }
  726. }
  727. .centered-image {
  728. display: flex;
  729. justify-content: center;
  730. align-items: center;
  731. height: 61rpx;
  732. }
  733. }
  734. .content {
  735. width: 100%;
  736. z-index: 50;
  737. // margin-top: -60rpx;s
  738. .title-tab {
  739. font-size: 34rpx;
  740. color: #aca9af;
  741. font-style: italic;
  742. font-weight: 700;
  743. margin-bottom: 26rpx;
  744. padding: 0 20rpx;
  745. &-item {
  746. margin-right: 30rpx;
  747. }
  748. &-actived {
  749. color: #000;
  750. }
  751. }
  752. }
  753. }
  754. .goods-list {
  755. display: flex;
  756. flex-wrap: wrap;
  757. justify-content: flex-start;
  758. background-color: #FFFFFF;;
  759. padding: 0 20rpx;
  760. padding-top: 40rpx;
  761. &-item {
  762. width: 20%;
  763. flex-shrink: 0;
  764. text-align: center;
  765. margin-bottom: 30rpx;
  766. color: #1d161f;
  767. font-size: 26rpx;
  768. }
  769. }
  770. .biaoti {
  771. width: 100%;
  772. height: 180rpx;
  773. display: flex;
  774. justify-content: center;
  775. align-items: center
  776. }
  777. .huodongText {
  778. font-family: PingFang SC, PingFang SC;
  779. font-weight: 400;
  780. font-size: 26rpx;
  781. color: #333333;
  782. line-height: 36rpx; // 修正拼写错误
  783. text-align: left; // 如果需要水平居中,可以改为 'center'
  784. font-style: normal;
  785. text-transform: none;
  786. height: 98rpx;
  787. display: flex; // 添加 flex 布局
  788. align-items: center; // 垂直居中
  789. margin-left: 30rpx; // 添加左边距
  790. }
  791. .huodongText2 {
  792. font-family: PingFang SC, PingFang SC;
  793. font-weight: 400;
  794. font-size: 20rpx;
  795. color: #666666;
  796. height: 98rpx;
  797. line-height: 28rpx;
  798. text-align: left;
  799. font-style: normal;
  800. display: flex; // 添加 flex 布局
  801. align-items: center; // 垂直居中
  802. text-transform: none;
  803. .huodongText2-img {
  804. margin-right: 15rpx;
  805. margin-left: 15rpx
  806. }
  807. }
  808. }
  809. </style>
  810. <style lang="scss">
  811. page {
  812. height: 100vh;
  813. }
  814. </style>