abnormalList.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view style="padding-bottom: 20rpx;">
  3. <view class="listbox-item" v-for="(item, key, index) in abnormalList" :key="index">
  4. <picker mode="date" fields="month" :value="key" style="display:inline-block;" @change="bindMonthChange">
  5. <view class="listbox-item-datepicker">
  6. <text>{{key}}</text>
  7. <image src="@/static/images/pages_watch/icons/my_right_arrow_right_icon.png"></image>
  8. </view>
  9. </picker>
  10. <view class="listbox-item-card" v-for="(dayinfo,time,idx) in item" :key="idx">
  11. <view class="listbox-item-time">{{time}}</view>
  12. <view class="listbox-item-carditem border-line" v-for="(it,i) in dayinfo" :key="i" @tap="handleDetail(it)">
  13. <view class="listbox-item-carditem-left">
  14. <slot :data="it"></slot>
  15. <text>{{it.num}} {{unit}}</text>
  16. </view>
  17. <text class="listbox-item-carditem-minute">{{$timeFormat(it.createTime, "hh:MM")}}</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name:"abnormalList",
  26. props: {
  27. abnormalList: {
  28. type: Object,
  29. default: {}
  30. },
  31. unit: {
  32. type: String,
  33. default: ""
  34. },
  35. // 数据类型, bs血糖
  36. type: {
  37. type: String,
  38. default: "bs"
  39. }
  40. },
  41. data() {
  42. return {
  43. month: ""
  44. }
  45. },
  46. methods: {
  47. bindMonthChange(e) {
  48. this.$emit("monthChange",e.detail.value)
  49. },
  50. handleDetail(item) {
  51. let param = {}
  52. if(this.type == 'bs') {
  53. param = {
  54. createTime: item.createTime,
  55. num: item.num
  56. }
  57. uni.navigateTo({
  58. url: "/pages_watch/healthMonitoring/bloodSugarDetail?param="+ JSON.stringify(param),
  59. })
  60. } else if(this.type == 'bp') {
  61. param = {
  62. createTime: item.createTime,
  63. sbp: item.num.split('/')[0],
  64. dbp: item.num.split('/')[1]
  65. }
  66. uni.navigateTo({
  67. url: "/pages_watch/healthMonitoring/bloodPressureDetail?param="+ JSON.stringify(param),
  68. })
  69. }
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. @mixin u-flex($flexD, $alignI, $justifyC) {
  76. display: flex;
  77. flex-direction: $flexD;
  78. align-items: $alignI;
  79. justify-content: $justifyC;
  80. }
  81. .listbox-item {
  82. padding: 0 24rpx;
  83. &-datepicker {
  84. height: 96rpx;
  85. line-height: 96rpx;
  86. font-family: PingFang SC, PingFang SC;
  87. font-weight: 500;
  88. font-size: 30rpx;
  89. color: #333333;
  90. @include u-flex(row, center, flex-start);
  91. image {
  92. width: 48rpx;
  93. height: 48rpx;
  94. }
  95. }
  96. &-card {
  97. padding: 16rpx 24rpx 24rpx 24rpx;
  98. margin-bottom: 20rpx;
  99. background: #FFFFFF;
  100. border-radius: 16rpx 16rpx 16rpx 16rpx;
  101. font-family: PingFang SC, PingFang SC;
  102. font-weight: 500;
  103. font-size: 28rpx;
  104. color: #757575;
  105. &:last-of-type {
  106. margin-bottom: 0;
  107. }
  108. }
  109. &-time {
  110. height: 72rpx;
  111. line-height: 72rpx;
  112. margin-bottom: 10rpx;
  113. }
  114. &-carditem {
  115. height: 144rpx;
  116. @include u-flex(row, center, space-between);
  117. &:last-of-type::after {
  118. border: none !important;
  119. }
  120. &-left {
  121. font-size: 30rpx;
  122. color: #222222;
  123. @include u-flex(row, center, flex-start);
  124. }
  125. &-minute {
  126. flex-shrink: 0;
  127. font-weight: 400;
  128. font-size: 24rpx;
  129. color: #999999;
  130. }
  131. }
  132. }
  133. </style>