index.wxss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* 整体tabBar容器 */
  2. .tab-bar {
  3. position: fixed;
  4. bottom: 0;
  5. left: 0;
  6. right: 0;
  7. height: 100rpx;
  8. background: #FFFFFF;
  9. display: flex;
  10. flex-direction: column;
  11. z-index: 9999;
  12. box-sizing: border-box;
  13. }
  14. /* 顶部边框线 */
  15. .tab-bar-border {
  16. height: 1rpx;
  17. background-color: #E5E5E5;
  18. }
  19. /* tabBar内容容器 */
  20. .tab-bar-content {
  21. flex: 1;
  22. display: flex;
  23. align-items: center;
  24. justify-content: space-around;
  25. padding: 0 20rpx;
  26. position: relative;
  27. }
  28. /* 普通tab项 */
  29. .tab-bar-item {
  30. flex: 1;
  31. display: flex;
  32. justify-content: center;
  33. align-items: center;
  34. height: 100%;
  35. }
  36. /* 普通tab项内容 */
  37. .tab-item-content {
  38. display: flex;
  39. flex-direction: column;
  40. align-items: center;
  41. justify-content: center;
  42. height: 100%;
  43. }
  44. /* 普通图标 */
  45. .tab-icon {
  46. width: 44rpx;
  47. height: 44rpx;
  48. margin-bottom: 4rpx;
  49. }
  50. /* 普通文字 */
  51. .tab-text {
  52. font-size: 20rpx;
  53. line-height: 1;
  54. }
  55. /* 特殊按钮容器 */
  56. .special-item {
  57. position: relative;
  58. z-index: 2;
  59. }
  60. /* 特殊按钮整体 */
  61. .special-button {
  62. display: flex;
  63. flex-direction: column;
  64. align-items: center;
  65. justify-content: center;
  66. height: 100%;
  67. position: relative;
  68. }
  69. /* 特殊按钮背景 */
  70. .special-button-bg {
  71. width: 100rpx;
  72. height: 100rpx;
  73. border-radius: 50%;
  74. background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. position: relative;
  79. top: -20rpx;
  80. box-shadow: 0 4rpx 12rpx rgba(255, 165, 0, 0.3);
  81. border: 4rpx solid #FFFFFF;
  82. box-sizing: border-box;
  83. }
  84. /* 特殊按钮图标容器 */
  85. .special-icon-container {
  86. width: 100%;
  87. height: 100%;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. }
  92. /* 特殊按钮图标 */
  93. .special-icon {
  94. width: 48rpx;
  95. height: 48rpx;
  96. }
  97. /* 特殊按钮文字 */
  98. .special-text {
  99. font-size: 20rpx;
  100. line-height: 1;
  101. position: relative;
  102. top: -15rpx;
  103. margin-top: 4rpx;
  104. }
  105. /* 点击态效果 */
  106. .tab-bar-item:active {
  107. background-color: rgba(0, 0, 0, 0.05);
  108. }
  109. .special-item:active .special-button-bg {
  110. transform: scale(0.95);
  111. box-shadow: 0 2rpx 8rpx rgba(255, 165, 0, 0.4);
  112. }
  113. /* 安全区域适配 */
  114. @supports (bottom: env(safe-area-inset-bottom)) {
  115. .tab-bar {
  116. padding-bottom: env(safe-area-inset-bottom);
  117. height: calc(100rpx + env(safe-area-inset-bottom));
  118. }
  119. }
  120. /* 兼容iPhone X等机型 */
  121. @supports (bottom: constant(safe-area-inset-bottom)) {
  122. .tab-bar {
  123. padding-bottom: constant(safe-area-inset-bottom);
  124. height: calc(100rpx + constant(safe-area-inset-bottom));
  125. }
  126. }