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.

192 lines
5.2 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="static-footer-bar" :style="{ 'padding-bottom': safeAreaInsets.bottom + 'px' }">
  3. <view class="static-footer-li" @click="tabChange(1)">
  4. <image src="../static/footBar-image/home.png" class="static-footer-li-icon" v-if="type != 'home'"></image>
  5. <image src="../static/footBar-image/home-selected.png" class="static-footer-li-icon" v-if="type == 'home'"></image>
  6. <view :class="type == 'home' ? 'static-footer-li-title1' : 'static-footer-li-title'">
  7. {{ $t('components.footerBar.homepage') }}</view>
  8. </view>
  9. <view class="static-footer-li" @click="tabChange(2)">
  10. <image src="../static/footBar-image/marketSituation.png" class="static-footer-li-icon" v-if="type != 'marketSituation'">
  11. </image>
  12. <image src="../static/footBar-image/marketSituation-selected.png" class="static-footer-li-icon"
  13. v-if="type == 'marketSituation'"></image>
  14. <view :class="type == 'marketSituation' ? 'static-footer-li-title1' : 'static-footer-li-title'">
  15. {{ $t('components.footerBar.marketSituation') }}</view>
  16. </view>
  17. <view class="static-footer-li static-footer-li-special" @click="tabChange(3)">
  18. <image src="../static/footBar-image/deepMate.png" class="static-footer-li-icon static-footer-li-icon-special" v-if="type != 'deepMate'"></image>
  19. <image src="../static/footBar-image/deepMate-selected.png" class="static-footer-li-icon static-footer-li-icon-special" v-if="type == 'deepMate'">
  20. </image>
  21. <view :class="type == 'deepMate' ? 'static-footer-li-title1' : 'static-footer-li-title'">
  22. {{ $t('components.footerBar.deepMate') }}</view>
  23. </view>
  24. <view class="static-footer-li" @click="tabChange(4)">
  25. <image src="../static/footBar-image/deepExploration.png" class="static-footer-li-icon" v-if="type != 'deepExploration'">
  26. </image>
  27. <image src="../static/footBar-image/deepExploration-selected.png" class="static-footer-li-icon"
  28. v-if="type == 'deepExploration'"></image>
  29. <view :class="type == 'deepExploration' ? 'static-footer-li-title1' : 'static-footer-li-title'">
  30. {{ $t('components.footerBar.deepExploration') }}</view>
  31. </view>
  32. <view class="static-footer-li" @click="tabChange(5)">
  33. <image src="../static/footBar-image/member.png" class="static-footer-li-icon" v-if="type != 'member'"></image>
  34. <image src="../static/footBar-image/member-selected.png" class="static-footer-li-icon" v-if="type == 'member'"></image>
  35. <view :class="type == 'member' ? 'static-footer-li-title1' : 'static-footer-li-title'">
  36. {{ $t('components.footerBar.member') }}</view>
  37. </view>
  38. </view>
  39. </template>
  40. <script setup>
  41. import { computed, onMounted } from 'vue'
  42. // 定义 props
  43. const props = defineProps({
  44. type: {
  45. type: String,
  46. default: ''
  47. }
  48. })
  49. // 计算属性:获取安全区域
  50. const safeAreaInsets = computed(() => {
  51. // 获取系统信息中的安全区域
  52. const systemInfo = uni.getSystemInfoSync()
  53. return {
  54. bottom: systemInfo.safeAreaInsets?.bottom || 0
  55. }
  56. })
  57. // 方法:标签切换
  58. const tabChange = (value) => {
  59. // console.log(value)
  60. if (value == 1) { //首页
  61. uni.redirectTo({
  62. url: '/pages/home/home',
  63. animationType: 'fade-in'
  64. })
  65. } else if (value == 2) { //行情
  66. uni.redirectTo({
  67. url: '/pages/home/marketSituation',
  68. animationType: 'fade-in'
  69. })
  70. } else if (value == 3) { //DeepMate
  71. uni.redirectTo({
  72. url: '/pages/deepMate/deepMate',
  73. animationType: 'fade-in'
  74. })
  75. } else if (value == 4) { //深度探索
  76. if (props.type == 'deepExploration') return;
  77. uni.redirectTo({
  78. url: '/pages/home/deepExploration',
  79. animationType: 'fade-in'
  80. })
  81. } else if (value == 5) { //我的
  82. if (props.type == 'member') return;
  83. uni.redirectTo({
  84. url: '/pages/home/member',
  85. animationType: 'fade-in'
  86. })
  87. }
  88. }
  89. // 生命周期
  90. onMounted(() => {
  91. // 组件挂载后的逻辑
  92. })
  93. </script>
  94. <style scoped>
  95. .static-footer-bar {
  96. width: 100%;
  97. height: 120rpx;
  98. border-top: 1px solid #E2E2E2;
  99. background: #fff;
  100. position: relative;
  101. }
  102. .static-footer-li {
  103. display: inline-block;
  104. width: 20%;
  105. height: 100%;
  106. text-align: center;
  107. position: relative;
  108. transform: translateY(-12rpx);
  109. }
  110. .static-footer-li-icon {
  111. width: 46rpx;
  112. height: 46rpx;
  113. margin: 12rpx 0;
  114. }
  115. /* 中间导航项的特殊样式 */
  116. .static-footer-li-special {
  117. position: relative;
  118. z-index: 10;
  119. }
  120. .static-footer-li-icon-special {
  121. width: 95rpx !important;
  122. height: 95rpx !important;
  123. margin: 0rpx 0 !important;
  124. border-radius: 50rpx;
  125. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.2);
  126. transform: translateY(-12rpx);
  127. transition: all 0.3s ease;
  128. }
  129. .static-footer-li-title {
  130. width: 100%;
  131. height: 40rpx;
  132. line-height: 40rpx;
  133. font-size: 24rpx;
  134. text-align: center;
  135. margin-top: -20rpx;
  136. color: gray;
  137. }
  138. .static-footer-li-title1 {
  139. width: 100%;
  140. height: 40rpx;
  141. line-height: 40rpx;
  142. font-size: 24rpx;
  143. text-align: center;
  144. margin-top: -20rpx;
  145. color: black;
  146. }
  147. .unreadNum {
  148. position: absolute;
  149. right: 15%;
  150. background-color: #f00;
  151. color: #fff;
  152. font-size: 24rpx;
  153. padding: 0 6rpx;
  154. height: 36rpx;
  155. line-height: 36rpx;
  156. min-width: 36rpx;
  157. border-radius: 18rpx;
  158. z-index: 9;
  159. }
  160. .taskNew {
  161. position: absolute;
  162. right: 15%;
  163. height: 30rpx;
  164. z-index: 9;
  165. }
  166. .homeWorkUnRead {
  167. position: absolute;
  168. right: 30%;
  169. top: 10%;
  170. background-color: #f00;
  171. color: #fff;
  172. height: 12rpx;
  173. width: 12rpx;
  174. border-radius: 6rpx;
  175. z-index: 9;
  176. }
  177. </style>