healthfiles.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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" @click="goToUser"></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. @click="handleMonitoring(item,index)">
  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,index)">
  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. // uni.navigateTo({
  164. // url: '/pages_health/doc?type=edit&docId='
  165. // })
  166. },
  167. onUnload() { //普通页面在 onUnload 生命周期中执行
  168. uni.$emit('stop')
  169. },
  170. onHide() { //tabBar页面在onHide生命周期中执行
  171. uni.$emit('stop')
  172. },
  173. onPageScroll(e) {
  174. //console.log(e)
  175. this.top=e.scrollTop;
  176. },
  177. methods: {
  178. handleMonitoring(item,index){
  179. switch (index) {
  180. case 0:
  181. uni.navigateTo({
  182. url: '/pages_health/addDoc?type=edit&docId='
  183. })
  184. break;
  185. case 1:
  186. uni.navigateTo({
  187. url: '/pages_echarts/waistLine?type=edit&docId='
  188. })
  189. break;
  190. case 2:
  191. uni.navigateTo({
  192. url: '/pages_echarts/hips?type=edit&docId='
  193. })
  194. break;
  195. case 3:
  196. uni.navigateTo({
  197. url: '/pages_echarts/bloodSugar'
  198. })
  199. break;
  200. case 4:
  201. uni.navigateTo({
  202. url: '/pages_echarts/bloodPressure?type=edit&docId='
  203. })
  204. break;
  205. default:
  206. uni.navigateTo({
  207. url: '/pages_echarts/acid?type=edit&docId='
  208. })
  209. break;
  210. }
  211. },
  212. handleEditHealth(item,index){
  213. uni.navigateTo({
  214. url: '/pages_health/addDoc?type=edit&docId='
  215. })
  216. },
  217. goToUser(){
  218. uni.navigateTo({
  219. url: '/pages_health/doc?type=edit&docId='
  220. })
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .container{
  227. position: relative;
  228. background: #EFF3F7;
  229. .bg{
  230. width: 100%;
  231. height: 380rpx;
  232. position: absolute;
  233. top: 0;
  234. left: 0;
  235. z-index:0;
  236. }
  237. }
  238. .content{
  239. padding-top: calc(var(--status-bar-height) + 140rpx) !important;
  240. height: 100vh;
  241. box-sizing: border-box;
  242. width: 100%;
  243. padding: 20rpx;
  244. }
  245. .orangebox{
  246. border-radius: 24rpx;
  247. border: 1rpx solid #FFA599;
  248. color: #FF4B33;
  249. font-size: 24rpx;
  250. padding: 4rpx 20rpx;
  251. }
  252. .health-monitoring {
  253. // @include u-flex(row, center, flex-start);
  254. display: flex;
  255. justify-content: space-between;
  256. flex-wrap: wrap;
  257. // gap: 16rpx;
  258. margin-top: 20rpx;
  259. margin-bottom: -16rpx;
  260. margin-right: -16rpx;
  261. &-item {
  262. width: 343rpx;
  263. min-height: 264rpx;
  264. margin: 0 16rpx 16rpx 0;
  265. overflow: hidden;
  266. background: #FFFFFF;
  267. border-radius: 16rpx 16rpx 16rpx 16rpx;
  268. padding: 24rpx 34rpx 24rpx 24rpx;
  269. box-sizing: border-box;
  270. }
  271. &-maintitle {
  272. margin-bottom: 4rpx;
  273. font-size: 30rpx;
  274. color: #333333;
  275. }
  276. &-title {
  277. // @include u-flex(row, center, space-between);
  278. display: flex;
  279. justify-content: space-between;
  280. font-weight: 400;
  281. font-size: 24rpx;
  282. color: #999999;
  283. image {
  284. width: 72rpx;
  285. height: 72rpx;
  286. flex-shrink: 0;
  287. }
  288. }
  289. .resnum {
  290. font-family: DIN, DIN;
  291. font-weight: 500;
  292. font-size: 64rpx;
  293. }
  294. &-res {
  295. height: 78rpx;
  296. margin: 20rpx 0 6rpx;
  297. font-family: PingFang SC, PingFang SC;
  298. font-weight: 600;
  299. font-size: 48rpx;
  300. color: #333333;
  301. }
  302. &-time {
  303. font-weight: 400;
  304. font-size: 22rpx;
  305. color: #999999;
  306. }
  307. }
  308. .cardbox {
  309. display: flex;
  310. flex-direction: row;
  311. align-items: center;
  312. justify-content: space-between;
  313. flex-wrap: wrap;
  314. gap: 16rpx 14rpx;
  315. &-maintitle {
  316. margin-bottom: 4rpx;
  317. font-weight: 600;
  318. font-size: 30rpx;
  319. color: #333333;
  320. }
  321. }
  322. .health-item {
  323. width: 343rpx;
  324. height: 224rpx;
  325. padding: 24rpx;
  326. box-sizing: border-box;
  327. background: #FFFFFF;
  328. border-radius: 16rpx 16rpx 16rpx 16rpx;
  329. overflow: hidden;
  330. position: relative;
  331. font-family: PingFang SC, PingFang SC;
  332. font-weight: 400;
  333. font-size: 24rpx;
  334. color: #999999;
  335. }
  336. .health-item-info {
  337. position: relative;
  338. }
  339. .health-bgicon {
  340. position: absolute;
  341. right: 0;
  342. bottom: 0;
  343. width: 168rpx;
  344. height: 168rpx;
  345. }
  346. </style>