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.

722 lines
14 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="main">
  3. <!-- 顶部状态栏占位 -->
  4. <view class="top" :style="{height:iSMT+'px'}"></view>
  5. <!-- 头部导航 -->
  6. <view class="header">
  7. <view class="headphone-icon">
  8. <image src="https://d31zlh4on95l9h.cloudfront.net/images/bef2edba6cc0c85671fde07cfab5270d.png" class="header-icon-image"></image>
  9. </view>
  10. <view class="title">DeepChart</view>
  11. <view class="notification-icon">
  12. <image src="https://d31zlh4on95l9h.cloudfront.net/images/2554c84b91712d2a6cb6b00380e63bac.png" class="header-icon-image"></image>
  13. </view>
  14. </view>
  15. <!-- 内容区域 - 使用滚动视图 -->
  16. <scroll-view scroll-y class="content-container">
  17. <!-- 1. 今日市场概览 -->
  18. <market-overview></market-overview>
  19. <!-- 间隔 -->
  20. <view class="section-gap"></view>
  21. <!-- 新增欢迎部分 -->
  22. <view class="section welcome-section">
  23. <!-- 轮播图 -->
  24. <swiper class="welcome-swiper" circular autoplay interval="3000" duration="500" indicator-dots indicator-active-color="#4080ff">
  25. <swiper-item v-for="(item, index) in 5" :key="index">
  26. <image class="swiper-image" src="https://d31zlh4on95l9h.cloudfront.net/images/e4272cc034fa2a3d1ca588ef84e51ab0.png" mode="aspectFill"></image>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. <!-- 2. DeepMate -->
  31. <view class="section deepmate-section">
  32. <DeepMate />
  33. </view>
  34. <!-- 3. 深度探索 -->
  35. <view class="section deep-exploration">
  36. <!-- 上部分标题和查看更多按钮 -->
  37. <view class="section-header-container">
  38. <view class="section-header">
  39. <view class="header-left">
  40. <text class="section-title">深度探索</text>
  41. </view>
  42. <view class="header-right">
  43. <text class="more-btn">查看更多</text>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 下部分四个图标 -->
  48. <view class="exploration-container">
  49. <view class="exploration-content">
  50. <view class="exploration-item">
  51. <image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/199472b0ee90a1c897f7c87b85accd84.png" mode="aspectFit" lazy-load="true"></image>
  52. <text class="exploration-text">主力追踪</text>
  53. </view>
  54. <view class="exploration-item">
  55. <image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/c25ca5e176efc961dabfa5d0d1b486b0.png" mode="aspectFit" lazy-load="true"></image>
  56. <text class="exploration-text">主力资达</text>
  57. </view>
  58. <view class="exploration-item">
  59. <image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/c064d7066dc8129a7df7b052762f82cf.png" mode="aspectFit" lazy-load="true"></image>
  60. <text class="exploration-text">主力解码</text>
  61. </view>
  62. <view class="exploration-item">
  63. <image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/9d69cceee9c515911477078af6f68d88.png" mode="aspectFit" lazy-load="true"></image>
  64. <text class="exploration-text">主力资金流</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 4. 我的自选 -->
  70. <view class="section my-selection">
  71. <!-- 上部分标题和查看更多按钮 -->
  72. <view class="section-header-container">
  73. <view class="section-header">
  74. <text class="section-title">我的自选</text>
  75. <text class="more-btn" @click="goToMarketSituation">添加自选股</text>
  76. </view>
  77. </view>
  78. <!-- 下部分股票列表 -->
  79. <view class="stock-container">
  80. <view class="stock-list">
  81. <view class="stock-item" v-for="(item, index) in myStocks" :key="item.code">
  82. <view class="stock-info">
  83. <view class="name-container">
  84. <text class="stock-name">{{item.name}}</text>
  85. <text class="stock-code-label">{{item.code}}</text>
  86. </view>
  87. <view class="price-container">
  88. <text class="stock-price">{{item.price}}</text>
  89. <text class="stock-change" :class="{'stock-up': item.change > 0, 'stock-down': item.change < 0}">{{item.change > 0 ? '+' : ''}}{{item.change}}%</text>
  90. </view>
  91. </view>
  92. <view class="stock-chart">
  93. <image :src="item.chartImg" mode="aspectFit" class="chart-image"></image>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 机构动向简报数据 -->
  98. <view class="institutional-reports">
  99. <view class="section-title-container">
  100. <text class="section-title-text">机构动向简报</text>
  101. </view>
  102. <view class="text-gap"></view>
  103. <view class="report-item" v-for="(report, index) in institutionalReports" :key="index">
  104. <view class="report-stock">{{report.stock}}</view>
  105. <view class="report-status">{{report.status}}</view>
  106. </view>
  107. <view class="view-more">
  108. <view><text>查看更多 >></text></view>
  109. <view><text class="disclaimer-text">免责声明以上数据由AI生成不作为最终投资建议决策需独立</text></view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 5. 今日市场看点 -->
  115. <view class="section-header highlights-title-container">
  116. <text class="section-title">今日市场核心看点</text>
  117. </view>
  118. <view class="highlights-image-container">
  119. <image src="https://d31zlh4on95l9h.cloudfront.net/images/8d5365af968402a18cedb120c09460b0.png" mode="aspectFit" class="highlights-image"></image>
  120. </view>
  121. <!-- 底部空间 - 为底部导航腾出空间 -->
  122. <view class="bottom-space"></view>
  123. </scroll-view>
  124. <!-- 底部导航 -->
  125. <footerBar class="static-footer" :type="type"></footerBar>
  126. </view>
  127. </template>
  128. <script>
  129. import footerBar from '../../components/footerBar.vue'
  130. import MarketOverview from '../../components/MarketOverview.vue'
  131. import DeepMate from '../../components/DeepMate.vue'
  132. export default {
  133. components: {
  134. footerBar,
  135. MarketOverview,
  136. DeepMate
  137. },
  138. data() {
  139. return {
  140. type: 'home',
  141. iSMT: 0,
  142. // 深度探索数据
  143. explorationItems: [
  144. { title: '主力追踪', icon: '/static/c1.png' },
  145. { title: '主力资金', icon: '/static/c2.png' },
  146. { title: '主力解码', icon: '/static/c3.png' },
  147. { title: '主力资金流', icon: '/static/c4.png' }
  148. ],
  149. // 我的自选股票数据
  150. myStocks: [
  151. { name: '特斯拉', code: 'TSLA', price: '482.00', change: 2.80, chartImg: '/static/c5.png' },
  152. { name: '英伟达', code: 'NVDA', price: '189.800', change: -2.92, chartImg: '/static/c6.png' },
  153. { name: '苹果', code: 'AAPL', price: '256.430', change: 2.60, chartImg: '/static/c7.png' }
  154. ],
  155. // 机构动向简报数据
  156. institutionalReports: [
  157. { stock: '特斯拉', status: '当前市场多头资金占比,且多头资金持续流入。' },
  158. { stock: '英伟达', status: '当前市场多头资金占比,且多头资金持续流入。' },
  159. { stock: '苹果', status: '当前市场多头资金占比,且多头资金持续流入。' }
  160. ],
  161. // 防抖定时器
  162. debounceTimer: null
  163. }
  164. },
  165. // Vue 2生命周期方法
  166. mounted() {
  167. // 状态栏高度
  168. this.iSMT = uni.getSystemInfoSync().statusBarHeight;
  169. // 预加载图片资源
  170. this.myStocks.forEach(stock => {
  171. // 使用uni.getImageInfo替代Image对象
  172. uni.getImageInfo({
  173. src: stock.chartImg,
  174. success: function(res) {
  175. // 图片加载成功
  176. console.log('图片预加载成功:', stock.name)
  177. },
  178. fail: function(err) {
  179. console.log('图片预加载失败:', err)
  180. }
  181. })
  182. })
  183. },
  184. methods: {
  185. goToMarketSituation() {
  186. // 跳转到行情页面
  187. uni.navigateTo({
  188. url: '/pages/home/marketSituation'
  189. });
  190. },
  191. // 防抖函数
  192. debounce(fn, delay = 300) {
  193. if (this.debounceTimer) clearTimeout(this.debounceTimer)
  194. this.debounceTimer = setTimeout(() => {
  195. fn()
  196. this.debounceTimer = null
  197. }, delay)
  198. }
  199. }
  200. }
  201. </script>
  202. <style scoped>
  203. .main {
  204. display: flex;
  205. flex-direction: column;
  206. height: 100vh;
  207. background-color: #ffffff;
  208. }
  209. .header {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. padding: 10px 15px;
  214. background-color: #ffffff;
  215. }
  216. .title {
  217. font-size: 22px;
  218. font-weight: bold;
  219. text-align: center;
  220. flex: 1;
  221. }
  222. .headphone-icon, .notification-icon {
  223. width: 40px;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. }
  228. .header-icon-image {
  229. width: 24px;
  230. height: 24px;
  231. object-fit: contain;
  232. }
  233. .content-container {
  234. flex: 1;
  235. padding: 10px;
  236. width: 100%;
  237. box-sizing: border-box;
  238. overflow-x: hidden;
  239. }
  240. .section {
  241. margin-bottom: 15px;
  242. /* background-color: #f5f5f5; */
  243. background-color: #ffffff;
  244. border-radius: 8px;
  245. padding: 15px;
  246. }
  247. .section-header {
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. margin-bottom: 15px;
  252. padding-bottom: 10px;
  253. }
  254. .section-title {
  255. font-size: 18px;
  256. font-weight: bold;
  257. color: #000000;
  258. }
  259. .section-title-text{
  260. font-size: 14px;
  261. }
  262. .text-gap{
  263. height: 10px;
  264. }
  265. .more-btn {
  266. font-size: 12px;
  267. font-weight: bold;
  268. color: #ffffff;
  269. background-color: #000000;
  270. padding: 4px 8px;
  271. border-radius: 4px;
  272. }
  273. /* 市场概览样式 */
  274. .market-header {
  275. display: flex;
  276. justify-content: space-between;
  277. align-items: center;
  278. padding: 10px 15px;
  279. background-color: #ffffff;
  280. margin-bottom: 10px;
  281. }
  282. .market-content {
  283. background-color: #f5f5f5;
  284. border-radius: 8px;
  285. padding: 15px;
  286. margin: 0 15px;
  287. }
  288. .market-image {
  289. margin-bottom: 15px;
  290. display: flex;
  291. justify-content: center;
  292. }
  293. .overview-image {
  294. width: 100%;
  295. border-radius: 8px;
  296. }
  297. .market-data {
  298. display: flex;
  299. flex-direction: column;
  300. gap: 10px;
  301. }
  302. /* 间隔样式 */
  303. .section-gap {
  304. height: 20px;
  305. }
  306. .market-item {
  307. display: flex;
  308. justify-content: space-between;
  309. padding: 8px 0;
  310. border-bottom: 1px solid #f0f0f0;
  311. }
  312. .down {
  313. color: #ff4d4f;
  314. }
  315. .up {
  316. color: #52c41a;
  317. }
  318. /* DeepMate样式 */
  319. .deepmate-container {
  320. background-color: #ffe6e6;
  321. border-radius: 10px;
  322. padding: 15px;
  323. margin: 0 15px;
  324. }
  325. .deepmate-header {
  326. margin-bottom: 10px;
  327. }
  328. .title-container {
  329. display: flex;
  330. align-items: center;
  331. justify-content: space-between;
  332. width: 100%;
  333. }
  334. .title-left {
  335. width: 50%;
  336. }
  337. .title-right {
  338. width: 50%;
  339. display: flex;
  340. justify-content: flex-end;
  341. }
  342. .deepmate-title {
  343. font-size: 18px;
  344. font-weight: bold;
  345. color: #ff4d4f;
  346. }
  347. .deepmate-icon {
  348. width: 60px;
  349. height: 60px;
  350. margin-left: 0;
  351. }
  352. .deepmate-subtitle {
  353. font-size: 12px;
  354. color: #666;
  355. margin-left: 5px;
  356. }
  357. .deepmate-hotspots {
  358. margin: 10px 0;
  359. }
  360. .hotspot-item {
  361. background-color: #f5f5f5;
  362. padding: 8px 12px;
  363. border-radius: 6px;
  364. margin-bottom: 8px;
  365. }
  366. .hotspot-item text {
  367. font-size: 14px;
  368. color: #333;
  369. }
  370. .deepmate-action {
  371. display: flex;
  372. justify-content: center;
  373. align-items: center;
  374. background-color: #ffffff;
  375. border-radius: 20px;
  376. padding: 10px;
  377. margin-top: 10px;
  378. }
  379. /* 欢迎部分样式 */
  380. .welcome-section {
  381. margin-bottom: 15px;
  382. padding: 0;
  383. }
  384. .welcome-swiper {
  385. width: 100%;
  386. height: 150px;
  387. border-radius: 0;
  388. overflow: hidden;
  389. }
  390. .deepmate-section {
  391. padding: 0;
  392. }
  393. .swiper-image {
  394. width: 100%;
  395. height: 100%;
  396. border-radius: 8px;
  397. object-fit: contain;
  398. }
  399. /* 深度探索样式 */
  400. .deep-exploration {
  401. margin-top: 15px;
  402. padding: 0; /* 移除内边距,让子容器自己控制 */
  403. }
  404. .section-header-container {
  405. margin-bottom: 10px;
  406. }
  407. .section-header {
  408. display: flex;
  409. justify-content: space-between;
  410. align-items: center;
  411. padding: 10px 15px;
  412. background-color: #ffffff;
  413. }
  414. .header-left {
  415. display: flex;
  416. align-items: center;
  417. }
  418. .header-right {
  419. display: flex;
  420. align-items: center;
  421. }
  422. .section-title {
  423. font-size: 16px;
  424. font-weight: bold;
  425. color: #333;
  426. }
  427. .more-btn {
  428. font-size: 12px;
  429. color: #ffffff;
  430. }
  431. .exploration-container {
  432. border-radius: 8px;
  433. overflow: hidden;
  434. }
  435. .exploration-content {
  436. display: flex;
  437. justify-content: space-between;
  438. padding: 15px;
  439. background-color: #f5f5f5;
  440. border-radius: 8px;
  441. }
  442. .exploration-item {
  443. display: flex;
  444. flex-direction: column;
  445. align-items: center;
  446. width: 22%;
  447. background-color: #ffffff;
  448. border-radius: 8px;
  449. padding: 10px 0;
  450. }
  451. .exploration-icon {
  452. width: 50px;
  453. height: 50px;
  454. margin-bottom: 8px;
  455. }
  456. .exploration-text {
  457. font-size: 12px;
  458. color: #333;
  459. }
  460. .icon-text {
  461. font-size: 12px;
  462. }
  463. /* 我的自选样式 */
  464. .my-selection {
  465. padding: 0; /* 移除内边距,让子容器自己控制 */
  466. }
  467. .stock-container {
  468. border-radius: 8px;
  469. overflow: hidden;
  470. background-color: #f5f5f5;
  471. padding: 15px;
  472. box-sizing: border-box;
  473. }
  474. .stock-list {
  475. display: flex;
  476. flex-direction: row;
  477. justify-content: center;
  478. background-color: #f8f8f8;
  479. border-radius: 8px;
  480. padding: 15px;
  481. gap: 10px; /* 添加卡片之间的间距 */
  482. }
  483. .stock-item {
  484. display: flex;
  485. flex-direction: column;
  486. justify-content: space-between;
  487. padding: 3px;
  488. background-color: #ffffff;
  489. border-radius: 8px;
  490. width: 30%;
  491. box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  492. will-change: transform;
  493. transform: translateZ(0);
  494. }
  495. .stock-info {
  496. display: flex;
  497. flex-direction: column;
  498. align-items: center;
  499. margin-bottom: 5px;
  500. }
  501. .stock-chart {
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. }
  506. .name-container {
  507. display: flex;
  508. align-items: center;
  509. gap: 5px;
  510. }
  511. .stock-name {
  512. font-size: 12px;
  513. font-weight: bold;
  514. color: #333;
  515. }
  516. .stock-code-label {
  517. font-size: 12px;
  518. color: #666;
  519. background-color: #f5f5f5;
  520. padding: 0 4px;
  521. border-radius: 3px;
  522. }
  523. .stock-price {
  524. font-size: 12px;
  525. color: #666;
  526. }
  527. .price-container {
  528. display: flex;
  529. align-items: center;
  530. gap: 5px;
  531. }
  532. .stock-change {
  533. font-size: 12px;
  534. }
  535. .stock-up {
  536. color: #4cd964;
  537. }
  538. .stock-down {
  539. color: #ff3b30;
  540. }
  541. .chart-image {
  542. width: 100px;
  543. height: 40px;
  544. }
  545. /* 市场看点样式 */
  546. .highlights-title-container {
  547. background-color: #ffffff;
  548. margin-bottom: 10px;
  549. }
  550. .highlights-image-container {
  551. background-color: #f5f5f5;
  552. border-radius: 8px;
  553. padding: 10px;
  554. margin-bottom: 15px;
  555. }
  556. .highlights-image {
  557. width: 100%;
  558. height: 150px;
  559. border-radius: 4px;
  560. }
  561. /* 机构动向简报样式 */
  562. .institutional-reports {
  563. margin-top: 15px;
  564. background-color: #f8f8f8;
  565. border-radius: 8px;
  566. padding: 10px;
  567. }
  568. .section-title-container {
  569. position: relative;
  570. padding-left: 10px;
  571. margin-bottom: 5px;
  572. }
  573. .section-title-container:before {
  574. content: "";
  575. position: absolute;
  576. left: 0;
  577. top: 0;
  578. bottom: 0;
  579. width: 4px;
  580. background-color: #ff4d4f;
  581. border-radius: 2px;
  582. }
  583. .report-item {
  584. background-color: #ffffff;
  585. border-radius: 8px;
  586. padding: 10px;
  587. margin-bottom: 8px;
  588. }
  589. .report-stock {
  590. font-size: 14px;
  591. font-weight: bold;
  592. color: #e74c3c;
  593. margin-bottom: 5px;
  594. }
  595. .report-status {
  596. font-size: 12px;
  597. color: #333;
  598. }
  599. .view-more {
  600. text-align: center;
  601. color: #1890ff;
  602. font-size: 12px;
  603. padding: 5px;
  604. }
  605. /* 底部空间 */
  606. .bottom-space {
  607. height: 60px;
  608. }
  609. /* 免责声明样式 */
  610. .disclaimer-text {
  611. font-size: 8px;
  612. color: #999999;
  613. text-align: center;
  614. }
  615. /* 底部导航 */
  616. .static-footer {
  617. position: fixed;
  618. bottom: 0;
  619. width: 100%;
  620. }
  621. </style>