healthfiles.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="hb column hidden container">
  3. <image class="bg" src="/static/images/health/jkda_top_bg.png" mode="widthFix"></image>
  4. <view :style="{height: statusBarHeight,background: bgColor }"></view>
  5. <u-navbar
  6. title="健康档案" titleStyle="font-weight: bold;"
  7. @rightClick="rightClick"
  8. :autoBack="true"
  9. :bg-color="bgColor"
  10. >
  11. </u-navbar>
  12. <scroll-view class="content" :scroll-y="true">
  13. <view class="justify-between align-center bg-white radius12 p28">
  14. <view class="justify-start align-center">
  15. <image :src="maleurl" class="w140 h140"></image>
  16. <view class="ml30">
  17. <view class="bold fs32 mb12">张小安</view>
  18. <view class="justify-start align-center fs24">
  19. <text class="orangebox">女</text>
  20. <text class="orangebox ml12">56岁</text>
  21. </view>
  22. </view>
  23. </view>
  24. <u-icon name="arrow-right"></u-icon>
  25. </view>
  26. <view class="fs36 bold mt20">健康数据</view>
  27. <view class="health-monitoring">
  28. <view class="health-monitoring-item" v-for="(item,index) in indexInfo" :key="index"
  29. @tap="handleMonitoring(item)">
  30. <view class="health-monitoring-title">
  31. <view>
  32. <view class="health-monitoring-maintitle bold">{{item.type.type}}</view>
  33. <view>{{item.type.title}}</view>
  34. </view>
  35. <image :src="item.type.icon" mode="aspectFill"></image>
  36. </view>
  37. <view class="health-bmi mt50" v-if="index==0">
  38. <view class="justify-between align-center mb12">
  39. <view class="justify-start align-center ">
  40. <text class="color-text2 fs24 mr20">身高</text>
  41. <view >{{item.height||'--'}}</view>
  42. </view>
  43. <image src="/static/images/health/services_edit_icon.png" class="w32 h32"></image>
  44. </view>
  45. <view class="justify-between align-center">
  46. <view class="justify-start align-center ">
  47. <text class="color-text2 fs24 mr20">体重</text>
  48. <view >{{item.weight||'--'}}</view>
  49. </view>
  50. <image src="/static/images/health/services_edit_icon.png" class="w32 h32"></image>
  51. </view>
  52. </view>
  53. <view v-else>
  54. <view class="health-monitoring-res resnum">{{item.data || '--'}}</view>
  55. <view class="health-monitoring-time">{{item.date && item.date.substring(5,16)}}</view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="fs36 bold mtb20">健康史</view>
  60. <view class="cardbox">
  61. <view class="health-item" v-for="(item,index) in healthRecordsList" :key="index" @click="handleEditHealth(item,1)">
  62. <image class="health-bgicon" :src="item.bgicon"></image>
  63. <view class="health-item-info">
  64. <view class="cardbox-maintitle" style="margin-bottom: 0;">{{item.title}}</view>
  65. <view class="text-overflow" style="margin-top: 20rpx;">{{item.desc || "尚未记录"}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="h80"></view>
  70. </scroll-view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. statusBarHeight:'',
  78. top:0,
  79. famaleurl:"/static/images/health/female_profile.png",
  80. maleurl:"/static/images/health/my_heads.png",
  81. indexInfo: [
  82. {
  83. data: "",
  84. date: "",
  85. height:'',
  86. weight:'',
  87. type: {
  88. type: "BMI 24.8",
  89. title: "肥胖",
  90. icon:"/static/images/health/BMI_icon.png"
  91. }
  92. },{
  93. data: "",
  94. date: "",
  95. type: {
  96. type: "腰围",
  97. title: "腰围",
  98. icon:"/static/images/health/waist_circumference_icon.png"
  99. }
  100. },{
  101. data: "",
  102. date: "",
  103. type: {
  104. type: "臀围",
  105. title: "臀围",
  106. icon:"/static/images/health/hip_circumference_icon.png"
  107. }
  108. },
  109. {
  110. data: "",
  111. date: "",
  112. type: {
  113. type: "血糖",
  114. title: "血糖健康监测",
  115. icon: "/static/images/health/blood_sugar_icon.png"
  116. }
  117. },
  118. {
  119. data: "",
  120. date: "",
  121. type: {
  122. type: "血压",
  123. title: "血压健康监测",
  124. icon:"/static/images/health/blood_pressure_icon.png"
  125. }
  126. },
  127. {
  128. data: "",
  129. date: "",
  130. type: {
  131. type: "尿酸",
  132. title: "尿酸健康监测",
  133. icon:"/static/images/health/uric_acid_icon.png"
  134. }
  135. },
  136. ],
  137. healthRecordsList: [
  138. {
  139. title: '疾病史',
  140. type: "healthHistory",
  141. desc: '',
  142. bgicon: "/static/images/health/jbs_icon.png",
  143. }, {
  144. title: '症状史',
  145. type: "symptomHistory",
  146. desc: '',
  147. bgicon: "/static/images/health/zzs_icon.png",
  148. }
  149. ],
  150. }
  151. },
  152. computed: {
  153. // 计算属性的 getter
  154. bgColor: function() {
  155. var top=this.top/30;
  156. return 'rgba(11,179,242, ' + top + ')';
  157. },
  158. },
  159. onLoad() {
  160. // 获取系统信息
  161. const sys = uni.getSystemInfoSync()
  162. this.statusBarHeight = sys.statusBarHeight+'px'
  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. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .container{
  180. position: relative;
  181. .bg{
  182. width: 100%;
  183. height: 380rpx;
  184. position: absolute;
  185. top: 0;
  186. left: 0;
  187. z-index: -1;
  188. }
  189. }
  190. .content{
  191. padding-top: calc(var(--status-bar-height) + 140rpx) !important;
  192. height: 100vh;
  193. box-sizing: border-box;
  194. width: 100%;
  195. padding: 20rpx;
  196. }
  197. .orangebox{
  198. border-radius: 24rpx;
  199. border: 1rpx solid #FFA599;
  200. color: #FF4B33;
  201. font-size: 24rpx;
  202. padding: 4rpx 20rpx;
  203. }
  204. .health-monitoring {
  205. // @include u-flex(row, center, flex-start);
  206. display: flex;
  207. justify-content: space-between;
  208. flex-wrap: wrap;
  209. // gap: 16rpx;
  210. margin-top: 30rpx;
  211. margin-bottom: -16rpx;
  212. margin-right: -16rpx;
  213. &-item {
  214. width: 343rpx;
  215. min-height: 264rpx;
  216. margin: 0 16rpx 16rpx 0;
  217. overflow: hidden;
  218. background: #FFFFFF;
  219. border-radius: 16rpx 16rpx 16rpx 16rpx;
  220. padding: 24rpx 34rpx 24rpx 24rpx;
  221. box-sizing: border-box;
  222. }
  223. &-maintitle {
  224. margin-bottom: 4rpx;
  225. font-size: 30rpx;
  226. color: #333333;
  227. }
  228. &-title {
  229. // @include u-flex(row, center, space-between);
  230. display: flex;
  231. justify-content: space-between;
  232. font-weight: 400;
  233. font-size: 24rpx;
  234. color: #999999;
  235. image {
  236. width: 72rpx;
  237. height: 72rpx;
  238. flex-shrink: 0;
  239. }
  240. }
  241. .resnum {
  242. font-family: DIN, DIN;
  243. font-weight: 500;
  244. font-size: 64rpx;
  245. }
  246. &-res {
  247. height: 78rpx;
  248. margin: 20rpx 0 6rpx;
  249. font-family: PingFang SC, PingFang SC;
  250. font-weight: 600;
  251. font-size: 48rpx;
  252. color: #333333;
  253. }
  254. &-time {
  255. font-weight: 400;
  256. font-size: 22rpx;
  257. color: #999999;
  258. }
  259. }
  260. .cardbox {
  261. display: flex;
  262. flex-direction: row;
  263. align-items: center;
  264. justify-content: space-between;
  265. flex-wrap: wrap;
  266. gap: 16rpx 14rpx;
  267. &-maintitle {
  268. margin-bottom: 4rpx;
  269. font-weight: 600;
  270. font-size: 30rpx;
  271. color: #333333;
  272. }
  273. }
  274. .health-item {
  275. width: 343rpx;
  276. height: 224rpx;
  277. padding: 24rpx;
  278. box-sizing: border-box;
  279. background: #FFFFFF;
  280. border-radius: 16rpx 16rpx 16rpx 16rpx;
  281. overflow: hidden;
  282. position: relative;
  283. font-family: PingFang SC, PingFang SC;
  284. font-weight: 400;
  285. font-size: 24rpx;
  286. color: #999999;
  287. }
  288. .health-item-info {
  289. position: relative;
  290. }
  291. .health-bgicon {
  292. position: absolute;
  293. right: 0;
  294. bottom: 0;
  295. width: 168rpx;
  296. height: 168rpx;
  297. }
  298. </style>