index.wxss 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* 整体容器 */
  2. .tab-bar {
  3. position: fixed;
  4. bottom: 0;
  5. left: 0;
  6. right: 0;
  7. z-index: 999;
  8. background: transparent;
  9. /* 为安全区留空 */
  10. padding-bottom: env(safe-area-inset-bottom);
  11. }
  12. .tab-bar-inner {
  13. display: flex;
  14. align-items: stretch;
  15. background: #fff;
  16. border-radius: 32rpx 32rpx 0 0;
  17. box-shadow: 0 -4rpx 24rpx rgba(100, 60, 20, 0.12);
  18. border-top: 1rpx solid rgba(200, 168, 130, 0.25);
  19. overflow: hidden;
  20. }
  21. /* 每个 Tab 项 */
  22. .tab-item {
  23. flex: 1;
  24. display: flex;
  25. flex-direction: column;
  26. align-items: center;
  27. padding: 12rpx 0 18rpx;
  28. position: relative;
  29. transition: all 0.2s ease;
  30. }
  31. .tab-item:active {
  32. opacity: 0.75;
  33. }
  34. /* 顶部激活条 */
  35. .tab-indicator {
  36. position: absolute;
  37. top: 0;
  38. left: 50%;
  39. transform: translateX(-50%) scaleX(0);
  40. width: 48rpx;
  41. height: 6rpx;
  42. border-radius: 0 0 6rpx 6rpx;
  43. background: linear-gradient(90deg, #8B4513, #D2691E);
  44. transition: transform 0.25s ease;
  45. }
  46. .indicator-show {
  47. transform: translateX(-50%) scaleX(1);
  48. }
  49. /* 图标区域 */
  50. .tab-icon-wrap {
  51. width: 80rpx;
  52. height: 56rpx;
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. margin-bottom: 6rpx;
  57. position: relative;
  58. }
  59. .tab-svg-box {
  60. position: relative;
  61. width: 52rpx;
  62. height: 52rpx;
  63. display: flex;
  64. align-items: center;
  65. justify-content: center;
  66. }
  67. /* 激活时的圆形背景 */
  68. .tab-icon-bg {
  69. position: absolute;
  70. inset: -8rpx;
  71. border-radius: 20rpx;
  72. background: transparent;
  73. transition: background 0.2s ease;
  74. }
  75. .icon-bg-active {
  76. background: rgba(139, 69, 19, 0.1);
  77. }
  78. /* 图标本体 — 用 mask + background 实现着色 SVG */
  79. .tab-icon-img {
  80. width: 44rpx;
  81. height: 44rpx;
  82. background-color: #b0a090;
  83. transition: background-color 0.2s ease;
  84. -webkit-mask-size: contain;
  85. -webkit-mask-repeat: no-repeat;
  86. -webkit-mask-position: center;
  87. mask-size: contain;
  88. mask-repeat: no-repeat;
  89. mask-position: center;
  90. }
  91. .icon-img-active {
  92. background-color: #8B4513;
  93. }
  94. /* 首页 - 房子图标 */
  95. .icon-0 {
  96. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  97. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  98. }
  99. /* 世系查询 - 树形/关系图标 */
  100. .icon-1 {
  101. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z'/%3E%3C/svg%3E");
  102. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z'/%3E%3C/svg%3E");
  103. }
  104. /* 我的录入 - 编辑图标 */
  105. .icon-2 {
  106. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
  107. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
  108. }
  109. /* 家族圈 - 人群图标 */
  110. .icon-3 {
  111. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
  112. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
  113. }
  114. /* 文字标签 */
  115. .tab-label {
  116. font-size: 20rpx;
  117. color: #b0a090;
  118. transition: color 0.2s ease, font-weight 0.2s ease;
  119. letter-spacing: 1rpx;
  120. }
  121. .tab-label-active {
  122. color: #8B4513;
  123. font-weight: 700;
  124. }