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.

174 lines
4.6 KiB

  1. <template>
  2. <view class="static-footer-bar" :style="{ 'padding-bottom': safeAreaInsets.bottom + 'px' }">
  3. <view class="static-footer-li ellipsis" @click="tabChange(1)">
  4. <image src="../static/footBar-image/c1.png" class="static-footer-li-icon" v-if="type != 'home'"></image>
  5. <image src="../static/footBar-image/logo.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 ellipsis" @click="tabChange(2)">
  10. <image src="../static/footBar-image/c2.png" class="static-footer-li-icon" v-if="type != 'marketSituation'">
  11. </image>
  12. <image src="../static/footBar-image/logo.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 ellipsis" @click="tabChange(3)">
  18. <image src="../static/footBar-image/logo.png" class="static-footer-li-icon" v-if="type != 'deepMate'"></image>
  19. <image src="../static/footBar-image/logo.png" class="static-footer-li-icon" 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 ellipsis" @click="tabChange(4)">
  25. <image src="../static/footBar-image/c4.png" class="static-footer-li-icon" v-if="type != 'deepExploration'">
  26. </image>
  27. <image src="../static/footBar-image/logo.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 ellipsis" @click="tabChange(5)">
  33. <image src="../static/footBar-image/c5.png" class="static-footer-li-icon" v-if="type != 'member'"></image>
  34. <image src="../static/footBar-image/logo.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/home/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: 100rpx;
  98. border-top: 1px solid #E2E2E2;
  99. background: #fff;
  100. }
  101. .static-footer-li {
  102. display: inline-block;
  103. width: 20%;
  104. height: 100%;
  105. text-align: center;
  106. position: relative;
  107. }
  108. .static-footer-li-icon {
  109. width: 46rpx;
  110. height: 46rpx;
  111. margin: 12rpx 0;
  112. }
  113. .static-footer-li-title {
  114. width: 100%;
  115. height: 40rpx;
  116. line-height: 40rpx;
  117. font-size: 24rpx;
  118. text-align: center;
  119. margin-top: -20rpx;
  120. color: gray;
  121. }
  122. .static-footer-li-title1 {
  123. width: 100%;
  124. height: 40rpx;
  125. line-height: 40rpx;
  126. font-size: 24rpx;
  127. text-align: center;
  128. margin-top: -20rpx;
  129. color: black;
  130. }
  131. .unreadNum {
  132. position: absolute;
  133. right: 15%;
  134. background-color: #f00;
  135. color: #fff;
  136. font-size: 24rpx;
  137. padding: 0 6rpx;
  138. height: 36rpx;
  139. line-height: 36rpx;
  140. min-width: 36rpx;
  141. border-radius: 18rpx;
  142. z-index: 9;
  143. }
  144. .taskNew {
  145. position: absolute;
  146. right: 15%;
  147. height: 30rpx;
  148. z-index: 9;
  149. }
  150. .homeWorkUnRead {
  151. position: absolute;
  152. right: 30%;
  153. top: 10%;
  154. background-color: #f00;
  155. color: #fff;
  156. height: 12rpx;
  157. width: 12rpx;
  158. border-radius: 6rpx;
  159. z-index: 9;
  160. }
  161. </style>