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.

286 lines
5.7 KiB

4 weeks ago
  1. <template>
  2. <view class="main">
  3. <!-- 顶部状态栏占位 -->
  4. <view class="top" :style="{height:iSMT+'px'}"></view>
  5. <deepExploration_header></deepExploration_header>
  6. <view class="content">
  7. <view class="select">
  8. <image class="img" :src="navItems[currentIndex].icon" mode=""></image>
  9. <view v-for="(item, index) in navItems" :key="index" class="selectItem"
  10. :class="{ active: currentIndex === index }" @click="currentIndex = index">
  11. <button class="btn"></button>
  12. </view>
  13. </view>
  14. <view class="graphAndTxt">
  15. <view class="graph">
  16. <view class="graph_header">
  17. <view class="left">TESA</view>
  18. <view class="center">
  19. <image class="last" src="/static/deepExploration-images/last.png" mode="aspectFill"></image>
  20. <text>Taewlkj.sejssssssssf</text>
  21. <image class="next" src="/static/deepExploration-images/next.png" mode="aspectFill"></image>
  22. </view>
  23. <view class="right">2025/10/26</view>
  24. </view>
  25. <view class="graph_data">
  26. <text>435.900</text>
  27. <text>22.410</text>
  28. <text>5.120%</text>
  29. </view>
  30. <view class="graph_content"></view>
  31. </view>
  32. <view class="txt">
  33. <view class="txtHeader">
  34. <image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
  35. <text>主力追踪</text>
  36. </view>
  37. <view class="txtContent"></view>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 底部切换栏 -->
  42. <footerBar class="static-footer" :type="type"></footerBar>
  43. </view>
  44. </template>
  45. <script setup>
  46. import {
  47. ref,
  48. onMounted
  49. } from 'vue'
  50. import deepExploration_header from '@/components/deepExploration_header.vue'
  51. import footerBar from '@/components/footerBar.vue'
  52. import {
  53. onLoad
  54. } from '@dcloudio/uni-app'
  55. const type = ref('deepExploration')
  56. const iSMT = ref(0)
  57. const currentIndex = ref(0) // 新增:初始化选中索引,修复点击无效问题
  58. const navItems = ref([{
  59. name: '主力追踪',
  60. icon: '/static/deepExploration-images/1.png',
  61. },
  62. {
  63. name: '主力雷达',
  64. icon: '/static/deepExploration-images/2.png',
  65. },
  66. {
  67. name: '主力解码',
  68. icon: '/static/deepExploration-images/3.png',
  69. },
  70. {
  71. name: '主力资金流',
  72. icon: '/static/deepExploration-images/4.png',
  73. },
  74. ]);
  75. onMounted(() => {
  76. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  77. })
  78. onLoad((e) => {
  79. if (e.index) {
  80. currentIndex.value = e.index - 1
  81. console.log('模块:', currentIndex.value);
  82. }
  83. })
  84. </script>
  85. <style scoped lang="scss">
  86. .main {
  87. width: 100%;
  88. height: 100vh;
  89. background-color: #fff;
  90. .content {
  91. margin-top: 30rpx;
  92. padding-top: 30rpx;
  93. background-color: rgb(248, 248, 248);
  94. .select {
  95. position: relative;
  96. margin-bottom: -5rpx;
  97. .img {
  98. width: 750rpx;
  99. height: 198rpx;
  100. }
  101. .selectItem {
  102. .btn {
  103. position: absolute;
  104. width: 120rpx;
  105. height: 150rpx;
  106. background-color: transparent;
  107. &::after {
  108. border: none;
  109. }
  110. }
  111. &:nth-of-type(1) .btn {
  112. // 对应 index=0
  113. top: 30rpx;
  114. left: 60rpx;
  115. }
  116. &:nth-of-type(2) .btn {
  117. // 对应 index=1
  118. top: 30rpx; // 这里修改会影响 index=1 的按钮
  119. left: 230rpx;
  120. }
  121. &:nth-of-type(3) .btn {
  122. // 对应 index=2
  123. top: 30rpx;
  124. left: 400rpx;
  125. }
  126. &:nth-of-type(4) .btn {
  127. // 对应 index=3
  128. top: 30rpx;
  129. left: 570rpx;
  130. }
  131. }
  132. }
  133. .graphAndTxt {
  134. height: 300rpx;
  135. background-color: #fff;
  136. border-radius: 50rpx 50rpx 0 0;
  137. padding: 68.6rpx 36.5rpx 0 36.5rpx;
  138. .graph {
  139. border: 1rpx solid #e2e2e2;
  140. height: 600rpx;
  141. border-radius: 30rpx 30rpx 0 0;
  142. .graph_header {
  143. padding: 32rpx 20.5rpx 0 24rpx;
  144. display: flex;
  145. align-items: center;
  146. .left {
  147. color: #333333;
  148. font-family: "PingFang SC";
  149. font-size: 15px;
  150. font-style: normal;
  151. font-weight: 400;
  152. line-height: 15px;
  153. }
  154. .center {
  155. margin-left: 105rpx;
  156. display: flex;
  157. align-items: center;
  158. text {
  159. width: 160rpx;
  160. height: 36rpx;
  161. padding-left: 10rpx;
  162. color: #000000;
  163. white-space: nowrap;
  164. overflow: hidden;
  165. text-overflow: ellipsis;
  166. text-align: center;
  167. font-family: "PingFang SC";
  168. font-size: 18px;
  169. font-style: normal;
  170. font-weight: 500;
  171. line-height: 18px;
  172. }
  173. .last {
  174. width: 15rpx;
  175. height: 20rpx;
  176. margin-right: 30rpx;
  177. }
  178. .next {
  179. width: 15rpx;
  180. height: 20rpx;
  181. margin-left: 30rpx;
  182. }
  183. }
  184. .right {
  185. margin-left: 50rpx;
  186. color: #6a6a6a;
  187. font-family: "PingFang SC";
  188. font-size: 13px;
  189. font-style: normal;
  190. font-weight: 400;
  191. line-height: 15px;
  192. }
  193. }
  194. .graph_data {
  195. display: flex;
  196. padding: 48rpx 24rpx;
  197. text {
  198. display: flex;
  199. color: #25ba5d;
  200. font-family: "PingFang SC";
  201. font-size: 17px;
  202. line-height: 17px;
  203. }
  204. text:nth-child(2) {
  205. margin-left: 120rpx;
  206. }
  207. text:nth-child(3) {
  208. margin-left: 150rpx;
  209. }
  210. }
  211. .graph_content {}
  212. }
  213. .txt {
  214. background-color: #F3F3F3;
  215. margin-top: 48rpx;
  216. border-radius: 30rpx;
  217. .txtHeader {
  218. padding: 30rpx 24rpx;
  219. image {
  220. width: 20rpx;
  221. height: 20rpx;
  222. }
  223. text {
  224. background-color: #FFFFFF;
  225. color: #000000;
  226. padding: 0 22rpx;
  227. border-radius: 22rpx;
  228. font-size: 28rpx;
  229. font-weight: 400;
  230. line-height: 37rpx;
  231. }
  232. }
  233. .txtContent {
  234. min-height: 200rpx;
  235. }
  236. }
  237. }
  238. }
  239. .static-footer {
  240. position: fixed;
  241. bottom: 0;
  242. width: 100%; // 补充宽度,避免布局异常
  243. }
  244. }
  245. </style>