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

343 lines
7.7 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
  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">姓名 : 张三</text>
  8. </view>
  9. <view class="idcard_wrap">
  10. <image src="/static/card.png" class="card_logo"></image>
  11. <text class="card_number">身份证号 : 123456202301010000</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">00mmol / 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">00mmol / 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">00mmol / 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">00mmol / 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">00mmol / 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">00mmol / 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 10" :key="item">
  55. <view class="time_wrap">
  56. <image src="/static/time.png" class="time_logo"></image>
  57. <text class="date">2023-07-01</text>
  58. <text class="time">14:20</text>
  59. </view>
  60. <view class="info_grid">
  61. <view class="info bg1">
  62. <text>L-乳酸 00mmol/L</text>
  63. </view>
  64. <view class="info bg2">
  65. <text>肌酸 00mmol/L</text>
  66. </view>
  67. <view class="info bg3">
  68. <text>肌酐 00mmol/L</text>
  69. </view>
  70. <view class="info bg4">
  71. <text>尿素 00mmol/L</text>
  72. </view>
  73. <view class="info bg5">
  74. <text>β-羟丁酸 00mmol/L</text>
  75. </view>
  76. <view class="info bg6">
  77. <text>L-谷氨酸 00mmol/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. }
  100. },
  101. onLoad() {
  102. // 就在加载的时候请求一次某人的数据 筛选最新一条放入第一个tab
  103. // 历史数据渲染到第二个tab
  104. // 数据中有username idcard 以及信息列表
  105. uni.request({
  106. url: 'https://www.example.com/request', //仅为示例,并非真实接口地址。
  107. data: {
  108. text: 'uni.request'
  109. },
  110. header: {
  111. 'custom-header': 'hello' //自定义请求头信息
  112. },
  113. success: (res) => {
  114. console.log(res.data);
  115. }
  116. });
  117. },
  118. methods: {
  119. changeActiveTab(activeTab) {
  120. this.activeTab = activeTab
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="less">
  126. .main_content{
  127. background: #f6f6f6;
  128. height: 100vh;
  129. width: 100vw;
  130. display: flex;
  131. flex-direction: column;
  132. .header_info{
  133. padding: 20rpx;
  134. .info_container{
  135. width: 100%;
  136. background: #fff;
  137. padding: 22rpx 38rpx;
  138. box-sizing: border-box;
  139. border-radius: 40rpx;
  140. align-items: center;
  141. justify-content: space-between;
  142. display: flex;
  143. .name_wrap{
  144. display: flex;
  145. align-items: center;
  146. .name_logo{
  147. width: 30rpx;
  148. height: 35rpx;
  149. }
  150. .name{
  151. font-size: 24rpx;
  152. font-weight: 500;
  153. letter-spacing: 0.03em;
  154. color: #000000;
  155. margin-left: 16rpx;
  156. }
  157. }
  158. .idcard_wrap{
  159. display: flex;
  160. align-items: center;
  161. .card_logo{
  162. width: 38rpx;
  163. height: 29rpx;
  164. }
  165. .card_number{
  166. font-size: 24rpx;
  167. font-weight: 500;
  168. letter-spacing: 0.03em;
  169. margin-left: 13rpx;
  170. color: #BBBBBB;
  171. }
  172. }
  173. }
  174. }
  175. .content{
  176. flex: 1;
  177. padding: 20rpx;
  178. padding-top: 0;
  179. overflow: scroll;
  180. .card_wrap{
  181. padding: 20rpx;
  182. background: #fff;
  183. box-sizing: border-box;
  184. border-radius: 19rpx;
  185. margin-bottom: 20rpx;
  186. &:last-child{
  187. margin-bottom: 0;
  188. }
  189. .time_wrap{
  190. display: flex;
  191. align-items: center;
  192. margin-bottom: 20rpx;
  193. .time_logo{
  194. width: 32rpx;
  195. height: 32rpx;
  196. }
  197. .date{
  198. font-size: 26rpx;
  199. font-weight: 500;
  200. letter-spacing: 0.06em;
  201. color: #BBBBBB;
  202. margin-left: 18rpx;
  203. margin-right: 24rpx;
  204. }
  205. .time{
  206. font-size: 26rpx;
  207. font-weight: 500;
  208. letter-spacing: 0.06em;
  209. color: #BBBBBB;
  210. }
  211. }
  212. .info_grid{
  213. display: grid;
  214. grid-template-columns: repeat(2, 1fr);
  215. grid-template-rows: repeat(3, 1fr);
  216. column-gap: 20rpx;
  217. row-gap: 10rpx;
  218. .info{
  219. padding: 18rpx 0;
  220. box-sizing: border-box;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. font-size: 26rpx;
  225. font-weight: 500;
  226. letter-spacing: 0.06em;
  227. color: #151515;
  228. border-radius: 8rpx;
  229. }
  230. .bg1{
  231. background: rgba(97, 43, 235, 0.06);
  232. }
  233. .bg2{
  234. background: rgba(97, 43, 235, 0.06);
  235. }
  236. .bg3{
  237. background: rgba(24, 164, 240, 0.06);
  238. }
  239. .bg4{
  240. background: rgba(24, 164, 240, 0.06);
  241. }
  242. .bg5{
  243. background: rgba(246, 170, 18, 0.06);
  244. }
  245. .bg6{
  246. background: rgba(246, 170, 18, 0.06);
  247. }
  248. }
  249. }
  250. }
  251. .grid_layout{
  252. display: grid;
  253. grid-template-columns: repeat(2, 1fr);
  254. grid-template-rows: repeat(3, 1fr);
  255. column-gap: 20rpx;
  256. row-gap: 20rpx;
  257. .grid_box{
  258. border-radius: 19rpx;
  259. padding: 77rpx 0;
  260. display: flex;
  261. flex-direction: column;
  262. align-items: center;
  263. justify-content: center;
  264. box-sizing: border-box;
  265. .main_title{
  266. font-size: 60rpx;
  267. font-weight: bold;
  268. letter-spacing: 0.1em;
  269. color: #FFFFFF;
  270. margin-bottom: 25rpx;
  271. }
  272. .capacity_btn{
  273. display: flex;
  274. align-items: center;
  275. justify-content: center;
  276. padding: 10rpx 40rpx;
  277. border-radius: 60rpx;
  278. background: rgba(255, 255, 255, 0.1);
  279. .unit{
  280. white-space: nowrap;
  281. font-size: 40rpx;
  282. font-weight: normal;
  283. letter-spacing: 0em;
  284. color: #FFFFFF;
  285. }
  286. }
  287. }
  288. .background1{
  289. background: #612BEB;
  290. }
  291. .background2{
  292. background: #7540FD;
  293. }
  294. .background3{
  295. background: #18A4F0;
  296. }
  297. .background4{
  298. background: #1ACEEA;
  299. }
  300. .background5{
  301. background: #F6AA12;
  302. }
  303. .background6{
  304. background: #FDC030;
  305. }
  306. }
  307. .footer_tab{
  308. padding: 19rpx 59rpx;
  309. background: #FFFFFF;
  310. display: flex;
  311. align-items: center;
  312. justify-content: space-between;
  313. .btn{
  314. display: flex;
  315. align-items: center;
  316. padding: 22rpx 55rpx;
  317. justify-content: space-between;
  318. box-sizing: border-box;
  319. .result_logo{
  320. height: 28rpx;
  321. width: 25rpx;
  322. }
  323. .history_logo{
  324. width: 32rpx;
  325. height: 28rpx;
  326. }
  327. .font_btn{
  328. font-size: 26rpx;
  329. font-weight: 500;
  330. letter-spacing: 0em;
  331. color: #151515;
  332. margin-left: 16rpx;
  333. }
  334. }
  335. .active{
  336. background: #F6F6F6;
  337. border-radius: 42rpx;
  338. }
  339. }
  340. }
  341. </style>