中生金域
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.

359 lines
8.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="main_content">
  3. <view class="header_info">
  4. <view class="info_container">
  5. <view class="name_wrap">
  6. <image src="/static/user.png" class="name_logo"></image>
  7. <text class="name">姓名 : {{username}}</text>
  8. </view>
  9. <view class="idcard_wrap">
  10. <image src="/static/card.png" class="card_logo"></image>
  11. <text class="card_number">身份证号 : {{idcard}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="grid_layout content" v-if="activeTab == 0">
  16. <view class="grid_box background1">
  17. <text class="main_title">L-乳酸</text>
  18. <view class="capacity_btn">
  19. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c1 : '0'}}mmol / L</text>
  20. </view>
  21. </view>
  22. <view class="grid_box background2">
  23. <text class="main_title">肌酸</text>
  24. <view class="capacity_btn">
  25. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c2 : '0'}}mmol / L</text>
  26. </view>
  27. </view>
  28. <view class="grid_box background3">
  29. <text class="main_title">肌酐</text>
  30. <view class="capacity_btn">
  31. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c3 : '0'}}mmol / L</text>
  32. </view>
  33. </view>
  34. <view class="grid_box background4">
  35. <text class="main_title">尿素</text>
  36. <view class="capacity_btn">
  37. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c4 : '0'}}mmol / L</text>
  38. </view>
  39. </view>
  40. <view class="grid_box background5">
  41. <text class="main_title">β-羟丁酸</text>
  42. <view class="capacity_btn">
  43. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c5 : '0'}}mmol / L</text>
  44. </view>
  45. </view>
  46. <view class="grid_box background6">
  47. <text class="main_title">L-谷氨酸</text>
  48. <view class="capacity_btn">
  49. <text class="unit">{{resultList?.length > 0 ? resultList[0]?.c6 : '0'}}mmol / L</text>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="content" v-if="activeTab == 1">
  54. <view class="card_wrap" v-for="item in resultList" :key="item.id">
  55. <view class="time_wrap">
  56. <image src="/static/time.png" class="time_logo"></image>
  57. <text class="date">{{ item.testDate?.split(' ')[0] }}</text>
  58. <text class="time">{{ item.testDate?.split(' ')[1] }}</text>
  59. </view>
  60. <view class="info_grid">
  61. <view class="info bg1">
  62. <text>L-乳酸 {{item.c1}}mmol/L</text>
  63. </view>
  64. <view class="info bg2">
  65. <text>肌酸 {{item.c2}}mmol/L</text>
  66. </view>
  67. <view class="info bg3">
  68. <text>肌酐 {{item.c3}}mmol/L</text>
  69. </view>
  70. <view class="info bg4">
  71. <text>尿素 {{item.c4}}mmol/L</text>
  72. </view>
  73. <view class="info bg5">
  74. <text>β-羟丁酸 {{item.c5}}mmol/L</text>
  75. </view>
  76. <view class="info bg6">
  77. <text>L-谷氨酸 {{item.c6}}mmol/L</text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="footer_tab">
  83. <view :class="activeTab == 0 ? 'btn active' : 'btn'" @click="changeActiveTab(0)">
  84. <image src="/static/result.png" class="result_logo"></image>
  85. <text class="font_btn">刷新结果</text>
  86. </view>
  87. <view :class="activeTab == 1 ? 'btn active' : 'btn'" @click="changeActiveTab(1)">
  88. <image src="/static/data.png" class="history_logo"></image>
  89. <text class="font_btn">历史数据</text>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. activeTab: 0,
  99. idcard: '',
  100. username: '',
  101. resultList: []
  102. }
  103. },
  104. onLoad() {
  105. this.getData()
  106. },
  107. methods: {
  108. getData() {
  109. const self = this
  110. // 就在加载的时候请求一次某人的数据 筛选最新一条放入第一个tab
  111. // 历史数据渲染到第二个tab
  112. // 数据中有username idcard 以及信息列表
  113. uni.request({
  114. url: 'http://localhost:8080/zsjyadmin/detection/current',
  115. method:"GET",
  116. success: (res) => {
  117. if (res?.data?.code == 0){
  118. const data = res?.data?.data
  119. const {idcard, username, resultList} = data || {}
  120. self.idcard = idcard
  121. self.username = username
  122. // 对resultList 根据id进行排序
  123. resultList.sort((a, b) => {
  124. return b.id - a.id
  125. })
  126. self.resultList = resultList
  127. }
  128. }
  129. });
  130. },
  131. changeActiveTab(activeTab) {
  132. if(activeTab == 0) {
  133. // 刷新当前结果
  134. this.getData()
  135. }
  136. this.activeTab = activeTab
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="less">
  142. .main_content{
  143. background: #f6f6f6;
  144. height: 100vh;
  145. width: 100vw;
  146. display: flex;
  147. flex-direction: column;
  148. .header_info{
  149. padding: 20rpx;
  150. .info_container{
  151. width: 100%;
  152. background: #fff;
  153. padding: 22rpx 38rpx;
  154. box-sizing: border-box;
  155. border-radius: 40rpx;
  156. align-items: center;
  157. justify-content: space-between;
  158. display: flex;
  159. .name_wrap{
  160. display: flex;
  161. align-items: center;
  162. .name_logo{
  163. width: 30rpx;
  164. height: 35rpx;
  165. }
  166. .name{
  167. font-size: 24rpx;
  168. font-weight: 500;
  169. letter-spacing: 0.03em;
  170. color: #000000;
  171. margin-left: 16rpx;
  172. }
  173. }
  174. .idcard_wrap{
  175. display: flex;
  176. align-items: center;
  177. .card_logo{
  178. width: 38rpx;
  179. height: 29rpx;
  180. }
  181. .card_number{
  182. font-size: 24rpx;
  183. font-weight: 500;
  184. letter-spacing: 0.03em;
  185. margin-left: 13rpx;
  186. color: #BBBBBB;
  187. }
  188. }
  189. }
  190. }
  191. .content{
  192. flex: 1;
  193. padding: 20rpx;
  194. padding-top: 0;
  195. overflow: scroll;
  196. .card_wrap{
  197. padding: 20rpx;
  198. background: #fff;
  199. box-sizing: border-box;
  200. border-radius: 19rpx;
  201. margin-bottom: 20rpx;
  202. &:last-child{
  203. margin-bottom: 0;
  204. }
  205. .time_wrap{
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 20rpx;
  209. .time_logo{
  210. width: 32rpx;
  211. height: 32rpx;
  212. }
  213. .date{
  214. font-size: 26rpx;
  215. font-weight: 500;
  216. letter-spacing: 0.06em;
  217. color: #BBBBBB;
  218. margin-left: 18rpx;
  219. margin-right: 24rpx;
  220. }
  221. .time{
  222. font-size: 26rpx;
  223. font-weight: 500;
  224. letter-spacing: 0.06em;
  225. color: #BBBBBB;
  226. }
  227. }
  228. .info_grid{
  229. display: grid;
  230. grid-template-columns: repeat(2, 1fr);
  231. grid-template-rows: repeat(3, 1fr);
  232. column-gap: 20rpx;
  233. row-gap: 10rpx;
  234. .info{
  235. padding: 18rpx 0;
  236. box-sizing: border-box;
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. font-size: 26rpx;
  241. font-weight: 500;
  242. letter-spacing: 0.06em;
  243. color: #151515;
  244. border-radius: 8rpx;
  245. }
  246. .bg1{
  247. background: rgba(97, 43, 235, 0.06);
  248. }
  249. .bg2{
  250. background: rgba(97, 43, 235, 0.06);
  251. }
  252. .bg3{
  253. background: rgba(24, 164, 240, 0.06);
  254. }
  255. .bg4{
  256. background: rgba(24, 164, 240, 0.06);
  257. }
  258. .bg5{
  259. background: rgba(246, 170, 18, 0.06);
  260. }
  261. .bg6{
  262. background: rgba(246, 170, 18, 0.06);
  263. }
  264. }
  265. }
  266. }
  267. .grid_layout{
  268. display: grid;
  269. grid-template-columns: repeat(2, 1fr);
  270. grid-template-rows: repeat(3, 1fr);
  271. column-gap: 20rpx;
  272. row-gap: 20rpx;
  273. .grid_box{
  274. border-radius: 19rpx;
  275. padding: 77rpx 0;
  276. display: flex;
  277. flex-direction: column;
  278. align-items: center;
  279. justify-content: center;
  280. box-sizing: border-box;
  281. .main_title{
  282. font-size: 60rpx;
  283. font-weight: bold;
  284. letter-spacing: 0.1em;
  285. color: #FFFFFF;
  286. margin-bottom: 25rpx;
  287. }
  288. .capacity_btn{
  289. display: flex;
  290. align-items: center;
  291. justify-content: center;
  292. padding: 10rpx 40rpx;
  293. border-radius: 60rpx;
  294. background: rgba(255, 255, 255, 0.1);
  295. .unit{
  296. white-space: nowrap;
  297. font-size: 40rpx;
  298. font-weight: normal;
  299. letter-spacing: 0em;
  300. color: #FFFFFF;
  301. }
  302. }
  303. }
  304. .background1{
  305. background: #612BEB;
  306. }
  307. .background2{
  308. background: #7540FD;
  309. }
  310. .background3{
  311. background: #18A4F0;
  312. }
  313. .background4{
  314. background: #1ACEEA;
  315. }
  316. .background5{
  317. background: #F6AA12;
  318. }
  319. .background6{
  320. background: #FDC030;
  321. }
  322. }
  323. .footer_tab{
  324. padding: 19rpx 59rpx;
  325. background: #FFFFFF;
  326. display: flex;
  327. align-items: center;
  328. justify-content: space-between;
  329. .btn{
  330. display: flex;
  331. align-items: center;
  332. padding: 22rpx 55rpx;
  333. justify-content: space-between;
  334. box-sizing: border-box;
  335. .result_logo{
  336. height: 28rpx;
  337. width: 25rpx;
  338. }
  339. .history_logo{
  340. width: 32rpx;
  341. height: 28rpx;
  342. }
  343. .font_btn{
  344. font-size: 26rpx;
  345. font-weight: 500;
  346. letter-spacing: 0em;
  347. color: #151515;
  348. margin-left: 16rpx;
  349. }
  350. }
  351. .active{
  352. background: #F6F6F6;
  353. border-radius: 42rpx;
  354. }
  355. }
  356. }
  357. </style>