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.

353 lines
7.6 KiB

4 weeks ago
  1. <template>
  2. <view class="main">
  3. <view class="table">
  4. <view class="tableHeader">
  5. <scroll-view class="tabs" scroll-x="true">
  6. <view v-for="(item,index) in tabsData" :key="index" class="tabItem" @click="handleTab(item)">
  7. {{item}}
  8. </view>
  9. </scroll-view>
  10. </view>
  11. <view class="tableContent">
  12. <image class="showAll" src="/static/deepExploration-images/showAll.png" mode="aspectFill"></image>
  13. <scroll-view scroll-x="true" show-scrollbar="false">
  14. <view class="tableBox">
  15. <view class="box_header">
  16. <view class="name">名称</view>
  17. <view class="other" v-for="(item,index) in tableContentHeaderData" :key="index">
  18. <text>{{item}}</text>
  19. <image v-show="ifASC" src="/static/deepExploration-images/ASC.png" mode="aspectFill">
  20. </image>
  21. <image v-show="!ifASC" src="/static/deepExploration-images/DESC.png" mode="aspectFill">
  22. </image>
  23. </view>
  24. </view>
  25. <view class="box_content">
  26. <view class="row" v-for="(item,index) in fakeData" :key="index" :class="{ 'increase-positive': item.increase.startsWith('+'),
  27. 'increase-negative': item.increase.startsWith('-')}">
  28. <view class="name_colum">
  29. <text class="stockName">{{item.name}}</text>
  30. <text class="stockCode">{{item.stockCode}}</text>
  31. </view>
  32. <view class="other_colum">{{item.latest}}</view>
  33. <view class="other_colum">{{item.increase}}</view>
  34. <view class="other_colum">{{item.decrease}}</view>
  35. <view class="other_colum">{{item.previousClose}}</view>
  36. <view class="other_colum">{{item.volume}}</view>
  37. <view class="other_colum">{{item.turnover}}</view>
  38. <view class="other_colum">{{item.openingPrice}}</view>
  39. <view class="other_colum">{{item.highestPrice}}</view>
  40. <view class="other_colum">{{item.lowestPrice}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import {
  51. ref
  52. } from 'vue'
  53. const tabsData = ref(['全部', '抄底卖顶', '波段行情', '价值投资', '资金及仓位管理', '价值投资', '价值投资', '价值投资', ])
  54. const handleTab = (item) => {
  55. uni.showToast({
  56. title: `查看 ${item} 详情`,
  57. icon: 'none',
  58. duration: 2000
  59. })
  60. }
  61. //表头是否升序
  62. const ifASC = ref(true)
  63. //表头数据
  64. const tableContentHeaderData = ref(['最新', '涨幅', '跌幅', '昨收', '成交量', '成交额', '开盘价', '最高价', '最低价'])
  65. const fakeData = [{
  66. name: "TechCore",
  67. stockCode: "600001",
  68. latest: 1315.00,
  69. increase: "+5.2%",
  70. decrease: "+5.2%",
  71. previousClose: 1250.00,
  72. volume: 12000,
  73. turnover: "15780K",
  74. openingPrice: 1237.50,
  75. highestPrice: 1320.00,
  76. lowestPrice: 1230.00
  77. },
  78. {
  79. name: "MediaLink",
  80. stockCode: "600002",
  81. latest: 1138.70,
  82. increase: "-3.5%",
  83. decrease: "-3.5%",
  84. previousClose: 1180.00,
  85. volume: 8500,
  86. turnover: "967.9K",
  87. openingPrice: 1191.80,
  88. highestPrice: 1195.00,
  89. lowestPrice: 1130.00
  90. },
  91. {
  92. name: "FinServ",
  93. stockCode: "600003",
  94. latest: 1413.72,
  95. increase: "+7.1%",
  96. decrease: "+7.1%",
  97. previousClose: 1320.00,
  98. volume: 15000,
  99. turnover: "2120.6K",
  100. openingPrice: 1293.60,
  101. highestPrice: 1420.00,
  102. lowestPrice: 1290.00
  103. },
  104. {
  105. name: "AutoDrive",
  106. stockCode: "600004",
  107. latest: 1080.40,
  108. increase: "+2.8%",
  109. decrease: "+2.8%",
  110. previousClose: 1050.00,
  111. volume: 9000,
  112. turnover: "972.4K",
  113. openingPrice: 1055.25,
  114. highestPrice: 1085.00,
  115. lowestPrice: 1050.00
  116. },
  117. {
  118. name: "EduSmart",
  119. stockCode: "600005",
  120. latest: 968.24,
  121. increase: "-1.2%",
  122. decrease: "-1.2%",
  123. previousClose: 980.00,
  124. volume: 7000,
  125. turnover: "677.8K",
  126. openingPrice: 975.10,
  127. highestPrice: 978.00,
  128. lowestPrice: 965.00
  129. },
  130. {
  131. name: "HealthPlusqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",
  132. stockCode: "600006",
  133. latest: 1463.00,
  134. increase: "+4.5%",
  135. decrease: "+4.5%",
  136. previousClose: 1400.00,
  137. volume: 13000,
  138. turnover: "1901.9K",
  139. openingPrice: 1393.00,
  140. highestPrice: 1470.00,
  141. lowestPrice: 1385.00
  142. },
  143. {
  144. name: "AgriTech",
  145. stockCode: "600007",
  146. latest: 1038.36,
  147. increase: "+1.8%",
  148. decrease: "+1.8%",
  149. previousClose: 1020.00,
  150. volume: 6500,
  151. turnover: "674.9K",
  152. openingPrice: 1028.16,
  153. highestPrice: 1040.00,
  154. lowestPrice: 1025.00
  155. },
  156. {
  157. name: "LogiFlow",
  158. stockCode: "600008",
  159. latest: 1094.24,
  160. increase: "-2.3%",
  161. decrease: "-2.3%",
  162. previousClose: 1120.00,
  163. volume: 8000,
  164. turnover: "875.4K",
  165. openingPrice: 1122.24,
  166. highestPrice: 1125.00,
  167. lowestPrice: 1090.00
  168. },
  169. {
  170. name: "EnergySol",
  171. stockCode: "600009",
  172. latest: 1435.05,
  173. increase: "+6.3%",
  174. decrease: "+6.3%",
  175. previousClose: 1350.00,
  176. volume: 14000,
  177. turnover: "2009.1K",
  178. openingPrice: 1339.75,
  179. highestPrice: 1440.00,
  180. lowestPrice: 1335.00
  181. },
  182. {
  183. name: "RealEstate",
  184. stockCode: "600010",
  185. latest: 995.00,
  186. increase: "-0.5%",
  187. decrease: "-0.5%",
  188. previousClose: 1000.00,
  189. volume: 7500,
  190. turnover: "746.3K",
  191. openingPrice: 1003.00,
  192. highestPrice: 1005.00,
  193. lowestPrice: 990.00
  194. }
  195. ];
  196. </script>
  197. <style scoped lang="scss">
  198. .main {
  199. width: 100%;
  200. height: 100vh;
  201. background-color: #fff;
  202. .table {
  203. margin-top: 10rpx;
  204. box-shadow: 0 -2rpx 3rpx -1rpx rgba(0, 0, 0, 0.5);
  205. .tableHeader {
  206. .tabs {
  207. white-space: nowrap;
  208. padding-top: 20rpx;
  209. padding-left: 40rpx;
  210. ::-webkit-scrollbar {
  211. //隐藏 滚动条
  212. display: none;
  213. }
  214. .tabItem {
  215. display: inline-block;
  216. color: rgb(175, 175, 175);
  217. border-radius: 10rpx;
  218. padding: 5rpx 30rpx;
  219. margin-right: 20rpx;
  220. font-size: 28rpx;
  221. background-color: rgb(243, 243, 243);
  222. }
  223. }
  224. }
  225. .tableContent {
  226. width: 100%;
  227. position: relative;
  228. .showAll {
  229. position: absolute;
  230. top: 35rpx;
  231. right: 20rpx;
  232. width: 40rpx;
  233. height: 40rpx;
  234. z-index: 100;
  235. }
  236. scroll-view {
  237. width: 100%;
  238. white-space: nowrap;
  239. ::-webkit-scrollbar {
  240. //隐藏 滚动条
  241. display: none;
  242. }
  243. }
  244. .tableBox {
  245. padding-left: 40rpx;
  246. .box_header {
  247. margin-bottom: 19rpx;
  248. display: flex;
  249. width: max-content;
  250. margin-top: 40rpx;
  251. color: rgb(109, 109, 109);
  252. border-radius: 10rpx;
  253. margin-right: 20rpx;
  254. font-size: 23rpx;
  255. .name {
  256. flex: 0 0 375rpx;
  257. }
  258. .other {
  259. flex: 0 0 195rpx;
  260. text {
  261. margin-right: 5rpx;
  262. }
  263. image {
  264. width: 20rpx;
  265. height: 20rpx;
  266. }
  267. }
  268. }
  269. .box_content {
  270. width: max-content;
  271. .row {
  272. padding: 5rpx;
  273. display: flex;
  274. border-top: 1rpx dashed #eee;
  275. width: 210%;
  276. &.increase-positive {
  277. .other_colum {
  278. color: #2DD357;
  279. font-weight: 200;
  280. }
  281. }
  282. &.increase-negative {
  283. .other_colum {
  284. color: #FF4150;
  285. font-weight: 200;
  286. }
  287. }
  288. .name_colum {
  289. flex: 0 0 375rpx;
  290. display: flex;
  291. flex-direction: column;
  292. gap: 4rpx;
  293. .stockName {
  294. color: #333333;
  295. width: 100%;
  296. max-width: 305rpx;
  297. font-size: 28rpx;
  298. font-weight: 400;
  299. line-height: 36rpx;
  300. white-space: nowrap;
  301. overflow: hidden;
  302. text-overflow: ellipsis;
  303. }
  304. .stockCode {
  305. color: #c5c5c5;
  306. ;
  307. font-size: 24rpx;
  308. font-weight: 400;
  309. line-height: 30rpx;
  310. }
  311. }
  312. .other_colum {
  313. flex: 0 0 195rpx;
  314. display: flex;
  315. align-items: center;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. </style>