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.

735 lines
13 KiB

4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
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="search">
  7. <input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
  8. placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
  9. <image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
  10. mode="aspectFill"></image>
  11. </view>
  12. <view class="content">
  13. <view class="select">
  14. <image class="img" :src="navItems[currentIndex].icon" mode=""></image>
  15. <view v-for="(item, index) in navItems" :key="index" class="selectItem"
  16. :class="{ active: currentIndex === index }" @click="handleModel(index)">
  17. <button class="btn"></button>
  18. </view>
  19. </view>
  20. <view class="graphAndTxt">
  21. <view class="graph">
  22. <view class="graph_header">
  23. <view class="left">TESA</view>
  24. <view class="center">
  25. <image class="last" src="/static/deepExploration-images/last.png" mode="aspectFill"></image>
  26. <text>Taewlkj.sejssssssssf</text>
  27. <image class="next" src="/static/deepExploration-images/next.png" mode="aspectFill"></image>
  28. </view>
  29. <view class="right">2025/10/26</view>
  30. </view>
  31. <view class="graph_data">
  32. <text>435.900</text>
  33. <text>22.410</text>
  34. <text>5.120%</text>
  35. </view>
  36. <view class="graph_content">
  37. <view class="charts-box">
  38. <!-- uCharts 蜡烛图组件 -->
  39. <qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true"
  40. :ontouch="true" :onzoom="true" />
  41. </view>
  42. </view>
  43. </view>
  44. <view class="txt">
  45. <view class="txtHeader">
  46. <image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
  47. <text>主力追踪</text>
  48. </view>
  49. <view class="txtContent"></view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 底部切换栏 -->
  54. <footerBar class="static-footer" :type="type"></footerBar>
  55. </view>
  56. </template>
  57. <script setup>
  58. import {
  59. ref,
  60. onMounted
  61. } from 'vue'
  62. import deepExploration_header from '@/components/deepExploration_header.vue'
  63. import footerBar from '@/components/footerBar.vue'
  64. import {
  65. onLoad
  66. } from '@dcloudio/uni-app'
  67. // 响应式变量定义
  68. const type = ref('deepExploration')
  69. const iSMT = ref(0)
  70. const currentIndex = ref(0)
  71. const navItems = ref([{
  72. name: '主力追踪',
  73. icon: '/static/deepExploration-images/1.png'
  74. },
  75. {
  76. name: '主力雷达',
  77. icon: '/static/deepExploration-images/2.png'
  78. },
  79. {
  80. name: '主力解码',
  81. icon: '/static/deepExploration-images/3.png'
  82. },
  83. {
  84. name: '主力资金流',
  85. icon: '/static/deepExploration-images/4.png'
  86. },
  87. ])
  88. //点击四大模块
  89. const handleModel = (index) => {
  90. currentIndex.value = index
  91. if (currentIndex.value == 0) {
  92. console.log(index);
  93. handleTrack()
  94. } else if (currentIndex.value == 1) {
  95. console.log(index);
  96. handleRadar()
  97. } else if (currentIndex.value == 2) {
  98. console.log(index);
  99. handleDecode()
  100. } else if (currentIndex.value == 3) {
  101. console.log(index);
  102. handleCapitalFlow()
  103. }
  104. }
  105. //点击主力追踪
  106. const handleTrack = () => {
  107. }
  108. //点击主力雷达
  109. const handleRadar = () => {
  110. }
  111. //点击主力解码
  112. const handleDecode = () => {
  113. }
  114. //点击主力资金流
  115. const handleCapitalFlow = () => {
  116. }
  117. const stockName = ref('TSLA')
  118. //搜索股票
  119. const searchStock = () => {
  120. console.log('搜索参数:', stockName.value);
  121. }
  122. // 1. K线图配置
  123. const opts = ref({
  124. rotate: false,
  125. rotateLock: false,
  126. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
  127. padding: [15, 15, 0, 15],
  128. dataLabel: false,
  129. enableScroll: true,
  130. enableMarkLine: false,
  131. legend: {},
  132. xAxis: {
  133. labelCount: 4,
  134. itemCount: 30,
  135. disableGrid: true,
  136. gridColor: "#CCCCCC",
  137. gridType: "solid",
  138. dashLength: 4,
  139. scrollShow: false,
  140. scrollAlign: "left",
  141. scrollColor: "#A6A6A6",
  142. scrollBackgroundColor: "#EFEBEF",
  143. labelColor: "#8C8C8C",
  144. fontSize: 9
  145. },
  146. yAxis: {
  147. labelColor: "#8C8C8C",
  148. fontSize: 9
  149. },
  150. extra: {
  151. candle: {
  152. color: {
  153. upLine: "#f04864",
  154. upFill: "#f04864",
  155. downLine: "#2fc25b",
  156. downFill: "#2fc25b"
  157. },
  158. average: {
  159. show: false,
  160. name: ["MA5", "MA10", "MA30"],
  161. day: [5, 10, 20],
  162. color: ["#1890ff", "#2fc25b", "#facc14"]
  163. }
  164. },
  165. markLine: {
  166. type: "dash",
  167. dashLength: 5,
  168. data: [{
  169. value: 2150,
  170. lineColor: "#f04864",
  171. showLabel: false
  172. },
  173. {
  174. value: 2350,
  175. lineColor: "#f04864",
  176. showLabel: false
  177. }
  178. ]
  179. },
  180. tooltip: {
  181. showCategory: true
  182. }
  183. }
  184. })
  185. // 2. K线图数据(响应式定义)
  186. const chartData = ref({})
  187. // 获取K线数据函数(直接定义,无需methods)
  188. const getServerData = () => {
  189. // 模拟服务器请求延时
  190. setTimeout(() => {
  191. const res = {
  192. "categories": [
  193. "2025/08/25",
  194. "2025/08/26",
  195. "2025/08/27",
  196. "2025/08/28",
  197. "2025/08/29",
  198. "2025/09/01",
  199. "2025/09/02",
  200. "2025/09/03",
  201. "2025/09/04",
  202. "2025/09/05",
  203. "2025/09/08",
  204. "2025/09/09",
  205. "2025/09/10",
  206. "2025/09/11",
  207. "2025/09/12",
  208. "2025/09/15",
  209. "2025/09/16",
  210. "2025/09/17",
  211. "2025/09/18",
  212. "2025/09/19",
  213. "2025/09/22",
  214. "2025/09/23",
  215. "2025/09/24",
  216. "2025/09/25",
  217. "2025/09/26",
  218. "2025/09/29",
  219. "2025/09/30",
  220. "2025/10/09",
  221. "2025/10/10",
  222. "2025/10/13",
  223. "2025/10/14",
  224. "2025/10/15",
  225. "2025/10/16",
  226. "2025/10/17",
  227. "2025/10/20",
  228. "2025/10/21",
  229. "2025/10/22",
  230. "2025/10/23",
  231. "2025/10/24",
  232. "2025/10/27"
  233. ],
  234. series: [{
  235. "name": "贵州茅台",
  236. "data": [
  237. [
  238. 1470.01,
  239. 1496.0,
  240. 1466.0,
  241. 1499.33
  242. ],
  243. [
  244. 1490.32,
  245. 1474.23,
  246. 1480.01,
  247. 1481.61
  248. ],
  249. [
  250. 1481.88,
  251. 1484.93,
  252. 1448.0,
  253. 1448.0
  254. ],
  255. [
  256. 1447.97,
  257. 1456.1,
  258. 1438.77,
  259. 1446.1
  260. ],
  261. [
  262. 1453.0,
  263. 1482.58,
  264. 1452.0,
  265. 1480.0
  266. ],
  267. [
  268. 1482.2,
  269. 1488.0,
  270. 1465.7,
  271. 1476.1
  272. ],
  273. [
  274. 1478.66,
  275. 1509.0,
  276. 1478.0,
  277. 1491.3
  278. ],
  279. [
  280. 1491.0,
  281. 1503.5,
  282. 1466.0,
  283. 1480.55
  284. ],
  285. [
  286. 1472.0,
  287. 1479.3,
  288. 1460.47,
  289. 1480.66
  290. ],
  291. [
  292. 1471.0,
  293. 1486.97,
  294. 1464.0,
  295. 1483.0
  296. ],
  297. [
  298. 1483.0,
  299. 1506.44,
  300. 1477.5,
  301. 1501.23
  302. ],
  303. [
  304. 1505.0,
  305. 1509.95,
  306. 1493.42,
  307. 1505.0
  308. ],
  309. [
  310. 1506.66,
  311. 1529.95,
  312. 1496.0,
  313. 1522.01
  314. ],
  315. [
  316. 1522.01,
  317. 1526.02,
  318. 1508.5,
  319. 1523.5
  320. ],
  321. [
  322. 1526.0,
  323. 1538.02,
  324. 1510.53,
  325. 1516.0
  326. ],
  327. [
  328. 1515.87,
  329. 1517.48,
  330. 1501.5,
  331. 1515.1
  332. ],
  333. [
  334. 1515.1,
  335. 1520.99,
  336. 1496.21,
  337. 1499.98
  338. ],
  339. [
  340. 1499.99,
  341. 1510.28,
  342. 1490.01,
  343. 1493.0
  344. ],
  345. [
  346. 1492.0,
  347. 1497.8,
  348. 1463.5,
  349. 1467.96
  350. ],
  351. [
  352. 1467.99,
  353. 1475.5,
  354. 1457.01,
  355. 1467.97
  356. ],
  357. [
  358. 1465.09,
  359. 1467.97,
  360. 1450.01,
  361. 1453.35
  362. ],
  363. [
  364. 1450.5,
  365. 1457.5,
  366. 1440.0,
  367. 1447.42
  368. ],
  369. [
  370. 1434.07,
  371. 1456.78,
  372. 1434.07,
  373. 1442.0
  374. ],
  375. [
  376. 1442.83,
  377. 1445.21,
  378. 1436.0,
  379. 1439.0
  380. ],
  381. [
  382. 1441.18,
  383. 1447.11,
  384. 1428.01,
  385. 1435.0
  386. ],
  387. [
  388. 1439.38,
  389. 1469.99,
  390. 1435.0,
  391. 1460.86
  392. ],
  393. [
  394. 1460.0,
  395. 1460.76,
  396. 1440.0,
  397. 1443.99
  398. ],
  399. [
  400. 1436.0,
  401. 1439.38,
  402. 1420.0,
  403. 1436.78
  404. ],
  405. [
  406. 1437.6,
  407. 1439.94,
  408. 1427.5,
  409. 1430.0
  410. ],
  411. [
  412. 1415.7,
  413. 1422.85,
  414. 1415.12,
  415. 1419.2
  416. ],
  417. [
  418. 1429.99,
  419. 1464.0,
  420. 1429.99,
  421. 1451.02
  422. ],
  423. [
  424. 1450.98,
  425. 1463.0,
  426. 1445.08,
  427. 1462.0
  428. ],
  429. [
  430. 1461.92,
  431. 1484.95,
  432. 1458.88,
  433. 1484.91
  434. ],
  435. [
  436. 1483.1,
  437. 1488.0,
  438. 1454.03,
  439. 1455.0
  440. ],
  441. [
  442. 1455.0,
  443. 1469.5,
  444. 1454.88,
  445. 1457.93
  446. ],
  447. [
  448. 1459.0,
  449. 1469.94,
  450. 1455.5,
  451. 1462.26
  452. ],
  453. [
  454. 1462.08,
  455. 1465.73,
  456. 1456.0,
  457. 1458.7
  458. ],
  459. [
  460. 1455.0,
  461. 1468.8,
  462. 1447.2,
  463. 1467.98
  464. ],
  465. [
  466. 1467.95,
  467. 1478.88,
  468. 1449.34,
  469. 1450.0
  470. ],
  471. [
  472. 1440.0,
  473. 1452.49,
  474. 1435.99,
  475. 1440.41
  476. ]
  477. ],
  478. }]
  479. }
  480. // 给响应式变量赋值(需修改.value)
  481. chartData.value = JSON.parse(JSON.stringify(res))
  482. }, 500)
  483. }
  484. // 生命周期钩子:组件挂载后执行(替代onReady)
  485. onMounted(() => {
  486. iSMT.value = uni.getSystemInfoSync().statusBarHeight
  487. getServerData() // 调用数据获取函数
  488. })
  489. // 页面加载时执行
  490. onLoad((e) => {
  491. if (e.index) {
  492. currentIndex.value = e.index - 1
  493. console.log('模块:', currentIndex.value)
  494. }
  495. if (e.stockName) {
  496. stockName.value = e.stockName
  497. console.log('股票名称:', stockName.value)
  498. }
  499. })
  500. </script>
  501. <style scoped lang="scss">
  502. .main {
  503. width: 100%;
  504. height: 100vh;
  505. background-color: #fff;
  506. .search {
  507. position: relative;
  508. display: flex;
  509. align-items: center;
  510. background-color: #F3F3F3;
  511. width: calc(100% - 60rpx);
  512. height: 80rpx;
  513. border-radius: 50rpx;
  514. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  515. padding: 0 40rpx;
  516. margin: 15rpx 30rpx 0 30rpx;
  517. .seachIcon {
  518. position: absolute;
  519. right: 50rpx;
  520. width: 32rpx;
  521. height: 32rpx;
  522. }
  523. .searchInput {
  524. color: #111;
  525. }
  526. }
  527. .content {
  528. margin-top: 30rpx;
  529. padding-top: 30rpx;
  530. background-color: rgb(248, 248, 248);
  531. .select {
  532. position: relative;
  533. margin-bottom: -5rpx;
  534. .img {
  535. width: 750rpx;
  536. height: 198rpx;
  537. }
  538. .selectItem {
  539. .btn {
  540. position: absolute;
  541. width: 120rpx;
  542. height: 150rpx;
  543. background-color: transparent;
  544. &::after {
  545. border: none;
  546. }
  547. }
  548. &:nth-of-type(1) .btn {
  549. top: 30rpx;
  550. left: 60rpx;
  551. }
  552. &:nth-of-type(2) .btn {
  553. top: 30rpx;
  554. left: 230rpx;
  555. }
  556. &:nth-of-type(3) .btn {
  557. top: 30rpx;
  558. left: 400rpx;
  559. }
  560. &:nth-of-type(4) .btn {
  561. top: 30rpx;
  562. left: 570rpx;
  563. }
  564. }
  565. }
  566. .graphAndTxt {
  567. height: 300rpx;
  568. background-color: #fff;
  569. border-radius: 50rpx 50rpx 0 0;
  570. padding: 68.6rpx 36.5rpx 0 36.5rpx;
  571. .graph {
  572. border: 1rpx solid #e2e2e2;
  573. border-radius: 30rpx 30rpx 0 0;
  574. .graph_header {
  575. padding: 32rpx 20.5rpx 0 24rpx;
  576. display: flex;
  577. align-items: center;
  578. .left {
  579. color: #333333;
  580. font-family: "PingFang SC";
  581. font-size: 15px;
  582. font-style: normal;
  583. font-weight: 400;
  584. line-height: 15px;
  585. }
  586. .center {
  587. margin-left: 105rpx;
  588. display: flex;
  589. align-items: center;
  590. text {
  591. width: 160rpx;
  592. height: 36rpx;
  593. padding-left: 10rpx;
  594. color: #000000;
  595. white-space: nowrap;
  596. overflow: hidden;
  597. text-overflow: ellipsis;
  598. text-align: center;
  599. font-family: "PingFang SC";
  600. font-size: 18px;
  601. font-style: normal;
  602. font-weight: 500;
  603. line-height: 18px;
  604. }
  605. .last {
  606. width: 15rpx;
  607. height: 20rpx;
  608. margin-right: 30rpx;
  609. }
  610. .next {
  611. width: 15rpx;
  612. height: 20rpx;
  613. margin-left: 30rpx;
  614. }
  615. }
  616. .right {
  617. margin-left: 50rpx;
  618. color: #6a6a6a;
  619. font-family: "PingFang SC";
  620. font-size: 13px;
  621. font-style: normal;
  622. font-weight: 400;
  623. line-height: 15px;
  624. }
  625. }
  626. .graph_data {
  627. display: flex;
  628. padding: 48rpx 24rpx;
  629. text {
  630. display: flex;
  631. color: #25ba5d;
  632. font-family: "PingFang SC";
  633. font-size: 17px;
  634. line-height: 17px;
  635. }
  636. text:nth-child(2) {
  637. margin-left: 120rpx;
  638. }
  639. text:nth-child(3) {
  640. margin-left: 150rpx;
  641. }
  642. }
  643. .graph_content {
  644. .charts-box {
  645. width: 100%;
  646. height: 100%;
  647. }
  648. }
  649. }
  650. .txt {
  651. background-color: #F3F3F3;
  652. margin-top: 48rpx;
  653. border-radius: 30rpx;
  654. .txtHeader {
  655. padding: 30rpx 24rpx;
  656. image {
  657. width: 20rpx;
  658. height: 20rpx;
  659. }
  660. text {
  661. background-color: #FFFFFF;
  662. color: #000000;
  663. padding: 0 22rpx;
  664. border-radius: 22rpx;
  665. font-size: 28rpx;
  666. font-weight: 400;
  667. line-height: 37rpx;
  668. }
  669. }
  670. .txtContent {
  671. min-height: 200rpx;
  672. }
  673. }
  674. }
  675. }
  676. .static-footer {
  677. position: fixed;
  678. bottom: 0;
  679. width: 100%;
  680. }
  681. }
  682. </style>