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.

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