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.

453 lines
11 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
  1. <template>
  2. <view class="main">
  3. <!-- 顶部状态栏占位 -->
  4. <view class="top" :style="{height:iSMT+'px'}"></view>
  5. <!-- 标题图标部分 -->
  6. <deepExploration_header></deepExploration_header>
  7. <view class="search">
  8. <input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
  9. placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
  10. <image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
  11. mode="aspectFill"></image>
  12. </view>
  13. <!-- 四大功能模块 -->
  14. <view class="select">
  15. <view class="selectItem" @click="toMain('主力追踪')">
  16. <image class="img" src="/static/deepExploration-images/icon3.png" mode="aspectFill"></image>
  17. <view class="txt">主力追踪</view>
  18. </view>
  19. <view class="selectItem" @click="toMain('主力雷达')">
  20. <image class="img" src="/static/deepExploration-images/icon2.png" mode="aspectFill"></image>
  21. <view class="txt">主力雷达</view>
  22. </view>
  23. <view class="selectItem" @click="toMain('主力解码')">
  24. <image class="img" src="/static/deepExploration-images/icon1.png" mode="aspectFill"></image>
  25. <view class="txt">主力解码</view>
  26. </view>
  27. <view class="selectItem" @click="toMain('主力资金流')">
  28. <image class="img" src="/static/deepExploration-images/icon4.png" mode="aspectFill"></image>
  29. <view class="txt">主力资金流</view>
  30. </view>
  31. </view>
  32. <!-- 灰色间隔 -->
  33. <view class="gap"></view>
  34. <!-- 选股策略 -->
  35. <view class="stockSelection">
  36. <view class="stockSelection_top">
  37. <view class="txt">
  38. <text>选股策略</text>
  39. </view>
  40. <view class="viewAll" @click='viewAll'>
  41. <text>查看全部</text>
  42. </view>
  43. </view>
  44. <view class="stockSelection_content">
  45. <view class="selectionItem">
  46. <view class="header">
  47. <view class="left">
  48. <image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
  49. <text>抄底卖顶</text>
  50. </view>
  51. <view class="right">
  52. <image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
  53. <text>美股</text>
  54. </view>
  55. </view>
  56. <view class="content">
  57. <view class="contentTitle">
  58. <view class="contentTitle_name">股票名称</view>
  59. <view class="contentTitle_close">最新收盘价</view>
  60. <view class="contentTitle_price">选股价格</view>
  61. </view>
  62. <view class="contentItem">
  63. <view class="row" v-for="(item,index) in stockData" :key="index">
  64. <view class="nameItem">{{item.name}}</view>
  65. <view class="closeItem">{{item.close}}</view>
  66. <view class="priceItem">{{item.select}}</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="stockSelection_content">
  73. <view class="selectionItem">
  74. <view class="header">
  75. <view class="left">
  76. <image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
  77. <text>抄底卖顶</text>
  78. </view>
  79. <view class="right">
  80. <image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
  81. <text>美股</text>
  82. </view>
  83. </view>
  84. <view class="content">
  85. <view class="contentTitle">
  86. <view class="contentTitle_name">股票名称</view>
  87. <view class="contentTitle_close">最新收盘价</view>
  88. <view class="contentTitle_price">选股价格</view>
  89. </view>
  90. <view class="contentItem">
  91. <view class="row" v-for="(item,index) in stockData" :key="index">
  92. <view class="nameItem">{{item.name}}</view>
  93. <view class="closeItem">{{item.close}}</view>
  94. <view class="priceItem">{{item.select}}</view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <footerBar class="static-footer" :type="type"></footerBar>
  102. </view>
  103. </template>
  104. <script setup>
  105. import {
  106. ref,
  107. onMounted
  108. } from 'vue'
  109. import footerBar from '@/components/footerBar.vue'
  110. import deepExploration_header from '@/components/deepExploration_header.vue'
  111. import { stocSelectApi } from '@/api/deepExploration/deepExploration.js'
  112. const type = ref('deepExploration')
  113. const iSMT = ref(0)
  114. //查看全部选股策略
  115. const toMain = (val) => {
  116. if (val == '主力追踪') {
  117. uni.navigateTo({
  118. url: '/pages/deepExploration/MainForceActions?index=1'
  119. })
  120. } else if (val == '主力雷达') {
  121. uni.navigateTo({
  122. url: '/pages/deepExploration/MainForceActions?index=2'
  123. })
  124. } else if (val == '主力解码') {
  125. uni.navigateTo({
  126. url: '/pages/deepExploration/MainForceActions?index=3'
  127. })
  128. } else if (val == '主力资金流') {
  129. uni.navigateTo({
  130. url: '/pages/deepExploration/MainForceActions?index=4'
  131. })
  132. }
  133. }
  134. const stockName = ref('')
  135. //搜索股票
  136. const searchStock = () => {
  137. console.log('搜索参数:', stockName.value);
  138. uni.navigateTo({
  139. url: `/pages/deepExploration/MainForceActions?stockName=${stockName.value}`
  140. })
  141. }
  142. //查看全部选股策略
  143. const viewAll = () => {
  144. uni.navigateTo({
  145. url: '/pages/deepExploration/stockSelectDetail'
  146. })
  147. }
  148. //选股策略数据
  149. const stockData = [{
  150. name: "(MKTW)MarketWise Inc",
  151. close: "$14.190",
  152. select: "$13.180"
  153. },
  154. {
  155. name: "(MTCH)Match Group Inc",
  156. close: "$32.120",
  157. select: "$28.120"
  158. },
  159. {
  160. name: "(MKTW)MarketWise Inc",
  161. close: "$14.190",
  162. select: "$13.180"
  163. }
  164. ];
  165. // 加载选股策略(接口)
  166. const loadStockSelection = async () => {
  167. try {
  168. const res = await stocSelectApi({
  169. language: 'cn'
  170. })
  171. console.log('选股策略接口响应:', res)
  172. const list = Array.isArray(res?.data?.list) ? res.data.list : (Array.isArray(res?.data) ? res.data : [])
  173. if (Array.isArray(list) && list.length) {
  174. stockData.value = list.map(item => ({
  175. name: item.name || item.stockName || item.code || '',
  176. close: item.close || item.lastClose || item.closePrice || '',
  177. select: item.select || item.selectPrice || item.price || ''
  178. }))
  179. } else {
  180. console.warn('选股策略接口返回空列表或结构不匹配')
  181. }
  182. } catch (e) {
  183. console.error('选股策略接口调用失败', e)
  184. uni.showToast({ title: '选股策略加载失败', icon: 'none' })
  185. }
  186. }
  187. onMounted(() => {
  188. // 状态栏高度
  189. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  190. // 调用接口填充数据
  191. loadStockSelection()
  192. })
  193. </script>
  194. <style scoped lang="scss">
  195. .main {
  196. width: 100%;
  197. height: 100vh;
  198. background-color: #fff;
  199. .search {
  200. position: relative;
  201. display: flex;
  202. align-items: center;
  203. background-color: #F3F3F3;
  204. width: calc(100% - 60rpx);
  205. height: 80rpx;
  206. border-radius: 50rpx;
  207. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  208. padding: 0 40rpx;
  209. margin: 15rpx 30rpx 0 30rpx;
  210. .seachIcon {
  211. position: absolute;
  212. right: 50rpx;
  213. width: 32rpx;
  214. height: 32rpx;
  215. }
  216. .searchInput {
  217. color: #111;
  218. }
  219. }
  220. .select {
  221. display: flex;
  222. padding: 60rpx 10rpx 30rpx 30rpx;
  223. gap: 70rpx;
  224. align-items: center;
  225. justify-content: center;
  226. .selectItem {
  227. .img {
  228. width: 80rpx;
  229. height: 80rpx;
  230. display: block;
  231. margin: 0 auto;
  232. }
  233. .txt {
  234. color: #6a6a6a;
  235. font-family: "PingFang SC";
  236. font-size: 11px;
  237. font-style: normal;
  238. font-weight: 400;
  239. line-height: 14.5px;
  240. margin-top: 13rpx;
  241. white-space: nowrap;
  242. }
  243. }
  244. }
  245. .gap {
  246. width: 100%;
  247. height: 15rpx;
  248. background-color: #F3F3F3;
  249. }
  250. .stockSelection {
  251. width: 100%;
  252. padding: 32rpx 15rpx;
  253. .stockSelection_top {
  254. display: flex;
  255. justify-content: space-between;
  256. .txt {
  257. color: #000000;
  258. font-family: "PingFang SC";
  259. font-size: 38rpx;
  260. font-style: normal;
  261. font-weight: 400;
  262. line-height: 50rpx;
  263. }
  264. .viewAll {
  265. background-color: #000000;
  266. border-radius: 10rpx;
  267. padding: 6rpx 20rpx;
  268. color: #ffffff;
  269. font-family: "PingFang SC";
  270. font-size: 10rpx;
  271. font-style: normal;
  272. font-weight: 100;
  273. line-height: 29rpx;
  274. height: 40rpx;
  275. }
  276. }
  277. .stockSelection_content {
  278. .selectionItem {
  279. background-color: #F3F3F3;
  280. padding: 30rpx 15rpx 17rpx 30rpx;
  281. border-radius: 30rpx;
  282. margin-top: 30rpx;
  283. .header {
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. .left {
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. image {
  292. display: flex;
  293. justify-content: center;
  294. align-items: center;
  295. width: 15rpx;
  296. height: 15rpx;
  297. }
  298. text {
  299. margin-left: 15rpx;
  300. color: #000000;
  301. font-family: "PingFang SC";
  302. font-size: 28rpx;
  303. font-style: normal;
  304. font-weight: 400;
  305. line-height: 18.5px;
  306. }
  307. }
  308. .right {
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. border-radius: 15rpx;
  313. background-color: #FFFFFF;
  314. padding: 6rpx 20rpx;
  315. image {
  316. display: flex;
  317. justify-content: center;
  318. align-items: center;
  319. width: 40rpx;
  320. height: 26.5rpx;
  321. }
  322. text {
  323. margin-left: 10rpx;
  324. color: #6a6a6a;
  325. font-family: "PingFang SC";
  326. font-size: 18rpx;
  327. font-style: normal;
  328. font-weight: 400;
  329. line-height: 24rpx;
  330. }
  331. }
  332. }
  333. .content {
  334. .contentTitle {
  335. display: flex;
  336. color: #6a6a6a;
  337. font-family: "PingFang SC";
  338. font-size: 11px;
  339. font-style: normal;
  340. font-weight: 400;
  341. line-height: 14.5px;
  342. margin-top: 24rpx;
  343. margin-bottom: 20rpx;
  344. .contentTitle_name {
  345. width: 100rpx;
  346. }
  347. .contentTitle_close {
  348. width: 130rpx;
  349. margin-left: 260rpx;
  350. }
  351. .contentTitle_price {
  352. width: 120rpx;
  353. margin-left: 60rpx;
  354. }
  355. }
  356. .contentItem {
  357. .row {
  358. display: flex;
  359. box-shadow: 0 -2rpx 5rpx rgba(0, 0, 0, 0.05);
  360. padding: 10rpx 0;
  361. margin-bottom: 10rpx;
  362. .nameItem {
  363. width: 260rpx;
  364. white-space: nowrap;
  365. overflow: hidden;
  366. text-overflow: ellipsis;
  367. color: #000000;
  368. font-family: "PingFang SC";
  369. font-size: 13px;
  370. font-style: normal;
  371. font-weight: 400;
  372. line-height: 17.5px;
  373. }
  374. .closeItem {
  375. width: 120rpx;
  376. margin-left: 100rpx;
  377. color: #25ba5d;
  378. font-family: "PingFang SC";
  379. font-size: 13px;
  380. font-style: normal;
  381. font-weight: 400;
  382. line-height: 17.5px;
  383. }
  384. .priceItem {
  385. width: 120rpx;
  386. margin-left: 73rpx;
  387. color: #25ba5d;
  388. font-family: "PingFang SC";
  389. font-size: 13px;
  390. font-style: normal;
  391. font-weight: 400;
  392. line-height: 17.5px;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. }
  399. }
  400. .static-footer {
  401. position: fixed;
  402. bottom: 0;
  403. }
  404. }
  405. * {
  406. box-sizing: border-box;
  407. }
  408. </style>