acid.vue 10 KB

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