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

352 lines
8.3 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
  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. const self = this
  106. // 就在加载的时候请求一次某人的数据 筛选最新一条放入第一个tab
  107. // 历史数据渲染到第二个tab
  108. // 数据中有username idcard 以及信息列表
  109. uni.request({
  110. url: 'http://localhost:8080/zsjyadmin/detection/current',
  111. method:"GET",
  112. success: (res) => {
  113. if (res?.data?.code == 0){
  114. const data = res?.data?.data
  115. const {idcard, username, resultList} = data || {}
  116. self.idcard = idcard
  117. self.username = username
  118. // 对resultList 根据id进行排序
  119. resultList.sort((a, b) => {
  120. return b.id - a.id
  121. })
  122. self.resultList = resultList
  123. }
  124. }
  125. });
  126. },
  127. methods: {
  128. changeActiveTab(activeTab) {
  129. this.activeTab = activeTab
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="less">
  135. .main_content{
  136. background: #f6f6f6;
  137. height: 100vh;
  138. width: 100vw;
  139. display: flex;
  140. flex-direction: column;
  141. .header_info{
  142. padding: 20rpx;
  143. .info_container{
  144. width: 100%;
  145. background: #fff;
  146. padding: 22rpx 38rpx;
  147. box-sizing: border-box;
  148. border-radius: 40rpx;
  149. align-items: center;
  150. justify-content: space-between;
  151. display: flex;
  152. .name_wrap{
  153. display: flex;
  154. align-items: center;
  155. .name_logo{
  156. width: 30rpx;
  157. height: 35rpx;
  158. }
  159. .name{
  160. font-size: 24rpx;
  161. font-weight: 500;
  162. letter-spacing: 0.03em;
  163. color: #000000;
  164. margin-left: 16rpx;
  165. }
  166. }
  167. .idcard_wrap{
  168. display: flex;
  169. align-items: center;
  170. .card_logo{
  171. width: 38rpx;
  172. height: 29rpx;
  173. }
  174. .card_number{
  175. font-size: 24rpx;
  176. font-weight: 500;
  177. letter-spacing: 0.03em;
  178. margin-left: 13rpx;
  179. color: #BBBBBB;
  180. }
  181. }
  182. }
  183. }
  184. .content{
  185. flex: 1;
  186. padding: 20rpx;
  187. padding-top: 0;
  188. overflow: scroll;
  189. .card_wrap{
  190. padding: 20rpx;
  191. background: #fff;
  192. box-sizing: border-box;
  193. border-radius: 19rpx;
  194. margin-bottom: 20rpx;
  195. &:last-child{
  196. margin-bottom: 0;
  197. }
  198. .time_wrap{
  199. display: flex;
  200. align-items: center;
  201. margin-bottom: 20rpx;
  202. .time_logo{
  203. width: 32rpx;
  204. height: 32rpx;
  205. }
  206. .date{
  207. font-size: 26rpx;
  208. font-weight: 500;
  209. letter-spacing: 0.06em;
  210. color: #BBBBBB;
  211. margin-left: 18rpx;
  212. margin-right: 24rpx;
  213. }
  214. .time{
  215. font-size: 26rpx;
  216. font-weight: 500;
  217. letter-spacing: 0.06em;
  218. color: #BBBBBB;
  219. }
  220. }
  221. .info_grid{
  222. display: grid;
  223. grid-template-columns: repeat(2, 1fr);
  224. grid-template-rows: repeat(3, 1fr);
  225. column-gap: 20rpx;
  226. row-gap: 10rpx;
  227. .info{
  228. padding: 18rpx 0;
  229. box-sizing: border-box;
  230. display: flex;
  231. align-items: center;
  232. justify-content: center;
  233. font-size: 26rpx;
  234. font-weight: 500;
  235. letter-spacing: 0.06em;
  236. color: #151515;
  237. border-radius: 8rpx;
  238. }
  239. .bg1{
  240. background: rgba(97, 43, 235, 0.06);
  241. }
  242. .bg2{
  243. background: rgba(97, 43, 235, 0.06);
  244. }
  245. .bg3{
  246. background: rgba(24, 164, 240, 0.06);
  247. }
  248. .bg4{
  249. background: rgba(24, 164, 240, 0.06);
  250. }
  251. .bg5{
  252. background: rgba(246, 170, 18, 0.06);
  253. }
  254. .bg6{
  255. background: rgba(246, 170, 18, 0.06);
  256. }
  257. }
  258. }
  259. }
  260. .grid_layout{
  261. display: grid;
  262. grid-template-columns: repeat(2, 1fr);
  263. grid-template-rows: repeat(3, 1fr);
  264. column-gap: 20rpx;
  265. row-gap: 20rpx;
  266. .grid_box{
  267. border-radius: 19rpx;
  268. padding: 77rpx 0;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. justify-content: center;
  273. box-sizing: border-box;
  274. .main_title{
  275. font-size: 60rpx;
  276. font-weight: bold;
  277. letter-spacing: 0.1em;
  278. color: #FFFFFF;
  279. margin-bottom: 25rpx;
  280. }
  281. .capacity_btn{
  282. display: flex;
  283. align-items: center;
  284. justify-content: center;
  285. padding: 10rpx 40rpx;
  286. border-radius: 60rpx;
  287. background: rgba(255, 255, 255, 0.1);
  288. .unit{
  289. white-space: nowrap;
  290. font-size: 40rpx;
  291. font-weight: normal;
  292. letter-spacing: 0em;
  293. color: #FFFFFF;
  294. }
  295. }
  296. }
  297. .background1{
  298. background: #612BEB;
  299. }
  300. .background2{
  301. background: #7540FD;
  302. }
  303. .background3{
  304. background: #18A4F0;
  305. }
  306. .background4{
  307. background: #1ACEEA;
  308. }
  309. .background5{
  310. background: #F6AA12;
  311. }
  312. .background6{
  313. background: #FDC030;
  314. }
  315. }
  316. .footer_tab{
  317. padding: 19rpx 59rpx;
  318. background: #FFFFFF;
  319. display: flex;
  320. align-items: center;
  321. justify-content: space-between;
  322. .btn{
  323. display: flex;
  324. align-items: center;
  325. padding: 22rpx 55rpx;
  326. justify-content: space-between;
  327. box-sizing: border-box;
  328. .result_logo{
  329. height: 28rpx;
  330. width: 25rpx;
  331. }
  332. .history_logo{
  333. width: 32rpx;
  334. height: 28rpx;
  335. }
  336. .font_btn{
  337. font-size: 26rpx;
  338. font-weight: 500;
  339. letter-spacing: 0em;
  340. color: #151515;
  341. margin-left: 16rpx;
  342. }
  343. }
  344. .active{
  345. background: #F6F6F6;
  346. border-radius: 42rpx;
  347. }
  348. }
  349. }
  350. </style>