index.vue 22 KB

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