与牧同行-小程序用户端
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.

156 lines
3.4 KiB

6 days ago
  1. /* 页面容器 */
  2. .page-container {
  3. width: 100%;
  4. min-height: 100vh;
  5. background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  6. }
  7. /* 按钮组样式 */
  8. .button-group {
  9. width: 92%;
  10. margin: 24rpx auto;
  11. display: flex;
  12. background: #ffffff;
  13. border-radius: 20rpx;
  14. padding: 8rpx;
  15. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
  16. position: relative;
  17. z-index: 10;
  18. }
  19. /* 按钮基础样式 */
  20. .button {
  21. flex: 1;
  22. height: 88rpx;
  23. display: flex;
  24. align-items: center;
  25. justify-content: center;
  26. font-size: 32rpx;
  27. font-weight: 500;
  28. color: #666;
  29. background: transparent;
  30. border-radius: 16rpx;
  31. transition: all 0.3s ease;
  32. position: relative;
  33. overflow: hidden;
  34. }
  35. /* 激活状态按钮 */
  36. .button.active {
  37. background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  38. color: #ffffff;
  39. font-weight: 600;
  40. box-shadow: 0 4rpx 16rpx rgba(106, 17, 203, 0.3);
  41. }
  42. /* 按钮点击效果 */
  43. .button:active {
  44. transform: scale(0.98);
  45. }
  46. /* 地图容器 */
  47. .map-container {
  48. width: 92%;
  49. margin: 0 auto;
  50. border-radius: 24rpx;
  51. overflow: hidden;
  52. box-shadow: 0 12rpx 48rpx rgba(0, 0, 0, 0.15);
  53. height: calc(100vh - 200rpx);
  54. position: relative;
  55. }
  56. /* 地图本身样式 */
  57. .map-container map {
  58. width: 100%;
  59. height: 100%;
  60. border-radius: 24rpx;
  61. display: block; /* 确保正确显示 */
  62. }
  63. /* 问题修复:移除或修改覆盖层 */
  64. /* 原来的 ::before 伪元素会覆盖地图,阻挡交互 */
  65. /* 如果你需要加载状态,可以这样修改: */
  66. .map-container.loading::before {
  67. content: '';
  68. position: absolute;
  69. top: 0;
  70. left: 0;
  71. right: 0;
  72. bottom: 0;
  73. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  74. opacity: 0.3; /* 降低不透明度 */
  75. transition: opacity 0.3s;
  76. border-radius: 24rpx;
  77. z-index: -1; /* 放到地图后面 */
  78. pointer-events: none; /* 关键:不阻挡点击事件 */
  79. }
  80. /* 或者完全移除加载状态样式,因为地图有自己的加载状态 */
  81. /* 地图控制按钮样式(如果需要添加) */
  82. .map-controls {
  83. position: absolute;
  84. right: 24rpx;
  85. bottom: 40rpx;
  86. display: flex;
  87. flex-direction: column;
  88. gap: 16rpx;
  89. z-index: 100;
  90. }
  91. .map-control-btn {
  92. width: 80rpx;
  93. height: 80rpx;
  94. background: rgba(255, 255, 255, 0.95);
  95. border-radius: 50%;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.15);
  100. font-size: 36rpx;
  101. font-weight: bold;
  102. color: #333;
  103. transition: all 0.2s;
  104. border: 1rpx solid rgba(0, 0, 0, 0.1);
  105. }
  106. .map-control-btn:active {
  107. background: rgba(240, 240, 240, 0.95);
  108. transform: scale(0.95);
  109. }
  110. .map-control-btn.location {
  111. background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  112. color: white;
  113. }
  114. /* 响应式适配 */
  115. @media (max-width: 480px) {
  116. .button-group {
  117. width: 94%;
  118. margin: 20rpx auto;
  119. }
  120. .map-container {
  121. width: 94%;
  122. height: calc(100vh - 180rpx);
  123. }
  124. .button {
  125. height: 80rpx;
  126. font-size: 28rpx;
  127. }
  128. .map-controls {
  129. right: 16rpx;
  130. bottom: 30rpx;
  131. }
  132. .map-control-btn {
  133. width: 70rpx;
  134. height: 70rpx;
  135. font-size: 32rpx;
  136. }
  137. }