爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

868 lines
20 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="container safe-area">
  3. <!-- 顶部banner -->
  4. <view class="banner">
  5. <swiper
  6. :indicator-dots="false"
  7. :autoplay="true"
  8. :interval="3000"
  9. :duration="500"
  10. circular
  11. style="width: 100%; height: 380rpx;"
  12. >
  13. <swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
  14. <image :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <view class="content">
  19. <!-- 回收流程 -->
  20. <view class="process-section">
  21. <view class="section-header">
  22. <text class="title">回收流程</text>
  23. </view>
  24. <view class="process-grid">
  25. <view class="process-item" v-for="(item, index) in processes" :key="index">
  26. <image :src="item.icon" mode="aspectFit" class="process-icon"></image>
  27. <text class="process-text">{{item.text}}</text>
  28. <!-- <text class="process-number">{{index + 1}}</text> -->
  29. </view>
  30. </view>
  31. <button class="submit-btn" hover-class="submit-btn-hover" @click="getPickupto">
  32. <text class="submit-btn-hearder">快速免费上门</text>
  33. <text class="btn-desc">点击开始预约</text>
  34. <image src="/static/home/1745478917401 3.png" mode="aspectFit" class="arrow-icon"></image>
  35. <image src="/static/home/1745478917401 4.png" mode="aspectFit" class="arrow-icon-left"></image>
  36. </button>
  37. </view>
  38. <uv-divider :dashed="true" ></uv-divider>
  39. <!-- 服务城市 -->
  40. <view class="city-section" @click="goCity">
  41. <view class="city-header">
  42. <text>已开通包邮服务城市有哪些</text>
  43. <uni-icons type="right" size="16" color="#999"></uni-icons>
  44. </view>
  45. <text class="city-list">{{ cityListStr }}</text>
  46. </view>
  47. <view class="Xiadan-section">
  48. <image src="/static/home/不会下单.png" alt="" class="process-icon"/>
  49. <text class="left-text">不会下单联系客服了解回收流程</text>
  50. <view class="right" @click="goService">
  51. <image src="/static/home/联系客服.png" mode=""></image>
  52. <text>联系客服</text>
  53. </view>
  54. </view>
  55. <!-- 关于我们 -->
  56. <view class="about-section">
  57. <view class="section-header">
  58. <text class="title">关于我们</text>
  59. </view>
  60. <view class="about-footer" @click="goAbout">
  61. <view class="about-header">
  62. <image src="/static/home/关于我们.png" mode="aspectFit" class="logo"></image>
  63. <!-- <text class="about-title">关于我们</text> -->
  64. </view>
  65. <view class="about-content">
  66. <text>免费寄送件验秒到账助环保</text>
  67. <text class="about-desc">让二手交易更轻松让地球多一份绿意</text>
  68. </view>
  69. <uni-icons type="right" size="16" color="#999"></uni-icons>
  70. </view>
  71. </view>
  72. <!-- 价格概览 -->
  73. <view class="price-section">
  74. <view class="section-header">
  75. <text class="title">价格概览</text>
  76. <view class="more">
  77. <uni-icons type="right" size="14" color="#999"></uni-icons>
  78. <text>查看更多</text>
  79. </view>
  80. </view>
  81. <view class="price-grid">
  82. <view class="price-item" v-for="(item, index) in priceList" :key="item.id || index" @tap="goToRecycleCategory(item.id)">
  83. <image v-if="item.icon" :src="item.icon" mode="aspectFit" class="item-icon"></image>
  84. <view v-else class="item-icon placeholder"></view>
  85. <text class="item-name">{{item.name}}</text>
  86. <text class="item-price">¥ {{item.price}}
  87. <text class="item-price-right">/{{item.unit}}</text>
  88. </text>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 最近回收 -->
  93. <view class="recent-section">
  94. <view class="section-header">
  95. <text class="title">最近回收</text>
  96. </view>
  97. <view class="records-grid">
  98. <view
  99. class="record-item"
  100. v-for="(item, index) in records"
  101. :key="index"
  102. @tap="goToInspectionReport(item)"
  103. >
  104. <image :src="item.image" mode=""></image>
  105. <text class="location">{{item.name}}</text>
  106. <text class="user-id">****{{item.phone ? item.phone.slice(-4) : ''}}</text>
  107. <text class="user-id-f">成功完成衣物回收已到账</text>
  108. <text class="amount">+ ¥{{item.price}}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 回收去向 -->
  113. <view class="destination-section">
  114. <view class="section-header">
  115. <text class="title">回收去向</text>
  116. </view>
  117. <view class="destination-grid">
  118. <view class="destination-item " :class="`destination-item${index + 1}`" v-for="(item, index) in destinations" :key="index">
  119. <image :src="item.icon" mode="aspectFit" class="dest-icon"></image>
  120. <view class="dest-info">
  121. <text class="dest-title">{{item.title}}</text>
  122. <text class="dest-desc">{{item.desc}}</text>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <!-- 根据角色显示不同的导航栏 -->
  129. <uv-tabbar
  130. :value="value"
  131. :fixed="true"
  132. @change="changeTo"
  133. >
  134. <uv-tabbar-item text="首页" >
  135. <template v-slot:active-icon>
  136. <image class="icon" src="/static/home/首页-点击.png"></image>
  137. </template>
  138. <template v-slot:inactive-icon>
  139. <image class="icon" src="/static/home/首页-未点击.png"></image>
  140. </template>
  141. </uv-tabbar-item>
  142. <uv-tabbar-item text="回收" >
  143. <template v-slot:active-icon>
  144. <image class="icon" src="/static/home/回收-点击.png"></image>
  145. </template>
  146. <template v-slot:inactive-icon>
  147. <image class="icon" src="/static/home/回收-未点击.png"></image>
  148. </template>
  149. </uv-tabbar-item>
  150. <uv-tabbar-item text="我的" >
  151. <template v-slot:active-icon>
  152. <image class="icon" src="/static/home/我的-点击.png"></image>
  153. </template>
  154. <template v-slot:inactive-icon>
  155. <image class="icon" src="/static/home/我的-未点击.png"></image>
  156. </template>
  157. </uv-tabbar-item>
  158. </uv-tabbar>
  159. </view>
  160. </template>
  161. <script>
  162. import pullRefreshMixin from '../mixins/pullRefreshMixin.js'
  163. export default {
  164. mixins: [pullRefreshMixin],
  165. data() {
  166. return {
  167. value:0,
  168. processes: [
  169. ],
  170. priceList: [],
  171. records: [],
  172. destinations: [
  173. {
  174. icon: '/static/home/爱心援乡.png',
  175. title: '爱心援乡',
  176. desc: '精准帮扶贫困群体'
  177. },
  178. {
  179. icon: '/static/home/回塑新源.png',
  180. title: '回塑新源',
  181. desc: '塑料的第二次成型'
  182. },
  183. {
  184. icon: '/static/home/织物出海.png',
  185. title: '织物出海',
  186. desc: '分拣出最高价值'
  187. },
  188. {
  189. icon: '/static/home/碳循再生.png',
  190. title: '碳循再生',
  191. desc: '减碳从出发生系统'
  192. }
  193. ],
  194. bannerList: [],
  195. pricePreviewList: [],
  196. cityList: []
  197. }
  198. },
  199. computed: {
  200. cityListStr() {
  201. // 只取前8个城市,超出用...结尾
  202. const names = this.cityList.map(c => c.name)
  203. const max = 8
  204. if (names.length > max) {
  205. return names.slice(0, max).join('、') + '...'
  206. }
  207. return names.join('、')
  208. },
  209. },
  210. methods: {
  211. changeTo(e){
  212. this.value = e
  213. console.log(e,'111')
  214. if(e==1){
  215. uni.reLaunch({
  216. url: '/pages/component/recycle'
  217. },true);
  218. }else if(e == 2){
  219. uni.reLaunch({
  220. url: '/pages/component/my'
  221. },true);
  222. }
  223. },
  224. goAbout(){
  225. uni.navigateTo({
  226. url: '/pages/subcomponent/about'
  227. })
  228. },
  229. goCity(){
  230. uni.navigateTo({
  231. url: '/pages/baoyou-city/baoyou-city'
  232. })
  233. },
  234. getPickupto(){
  235. uni.switchTab({
  236. url: '/pages/component/recycle'
  237. })
  238. },
  239. async onRefresh() {
  240. await new Promise(resolve => setTimeout(resolve, 1000))
  241. },
  242. getAreaList() {
  243. this.$api('getAreaList', {}, (res) => {
  244. console.log(res,'getAreaList');
  245. if (res.code == 200 && Array.isArray(res.result)) {
  246. // 按sort升序排序
  247. const sorted = res.result.slice().sort((a, b) => a.sort - b.sort)
  248. this.processes = sorted.map(item => ({
  249. // id: item.id,
  250. icon: item.image,
  251. text: item.title
  252. }))
  253. }
  254. })
  255. },
  256. goService(){
  257. uni.navigateTo({
  258. url: '/pages/subcomponent/admin_faq'
  259. })
  260. },
  261. goToRecycleCategory(id) {
  262. getApp().globalData.targetRecycleCategoryId = id
  263. console.log(getApp().globalData.targetRecycleCategoryId,'getApp().globalData.targetRecycleCategoryId')
  264. uni.switchTab({
  265. url: '/pages/component/recycle'
  266. })
  267. },
  268. getPricePreview() {
  269. const resList = this.pricePreviewList || []
  270. if (Array.isArray(resList)) {
  271. // 只取一级分类,按sort升序
  272. const firstLevel = resList.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
  273. // console.log(firstLevel,'firstLevel');
  274. this.priceList = firstLevel.map(item => {
  275. // 从静态表中找图片和价格
  276. // const staticItem = this.priceListStatic.find(s => s.name.replace(/\s/g, '') === item.title.replace(/\s/g, ''))
  277. // console.log(item,'item');
  278. return {
  279. id: item.id, // 保证有id
  280. icon: item.icon ? item.icon : '',
  281. name: item.title,
  282. price: item.priceNo ? item.priceNo : '',
  283. unit: item.unit ? item.unit : ''
  284. }
  285. })
  286. }
  287. },
  288. getRecentGoods() {
  289. this.$api('getRecentGoodsList', {}, res => {
  290. if (res && res.code === 200 && Array.isArray(res.result) && res.result.length > 0) {
  291. this.records = res.result.map(item => ({
  292. id: item.id,
  293. image: item.image,
  294. name: item.name,
  295. phone: item.phone,
  296. price: item.price
  297. }))
  298. } else {
  299. this.records = []
  300. }
  301. })
  302. },
  303. goToInspectionReport(item) {
  304. uni.navigateTo({
  305. url: `/pages/subcomponent/inspection-report?id=${item.id}`
  306. })
  307. },
  308. getFreeCityList() {
  309. this.$api('getFreeCityList', {}, res => {
  310. if (res && res.code === 200 && Array.isArray(res.result)) {
  311. // 只取一级城市(有children的name)
  312. this.cityList = res.result.map(item => ({ name: item.name })).filter(item => item.name)
  313. } else {
  314. this.cityList = []
  315. }
  316. })
  317. }
  318. },
  319. onLoad() {
  320. this.getAreaList();
  321. this.getPricePreview();
  322. this.getRecentGoods();
  323. this.pricePreviewList = getApp().globalData.pricePreviewList || []
  324. this.bannerList = getApp().globalData.bannerList || []
  325. this.getFreeCityList();
  326. uni.$on('pricePreviewListUpdated', () => {
  327. this.pricePreviewList = getApp().globalData.pricePreviewList || []
  328. this.getPricePreview()
  329. })
  330. uni.$on('bannerListUpdated', () => {
  331. this.bannerList = getApp().globalData.bannerList || []
  332. })
  333. },
  334. onUnload() {
  335. uni.$off('pricePreviewListUpdated')
  336. uni.$off('bannerListUpdated')
  337. },
  338. onShow() {
  339. // 移除自动下拉刷新
  340. // uni.startPullDownRefresh()
  341. this.getPricePreview();
  342. }
  343. }
  344. </script>
  345. <style lang="scss" scoped>
  346. .container {
  347. min-height: 100vh;
  348. background-color: #f8f8f8;
  349. display: flex;
  350. flex-direction: column;
  351. padding-bottom: calc(var(--window-bottom) + 70px);
  352. }
  353. .safe-area {
  354. padding-bottom: constant(safe-area-inset-bottom);
  355. padding-bottom: env(safe-area-inset-bottom);
  356. }
  357. .banner {
  358. width: 100%;
  359. height: 380rpx;
  360. position: relative;
  361. overflow: hidden;
  362. border-radius: 0 0 30rpx 30rpx;
  363. image {
  364. width: 100%;
  365. height: 100%;
  366. }
  367. }
  368. .content {
  369. // flex: 1;
  370. width: 90%;
  371. margin: -70rpx auto 0;
  372. position: relative;
  373. z-index: 3;
  374. padding-bottom: 20rpx;
  375. }
  376. .Xiadan-section{
  377. display: flex;
  378. // justify-content: space-around;
  379. align-items: center;
  380. margin-bottom: 20rpx;
  381. background: linear-gradient(to bottom, #fff3db 0%,#fffefb 50%);
  382. image{
  383. width: 80rpx;
  384. height: 80rpx;
  385. }
  386. .left-text{
  387. font-family: PingFang SC;
  388. font-weight: 400;
  389. font-size: 12px;
  390. line-height: 140%;
  391. letter-spacing: 0%;
  392. }
  393. .right{
  394. display: flex;
  395. // flex-direction: row-reverse;
  396. box-sizing: border-box;
  397. align-items: center;
  398. justify-content: center;
  399. background-color: #fff0d2;
  400. color: #da7143;
  401. font-size: 24rpx;
  402. // flex-grow: 2;
  403. border: 1px solid #da7143;
  404. border-radius: 10rpx;
  405. width: 25%;
  406. image{
  407. width: 40rpx;
  408. height: 40rpx;
  409. }
  410. }
  411. }
  412. .section-header {
  413. display: flex;
  414. // justify-content: space-around;
  415. align-items: center;
  416. margin-bottom: 20rpx;
  417. .title {
  418. font-size: 32rpx;
  419. font-weight: bold;
  420. color: #333;
  421. }
  422. .more {
  423. // justify-content: right;
  424. display: flex;
  425. flex-direction: row-reverse;
  426. align-items: center;
  427. color: #999;
  428. font-size: 24rpx;
  429. flex-grow: 2;
  430. // width: 100%;
  431. // margin-right: 0 auto;
  432. }
  433. }
  434. .process-section {
  435. background: #fff;
  436. border-radius: 50rpx;
  437. padding: 30rpx;
  438. margin-bottom: 20rpx;
  439. background: linear-gradient(to bottom, #fff5e1 0%,#fffefb 30%);
  440. .contact-service {
  441. display: flex;
  442. align-items: center;
  443. font-size: 24rpx;
  444. color: #666;
  445. border: 1px solid #da7143;
  446. background-color: #fff0d2;
  447. .service-icon {
  448. width: 32rpx;
  449. height: 32rpx;
  450. margin-right: 8rpx;
  451. }
  452. }
  453. .process-grid {
  454. display: grid;
  455. grid-template-columns: repeat(4, 1fr);
  456. gap: 20rpx;
  457. margin: 30rpx 0;
  458. border: none;
  459. }
  460. .process-item {
  461. position: relative;
  462. display: flex;
  463. flex-direction: column;
  464. align-items: center;
  465. background-color: #fff8ea;
  466. // left: 0; right: 0;
  467. .process-icon {
  468. width: 80rpx;
  469. height: 80rpx;
  470. margin-bottom: 10rpx;
  471. }
  472. .process-text {
  473. font-size: 24rpx;
  474. color: #333;
  475. }
  476. .process-number {
  477. position: absolute;
  478. top: -10rpx;
  479. left: 50%;
  480. transform: translateX(-50%);
  481. font-size: 24rpx;
  482. color: #999;
  483. }
  484. }
  485. .submit-btn {
  486. background: linear-gradient(to right, #ffd01e, #ff8917);
  487. border-radius: 70rpx;
  488. padding: 20rpx;
  489. text-align: center;
  490. position: relative;
  491. border: none;
  492. display: flex;
  493. flex-direction: column;
  494. overflow: visible;
  495. text {
  496. color: #ffffff;
  497. font-size: 32rpx;
  498. font-weight: bold;
  499. line-height: 40rpx;
  500. // display: block;
  501. }
  502. .btn-desc {
  503. font-size: 24rpx;
  504. font-weight: normal;
  505. // margin-top: 4rpx;
  506. }
  507. .arrow-icon {
  508. position: absolute;
  509. right: 10rpx;
  510. top: 10%;
  511. transform: translateY(-50%);
  512. width: 40rpx;
  513. height: 40rpx;
  514. // z-index: 5;
  515. }
  516. .arrow-icon-left {
  517. position: absolute;
  518. left: 1rpx;
  519. top: 90%;
  520. transform: translateY(-50%);
  521. width: 40rpx;
  522. height: 40rpx;
  523. // z-index: 4;
  524. }
  525. }
  526. .submit-btn::after{
  527. border: none !important;
  528. }
  529. }
  530. .city-section {
  531. background: #fff;
  532. border-radius: 20rpx;
  533. padding: 30rpx;
  534. margin-bottom: 20rpx;
  535. .city-header {
  536. display: flex;
  537. justify-content: space-between;
  538. align-items: center;
  539. font-size: 28rpx;
  540. color: #333;
  541. margin-bottom: 10rpx;
  542. }
  543. .city-list {
  544. font-size: 24rpx;
  545. color: #999;
  546. }
  547. }
  548. .price-section {
  549. background: #f0f9eb;
  550. border-radius: 20rpx;
  551. padding: 30rpx;
  552. margin-bottom: 20rpx;
  553. background-color: #fffefb;
  554. background: linear-gradient(to bottom, #fff3db 0%,#fffefb 5%);
  555. .section-header{
  556. margin-bottom: 40rpx;
  557. }
  558. .price-grid {
  559. display: grid;
  560. grid-template-columns: repeat(2, 1fr);
  561. gap: 20rpx;
  562. }
  563. .price-item {
  564. display: flex;
  565. flex-direction: column;
  566. align-items: center;
  567. background: #fff;
  568. border-radius: 16rpx;
  569. padding: 30rpx;
  570. background-color: #fff8ea;
  571. .item-icon {
  572. width: 80rpx;
  573. height: 80rpx;
  574. margin-bottom: 10rpx;
  575. &.placeholder {
  576. width: 80rpx;
  577. height: 80rpx;
  578. margin-bottom: 10rpx;
  579. background: #f5f5f5;
  580. border-radius: 16rpx;
  581. }
  582. }
  583. .item-name {
  584. font-size: 26rpx;
  585. color: #333;
  586. margin-bottom: 6rpx;
  587. }
  588. .item-price {
  589. font-family: PingFang SC;
  590. font-weight: 400;
  591. font-size: 24rpx;
  592. line-height: 140%;
  593. letter-spacing: 0%;
  594. text-align: center;
  595. .item-price-right{
  596. text-align: center;
  597. font-size: 24rpx;
  598. color: #666;
  599. line-height: 140%;
  600. letter-spacing: 0%;
  601. }
  602. }
  603. }
  604. }
  605. .recent-section {
  606. background: #f0f9eb;
  607. border-radius: 20rpx;
  608. padding: 30rpx;
  609. margin-bottom: 20rpx;
  610. background-color: #fffefb;
  611. background: linear-gradient(to bottom, #e8ffe0 0%,#fffefb 15%);
  612. .records-grid {
  613. display: grid;
  614. grid-template-columns: repeat(3, 1fr);
  615. gap: 20rpx;
  616. }
  617. .record-item {
  618. display: flex;
  619. flex-direction: column;
  620. align-items: center;
  621. background: linear-gradient(to top, #e8ffe0 0%,#fffefb 100%);
  622. border-radius: 16rpx;
  623. padding: 10rpx;
  624. background-color: #fff8ea;
  625. image{
  626. width: 60rpx;
  627. height: 60rpx;
  628. }
  629. .location {
  630. font-size: 28rpx;
  631. color: #333;
  632. font-weight: bold;
  633. }
  634. .amount {
  635. font-size: 30rpx;
  636. color: #13ac47;
  637. font-weight: bold;
  638. margin: 6rpx 0;
  639. }
  640. .user-id {
  641. font-family: PingFang SC;
  642. font-weight: 500;
  643. font-size: 24rpx;
  644. line-height: 140%;
  645. letter-spacing: 0%;
  646. text-align: center;
  647. color: #183c5c;
  648. }
  649. .user-id-f{
  650. font-family: PingFang SC;
  651. font-weight: 400;
  652. font-size: 22rpx;
  653. line-height: 140%;
  654. letter-spacing: 0%;
  655. text-align: center;
  656. color: #9b9b9b;
  657. }
  658. }
  659. }
  660. .destination-section {
  661. // background: #fff;
  662. border-radius: 20rpx;
  663. padding: 30rpx;
  664. margin-bottom: 20rpx;
  665. background: linear-gradient(to bottom, #f2f0fc 0%,#fffefb 10%);
  666. padding-bottom: calc(var(--window-bottom) + 60px);
  667. .destination-grid {
  668. display: grid;
  669. grid-template-columns: repeat(2, 1fr);
  670. gap: 20rpx;
  671. }
  672. .destination-item {
  673. display: flex;
  674. align-items: center;
  675. // background: #fff9f9;
  676. border-radius: 16rpx;
  677. padding: 20rpx;
  678. .dest-icon {
  679. width: 60rpx;
  680. height: 60rpx;
  681. margin-right: 16rpx;
  682. }
  683. .dest-info {
  684. flex: 1;
  685. .dest-title {
  686. font-size: 26rpx;
  687. color: #333;
  688. margin-bottom: 4rpx;
  689. }
  690. .dest-desc {
  691. font-size: 22rpx;
  692. color: #999;
  693. }
  694. }
  695. }
  696. }
  697. .destination-item1{
  698. background: linear-gradient(to top, #ffebeb,#fffefb);
  699. }
  700. .destination-item2{
  701. background: linear-gradient(to top, #ebf8ff,#fffefb);
  702. }
  703. .destination-item3{
  704. background: linear-gradient(to top, #ebedff,#fffefb);
  705. }
  706. .destination-item4{
  707. background: linear-gradient(to top, #ebfff2,#fffefb);
  708. }
  709. .about-section {
  710. background: linear-gradient(to bottom, #fff3db 0%,#fffefb 30%);
  711. border-radius: 20rpx;
  712. padding: 30rpx;
  713. display: flex;
  714. justify-content: space-between;
  715. flex-direction: column;
  716. .about-footer{
  717. display: flex;
  718. flex-direction: row;
  719. align-items: center;
  720. justify-content: center;
  721. }
  722. .about-header {
  723. display: flex;
  724. align-items: center;
  725. .logo {
  726. width: 60rpx;
  727. height: 60rpx;
  728. margin-right: 16rpx;
  729. }
  730. .about-title {
  731. font-size: 28rpx;
  732. color: #333;
  733. }
  734. }
  735. .about-content {
  736. flex: 1;
  737. margin-left: 20rpx;
  738. text {
  739. display: block;
  740. font-size: 26rpx;
  741. color: #333;
  742. }
  743. .about-desc {
  744. font-size: 22rpx;
  745. color: #999;
  746. margin-top: 4rpx;
  747. }
  748. }
  749. }
  750. .tab-bar {
  751. position: fixed;
  752. bottom: 0;
  753. left: 0;
  754. right: 0;
  755. height: 100rpx;
  756. background-color: #fff;
  757. display: flex;
  758. justify-content: space-around;
  759. align-items: center;
  760. border-top: 1rpx solid #f5f5f5;
  761. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  762. .tab-item {
  763. display: flex;
  764. flex-direction: column;
  765. align-items: center;
  766. padding: 10rpx 0;
  767. transition: all 0.3s ease;
  768. .tab-icon {
  769. width: 48rpx;
  770. height: 48rpx;
  771. margin-bottom: 6rpx;
  772. }
  773. text {
  774. font-size: 22rpx;
  775. color: #666;
  776. transition: color 0.3s ease;
  777. }
  778. &.active {
  779. text {
  780. color: #ff5e00;
  781. }
  782. }
  783. &:active {
  784. transform: scale(0.95);
  785. }
  786. }
  787. }
  788. @keyframes fadeInUp {
  789. from {
  790. opacity: 0;
  791. transform: translateY(20rpx);
  792. }
  793. to {
  794. opacity: 1;
  795. transform: translateY(0);
  796. }
  797. }
  798. @keyframes fadeInScale {
  799. from {
  800. opacity: 0;
  801. transform: scale(0.8);
  802. }
  803. to {
  804. opacity: 1;
  805. transform: scale(1);
  806. }
  807. }
  808. </style>