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.

235 lines
7.6 KiB

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