acid.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="hb column hidden container">
  3. <image class="bg" src="/static/images/health/uric_acid_top_bg.png" mode="widthFix"></image>
  4. <view :style="{height: statusBarHeight,background: bgColor }"></view>
  5. <u-navbar title="尿酸监测" titleStyle="font-weight: bold;" @rightClick="rightClick" :autoBack="true"
  6. :bg-color="bgColor">
  7. </u-navbar>
  8. <view class="top-fixed">
  9. <dateTimePicker @onChange="onChangeTime" :tabColor="'blue'"/>
  10. </view>
  11. <scroll-view class="content" :scroll-y="true">
  12. <view class="content-box">
  13. <view class="tltle">尿酸趋势</view>
  14. <view class="subtitle">单位:μmol/L</view>
  15. <view class="charts-box">
  16. <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
  17. </view>
  18. </view>
  19. <view class="content-box">
  20. <view class="align-center justify-between">
  21. <view class="tltle">尿酸异常记录</view>
  22. <view class="more" @click="navgetTo()">
  23. <text>查看更多</text>
  24. <image class="w48 h48" src="/static/images/health/right_arrow_right_icon24.png"></image>
  25. </view>
  26. </view>
  27. <view class="type-box">
  28. <view class="box bg3">
  29. <view class="fs32 mb12">高风险</view>
  30. <view class="align-center justify-between">
  31. <text class="subtitle">4次</text>
  32. <image class="w24 h24" src="/static/images/health/yz_arrow_icon.png"></image>
  33. </view>
  34. </view>
  35. <view class="box bg2">
  36. <view class="fs32 mb12">不良</view>
  37. <view class="align-center justify-between">
  38. <text class="subtitle">4次</text>
  39. <image class="w24 h24" src="/static/images/health/qw_arrow_icon.png"></image>
  40. </view>
  41. </view>
  42. <view class="box bg1">
  43. <view class="fs32 mb12">正常</view>
  44. <view class="align-center justify-between">
  45. <text class="subtitle">4次</text>
  46. <image class="w24 h24" src="/static/images/health/zc_arrow_icon.png"></image>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="content-bottom">
  51. <view class="align-center">
  52. <image class="w48 h48" src="/static/images/health/note_icon.png"></image>
  53. <view class="title">尿酸
  54. <text>最新标准</text>
  55. </view>
  56. </view>
  57. <view class="bottom-box">
  58. <view>男性正常值:150~416umol/L</view>
  59. <view>女性正常值:89~357μmol/L</view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="h20"></view>
  64. <view class="btn-box">
  65. <view class="sub-btn" @click="navgetTo()">记录</view>
  66. </view>
  67. </scroll-view>
  68. </view>
  69. </template>
  70. <script>
  71. import dateTimePicker from "@/pages_echarts/components/dateTimePicker/dateTimePicker.vue"
  72. export default {
  73. components: {
  74. dateTimePicker
  75. },
  76. data() {
  77. return {
  78. statusBarHeight: '',
  79. top: 0,
  80. aIndex: 0,
  81. times: [{
  82. name: "每日",
  83. val: 0
  84. },
  85. {
  86. name: "每周",
  87. val: 1
  88. },
  89. {
  90. name: "每月",
  91. val: 2
  92. }
  93. ],
  94. indexInfo: [],
  95. chartData: {},
  96. opts: {
  97. padding: [15, 0, 15, 0],
  98. enableScroll: false,
  99. dataLabel: false,
  100. legend: {
  101. show: false
  102. },
  103. xAxis: {
  104. disableGrid: true,
  105. fontSize: 12,
  106. axisLine: false,
  107. fontColor: '#ccc',
  108. labelCount: 7,
  109. format: "formatterTime",
  110. },
  111. yAxis: {
  112. gridType: "dash",
  113. dashLength: 2,
  114. data: [{
  115. fontColor: '#ccc',
  116. min: 0,
  117. // max: 100,
  118. axisLine: false,
  119. fontSize: 12,
  120. }]
  121. },
  122. extra: {
  123. tooltip: {
  124. gridType: "dash",
  125. showArrow: false,
  126. legendShow: true,
  127. legendShape: "circle"
  128. },
  129. column: {
  130. type: "group",
  131. width: 12,
  132. barBorderRadius: [4, 4, 0, 0],
  133. }
  134. }
  135. }
  136. }
  137. },
  138. computed: {
  139. // 计算属性的 getter
  140. bgColor: function() {
  141. var top = this.top / 30;
  142. return 'rgba(11,179,242, ' + top + ')';
  143. },
  144. },
  145. onLoad() {
  146. // 获取系统信息
  147. const sys = uni.getSystemInfoSync()
  148. this.statusBarHeight = sys.statusBarHeight + 'px'
  149. this.getServerData();
  150. },
  151. onUnload() { //普通页面在 onUnload 生命周期中执行
  152. uni.$emit('stop')
  153. },
  154. onHide() { //tabBar页面在onHide生命周期中执行
  155. uni.$emit('stop')
  156. },
  157. onPageScroll(e) {
  158. //console.log(e)
  159. this.top = e.scrollTop;
  160. },
  161. methods: {
  162. // tab切换
  163. orderStatusChange(item) {
  164. this.aIndex = item.val
  165. },
  166. onChangeTime(time) {
  167. const param = {
  168. startTime: this.utils.timeFormat(time[0],'yyyy/mm/dd hh:MM:ss'),
  169. endTime: this.utils.timeFormat(time[1],'yyyy/mm/dd hh:MM:ss'),
  170. deviceId: ''
  171. }
  172. // this.queryParam = param
  173. // this.getServerData(param)
  174. // this.getAbnormalInfo(param)
  175. },
  176. getServerData() {
  177. //模拟从服务器获取数据时的延时
  178. setTimeout(() => {
  179. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  180. let res = {
  181. categories: ["00:00", "06:00", "12:00", "18:00", "23:59"],
  182. series: [{
  183. name: "尿酸",
  184. data:[{
  185. value:23,
  186. color:'#FDBD27',
  187. },{
  188. value:123,
  189. color:'#FF5558',
  190. },
  191. {
  192. value:90,
  193. color:'#52D087',
  194. },
  195. {
  196. value:23,
  197. color:'#FDBD27',
  198. },
  199. {
  200. value:90,
  201. color:'#52D087',
  202. }
  203. ]
  204. // data: res.data.map(item => ({
  205. // value: item.val,
  206. // color: item.status === 1 ? "#FDBD27" : item.status ===
  207. // 2 ? "#FF5558" : "#52D087"
  208. // }))
  209. }
  210. ]
  211. };
  212. this.chartData = JSON.parse(JSON.stringify(res));
  213. }, 500);
  214. },
  215. navgetTo(index) {
  216. uni.navigateTo({
  217. url: '/pages_echarts/acidList'
  218. })
  219. },
  220. goToUser() {
  221. uni.navigateTo({
  222. url: '/pages_health/addUser?type=edit&docId='
  223. })
  224. }
  225. }
  226. }
  227. </script>
  228. <style lang="scss" scoped>
  229. .container {
  230. position: relative;
  231. .bg {
  232. width: 100%;
  233. height: 380rpx;
  234. position: absolute;
  235. top: 0;
  236. left: 0;
  237. z-index: -1;
  238. }
  239. }
  240. .top-fixed {
  241. width: 100%;
  242. position: fixed;
  243. top: calc(var(--status-bar-height) + 140rpx);
  244. left: 0;
  245. z-index: 10;
  246. }
  247. .pub-tab-box {
  248. box-sizing: border-box;
  249. width: 400rpx;
  250. // padding: 0 60rpx;
  251. margin: 0 auto;
  252. // background-color: #FFFFFF;
  253. .tab-inner {
  254. height: 88upx;
  255. line-height: 88upx;
  256. display: flex;
  257. align-items: center;
  258. justify-content: space-between;
  259. overflow-x: auto;
  260. }
  261. .item {
  262. font-family: PingFang SC;
  263. font-weight: 400;
  264. font-size: 30rpx;
  265. color: #626468;
  266. line-height: 64rpx;
  267. text-align: center;
  268. &:last-child {
  269. margin-right: 0;
  270. }
  271. &.active {
  272. font-weight: 500;
  273. width: 124rpx;
  274. height: 64rpx;
  275. background: #4585F8;
  276. border-radius: 32rpx 32rpx 32rpx 32rpx;
  277. color: #fff;
  278. }
  279. .text {
  280. position: relative;
  281. z-index: 1;
  282. }
  283. .tab-bg {
  284. width: 72upx;
  285. height: 28upx;
  286. position: absolute;
  287. top: 17upx;
  288. left: 50%;
  289. transform: translateX(-36upx);
  290. z-index: -1;
  291. }
  292. }
  293. }
  294. .content {
  295. padding-top: calc(var(--status-bar-height) + 320rpx) !important;
  296. height: 100vh;
  297. box-sizing: border-box;
  298. width: 100%;
  299. padding: 20rpx;
  300. overflow: hidden;
  301. .btn-box {
  302. height: 120upx;
  303. padding: 0 30upx;
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. .sub-btn {
  308. width: 388rpx;
  309. height: 72rpx;
  310. line-height: 72upx;
  311. text-align: center;
  312. font-size: 32upx;
  313. font-family: PingFang SC;
  314. font-weight: bold;
  315. color: #FFFFFF;
  316. background: #4585F8;
  317. border-radius: 44upx;
  318. margin-bottom: 40upx;
  319. }
  320. }
  321. .content-box {
  322. // width: 100%;
  323. background: #FFFFFF;
  324. border-radius: 16rpx 16rpx 16rpx 16rpx;
  325. padding: 24rpx;
  326. margin-bottom: 20rpx;
  327. .tltle {
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. font-size: 36rpx;
  331. color: #222426;
  332. text-align: left;
  333. margin-bottom: 16rpx;
  334. }
  335. .subtitle {
  336. font-weight: 400;
  337. font-size: 24rpx;
  338. color: #898E91;
  339. text-align: left;
  340. }
  341. /* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
  342. .charts-box {
  343. // width: 100%;
  344. height: 500rpx;
  345. margin-top: 30rpx;
  346. }
  347. .more {
  348. display: flex;
  349. align-items: center;
  350. font-family: PingFang SC;
  351. font-weight: 400;
  352. font-size: 24rpx;
  353. color: #898E91;
  354. }
  355. .type-box {
  356. display: flex;
  357. align-items: center;
  358. justify-content: space-between;
  359. margin-top: 20rpx;
  360. .box {
  361. padding: 24rpx;
  362. width: 158rpx;
  363. // height: 144rpx;
  364. border-radius: 16rpx 16rpx 16rpx 16rpx;
  365. &.bg1 {
  366. background: #FAFFFC;
  367. border: 2rpx solid #EBFFF3;
  368. }
  369. &.bg2 {
  370. background: #FEFAF8;
  371. border: 2rpx solid #FDF7F3;
  372. }
  373. &.bg3 {
  374. background: #FFFCFC;
  375. border: 2rpx solid #FCF4F4;
  376. }
  377. }
  378. }
  379. .content-bottom {
  380. padding: 24rpx;
  381. background: #F5F7FA;
  382. border-radius: 16rpx 16rpx 16rpx 16rpx;
  383. margin-top: 32rpx;
  384. .title {
  385. font-family: PingFang SC;
  386. font-weight: 500;
  387. font-size: 28rpx;
  388. color: #222426;
  389. text-align: left;
  390. margin-left: 14rpx;
  391. text {
  392. color: #FF5030;
  393. }
  394. }
  395. .bottom-box {
  396. postion: relative;
  397. font-weight: 400;
  398. font-size: 24rpx;
  399. color: #626468;
  400. text-align: left;
  401. line-height: 40rpx;
  402. padding-top: 24rpx;
  403. padding-left: 24rpx;
  404. view {
  405. position: relative;
  406. }
  407. view::before {
  408. content: "";
  409. width: 8rpx;
  410. height: 8rpx;
  411. background: rgba(255, 80, 48, 0.2);
  412. position: absolute;
  413. left: -22rpx;
  414. top: 20rpx;
  415. border-radius: 50%;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. </style>