healthWeekReport.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. <template>
  2. <view class="container">
  3. <uni-nav-bar fixed :border="false" :backgroundColor="`rgba(255, 235, 220,${opacity})`" title="健康周报"
  4. :statusBar="true" left-icon="left" @clickLeft="$navBack()"></uni-nav-bar>
  5. <image class="page-bg" src="@/static/images/pages_watch/images/zb_home_top_bg.png" mode="widthFix"></image>
  6. <view class="container-body">
  7. <view class="user">
  8. <view class="echartbox">
  9. <view class="userinfo x-bc">
  10. <image class="userinfo-avatar"
  11. :src="$isEmpty(reportUser.avatar) ? avatar : reportUser.avatar"
  12. mode="aspectFill"></image>
  13. <view class="userinfo-score">{{healthReport.title || '--'}}</view>
  14. <view class="userinfo-time" @click="chooseDate">{{$timeFormat(dayList[0], 'mm.dd')}} - {{$timeFormat(dayList[6], 'mm.dd')}}</view>
  15. </view>
  16. <view class="userinfo-footer x-c">
  17. <view>0</view>
  18. <view class="userinfo-footer-cen">健康指数</view>
  19. <view>100</view>
  20. </view>
  21. <qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
  22. </view>
  23. </view>
  24. <view class="userinfo-list x-bc">
  25. <view class="userinfo-item x-bc">
  26. <view>
  27. <view>身高</view>
  28. <view style="margin-top: 8rpx;"><text class="num">{{reportUser.height || '--'}}</text>cm</view>
  29. </view>
  30. <image src="@/static/images/pages_watch/icons/height_icon.png" mode="aspectFill"></image>
  31. </view>
  32. <view class="userinfo-item x-bc">
  33. <view>
  34. <view>体重</view>
  35. <view style="margin-top: 8rpx;"><text class="num">{{reportUser.weight || '--'}}</text>kg</view>
  36. </view>
  37. <image src="@/static/images/pages_watch/icons/weight_icon.png" mode="aspectFill"></image>
  38. </view>
  39. </view>
  40. <view class="userinfo-list x-bc">
  41. <view class="userinfo-item x-bc">
  42. <view>
  43. <view>BMI</view>
  44. <view style="margin-top: 8rpx;"><text class="num">{{_BMI}}</text></view>
  45. </view>
  46. <image src="@/static/images/pages_watch/icons/bmi_icon.png" mode="aspectFill"></image>
  47. </view>
  48. <view class="userinfo-item x-bc">
  49. <view>
  50. <view>卡路里</view>
  51. <view style="margin-top: 8rpx;"><text class="num">{{healthInfo.calorie || 0}}</text>kcal</view>
  52. </view>
  53. <image src="@/static/images/pages_watch/icons/calorie_icon.png" mode="aspectFill"></image>
  54. </view>
  55. </view>
  56. <view class="userinfo-list x-bc">
  57. <view class="userinfo-item x-bc">
  58. <view>
  59. <view>步数</view>
  60. <view style="margin-top: 8rpx;"><text class="num">{{healthInfo.step || 0}}</text>步</view>
  61. </view>
  62. <image src="@/static/images/pages_watch/icons/height_icon.png" mode="aspectFill"></image>
  63. </view>
  64. <view class="userinfo-item x-bc">
  65. <view>
  66. <view>睡眠</view>
  67. <view style="margin-top: 8rpx;"><text class="txt">{{healthInfo.sleepStatus || '--'}}</text>
  68. </view>
  69. </view>
  70. <image src="@/static/images/pages_watch/icons/sleep_icon28.png" mode="aspectFill"></image>
  71. </view>
  72. </view>
  73. <view class="userinfo-tips" v-show="healthReport.desc">{{healthReport.desc}}</view>
  74. <view class="box-title">健康数据</view>
  75. <view class="reportbox">
  76. <bpChart ref="bpChart" :loading="bpLoading"
  77. :boxstyle="{padding: 0,marginTop: '32rpx',marginBottom: '32rpx'}" />
  78. <!-- <view class="tipsbox">
  79. 该月血压整体偏高,应多注意休息,合理安排作息,吃降压药等其它降压手段保持血压正常。
  80. </view> -->
  81. <bsChart ref="bsChart" :loading="bsLoading"
  82. :boxstyle="{padding: 0,marginTop: '32rpx',marginBottom: '32rpx'}" />
  83. <!-- <view class="tipsbox">
  84. 该月血糖整体偏高,应多注意休息,合理安排作息,吃降糖药等其它手段保持血糖正常。
  85. </view> -->
  86. <heartChart ref="heartChart" :loading="heartLoading"
  87. :boxstyle="{padding: 0,marginTop: '32rpx',marginBottom: '32rpx'}" />
  88. <!-- <view class="tipsbox">
  89. 该月心率多次出现异常,应多注意休息,合理安排作息,吃养心药等其它手段保持心率正常。
  90. </view> -->
  91. <boChart ref="boChart" :loading="boLoading"
  92. :boxstyle="{padding: 0,marginTop: '32rpx',marginBottom: '32rpx'}" />
  93. <!-- <view class="tipsbox">
  94. 血氧各项指标正常,请多保持!!!
  95. </view> -->
  96. <sleep ref="sleep" :loading="sleepLoading"
  97. :boxstyle="{padding: 0,marginTop: '32rpx',marginBottom: '32rpx'}" />
  98. <!-- <view class="tipsbox">
  99. 您的睡眠质量较好,打败了80%的人,请继续保持,好的睡眠才是养好身体的关键。
  100. </view> -->
  101. </view>
  102. <view class="box-title">健康档案</view>
  103. <view class="healthinfo">
  104. <view class="healthinfo-title x-f" style="color: #FF5558;">
  105. <image src="@/static/images/pages_watch/icons/prediction_icon.png" mode="aspectFill"></image>
  106. <text>健康预测</text>
  107. </view>
  108. <view class="tipsbox healthinfo-tip1" v-for="(it,i) in predictionsList" :key="i">{{it}}</view>
  109. <view class="healthinfo-title x-f" style="color: #52D087;">
  110. <image src="@/static/images/pages_watch/icons/analysis_icon.png" mode="aspectFill"></image>
  111. <text>解析</text>
  112. </view>
  113. <view class="tipsbox healthinfo-tip2" v-for="(it,i) in analysisList" :key="i">{{it}}</view>
  114. <view class="healthinfo-title x-f" style="color: #55AEFE;">
  115. <image src="@/static/images/pages_watch/icons/treatment_icon.png" mode="aspectFill"></image>
  116. <text>养生建议</text>
  117. </view>
  118. <view class="tipsbox healthinfo-tip3" v-for="(it,i) in suggestionsList" :key="i">{{it}}</view>
  119. <view class="healthinfo-title x-f" style="color: #FD9961;">
  120. <image src="@/static/images/pages_watch/icons/precautions_icon.png" mode="aspectFill"></image>
  121. <text>注意事项</text>
  122. </view>
  123. <view class="tipsbox healthinfo-tip4" v-for="(it,i) in precautionsList" :key="i">{{it}}</view>
  124. </view>
  125. <!-- <view class="box-title">家医团队建议</view>
  126. <view class="healthinfo">
  127. </view> -->
  128. <template v-if="tongueDateList&&tongueDateList.length>0">
  129. <view class="box-title">AI舌诊</view>
  130. <scroll-view scroll-x="true" class="dayitem-scroll" :scroll-into-view="scrollIntoView"
  131. :scroll-with-animation="true">
  132. <view :class="current == index ? 'dayitem x-ac active' :'dayitem x-ac'" :id="'dayitem'+ index"
  133. v-for="(item,index) in tongueDateList" @click="handleDay(index)">
  134. {{item.substring(5,10)}}
  135. </view>
  136. </scroll-view>
  137. <view>
  138. <view class="report-info" v-if="dataList&&dataList.length>0">
  139. <view class="report-time">检测时间 {{dataList[0].createTime}}</view>
  140. <view class="report-info-restit">您属于</view>
  141. <view class="report-info-res">{{dataList[0].typeName}}</view>
  142. <!-- 舌苔特征 -->
  143. <view class="report-title">舌苔特征</view>
  144. <view class="report-box">
  145. <view class="report-info-item">
  146. <view class="item-round"></view>
  147. <view>
  148. <text class="item-title">{{dataList[0].taiseName}}</text>
  149. <view>{{dataList[0].taiseDesc}}</view>
  150. </view>
  151. </view>
  152. <view class="report-info-item">
  153. <view class="item-round"></view>
  154. <view>
  155. <text class="item-title">{{dataList[0].shemianName}}:</text>
  156. <text>{{dataList[0].shemianDesc}}</text>
  157. </view>
  158. </view>
  159. <view class="report-info-item">
  160. <view class="item-round"></view>
  161. <view>
  162. <text class="item-title">{{dataList[0].botai==1?"有剥苔":"未见剥苔"}}:</text>
  163. <text>{{dataList[0].botaiDesc}}</text>
  164. </view>
  165. </view>
  166. <view class="report-info-item">
  167. <view class="item-round"></view>
  168. <view>
  169. <text class="item-title">{{dataList[0].liewen==1?"有裂纹":"未见裂纹"}}:</text>
  170. <text>{{dataList[0].liewenDesc}}</text>
  171. </view>
  172. </view>
  173. <view class="report-info-item">
  174. <view class="item-round"></view>
  175. <view>
  176. <text class="item-title">{{dataList[0].chihen==1?"有齿痕":"未见齿痕"}}:</text>
  177. <text>{{dataList[0].chihenDesc}}</text>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 体质解析 -->
  182. <view class="report-title">体质解析</view>
  183. <view class="report-box">
  184. <view class="report-info-item" v-for="(item) in typeList">
  185. <view class="item-round"></view>
  186. <view>
  187. <text class="item-title">{{item.name}}:</text>
  188. <text>{{item.value}}</text>
  189. </view>
  190. </view>
  191. </view>
  192. </view>
  193. <view class="no-data-box" v-if="dataList&&dataList.length==0 && !tongueLoading">
  194. <image src="https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png">
  195. </image>
  196. <view class="empty-title">暂无数据</view>
  197. </view>
  198. <u-loading-icon style="margin-top: 50rpx;margin-bottom: 100rpx;" v-if="tongueLoading" text="加载中"
  199. textSize="15"></u-loading-icon>
  200. </view>
  201. </template>
  202. </view>
  203. <!-- #ifdef APP-PLUS --><!-- #endif -->
  204. <view class="footerbox x-ac">
  205. <view class="footerbox-btn x-ac" @click="goShare">分享健康周报</view>
  206. </view>
  207. <!-- 分享弹窗 -->
  208. <u-popup :show="showShare" @close="showShare = false">
  209. <share-box :shareItem="shareItem" @closeShare='showShare = false'></share-box>
  210. </u-popup>
  211. <h5-down-app-tip :pageUrl="pageUrl" />
  212. <uni-popup type="bottom"ref="calendar">
  213. <view class="pop-calendar">
  214. <uni-calendar :clear-date="true" :date="date" :insert="true" :lunar="false"
  215. :startDate="$u.timeFormat(new Date().getTime() - (3600 * 24 * 365 * 1000), 'yyyy-mm-dd')" :range='false'
  216. @change="change" :endDate="$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd')" />
  217. </view>
  218. </uni-popup>
  219. </view>
  220. </template>
  221. <script>
  222. import {
  223. bpInfo,
  224. bgInfo,
  225. heartRateInfo,
  226. spInfo,
  227. sleepInfo
  228. } from "@/api/pages_watch/healthMonitoring.js";
  229. import {
  230. getUserByDeviceId,
  231. getUserHealthInfoByDeviceId,
  232. queryHealthReport
  233. } from "@/api/pages_watch/health.js";
  234. import bpChart from "@/pages_watch/components/echart/bpChart.vue"; // 血压
  235. import bsChart from "@/pages_watch/components/echart/bsChart.vue"; // 血糖
  236. import heartChart from "@/pages_watch/components/echart/heartChart.vue"; // 心率
  237. import boChart from "@/pages_watch/components/echart/boChart.vue"; // 血氧
  238. import sleep from "@/pages_watch/components/echart/sleep.vue"; // 睡眠
  239. import {
  240. getHealthTongueList
  241. } from '@/api/healthTongue.js'
  242. const avatar = "/static/images/pages_watch/images/my_heads_icon.png";
  243. export default {
  244. components: {
  245. bpChart,
  246. bsChart,
  247. heartChart,
  248. boChart,
  249. sleep,
  250. },
  251. data() {
  252. return {
  253. opacity: 1,
  254. showShare: false,
  255. shareItem: {
  256. imageUrl: "",
  257. title: "",
  258. path: "",
  259. isMini: true,
  260. selectUser: 0
  261. },
  262. pageUrl: '',
  263. avatar,
  264. deviceId: uni.getStorageSync("deviceId") || '',
  265. reportUser: {},
  266. bpLoading: false,
  267. bsLoading: false,
  268. heartLoading: false,
  269. boLoading: false,
  270. sleepLoading: false,
  271. isFamily: false,
  272. item: {},
  273. typeList: [],
  274. scrollIntoView: 'dayitem0',
  275. dayList: [],
  276. current: 0,
  277. chartData: {
  278. series: [{
  279. name: "",
  280. color: "#FFA750",
  281. data: 0.3
  282. }]
  283. },
  284. opts: {
  285. padding: undefined,
  286. title: {
  287. name: ""
  288. },
  289. subtitle: {
  290. name: "",
  291. },
  292. extra: {
  293. arcbar: {
  294. type: "default",
  295. width: 12,
  296. backgroundColor: "#FFE4C7",
  297. startAngle: 0.75,
  298. endAngle: 0.25,
  299. gap: 2,
  300. linearType: "custom",
  301. customColor: ["#FFA750", "#FFA651"]
  302. }
  303. }
  304. },
  305. healthInfo: {},
  306. healthReport: {},
  307. analysisList: [],
  308. precautionsList: [],
  309. predictionsList: [],
  310. suggestionsList: [],
  311. dataList: [],
  312. tongueLoading: true,
  313. userId: '',
  314. isShare: 0,
  315. tongueDateList: [],
  316. date: '',
  317. }
  318. },
  319. computed: {
  320. _BMI() {
  321. if (this.reportUser.height && this.reportUser.weight) {
  322. const height = this.reportUser.height / 100;
  323. const weight = this.reportUser.weight;
  324. const bmi = weight / (height * height);
  325. const roundedBMI = bmi.toFixed(2);
  326. let category = '';
  327. if (bmi < 18.5) {
  328. category = "过轻";
  329. } else if (bmi >= 18.5 && bmi < 24.9) { // 注意:当 bmi = 24.9 时会进入下一级判断
  330. category = "正常";
  331. } else if (bmi >= 24.9 && bmi < 29.9) {
  332. category = "过重";
  333. } else {
  334. category = "肥胖";
  335. }
  336. return category;
  337. } else {
  338. return '--'
  339. }
  340. }
  341. },
  342. onLoad(option) {
  343. this.shareItem.selectUser = option.selectUser
  344. this.isFamily = option.selectUser != '0'
  345. this.isShare = option.isShare || 0
  346. this.getPageUrl(option)
  347. if (this.isShare == 1) {
  348. this.userId = option.userId || ''
  349. this.deviceId = option.deviceId || ''
  350. } else {
  351. const user = this.$getUserInfo()
  352. console.log("user==",user)
  353. this.userId = user.userId || ''
  354. }
  355. if (!this.deviceId) {
  356. uni.showToast({
  357. title: '请先绑定设备'
  358. })
  359. return
  360. }
  361. if(!this.$isLogin()) {
  362. this.$showLoginPage()
  363. }
  364. this.getReportUser()
  365. this.initData()
  366. },
  367. onPageScroll(e) {
  368. if (e.scrollTop <= 44) {
  369. this.opacity = e.scrollTop / 44 * 1
  370. } else if (e.scrollTop > 44) {
  371. this.opacity = 1
  372. }
  373. },
  374. methods: {
  375. getPageUrl(options) {
  376. if (options && JSON.stringify(options) != '{}') {
  377. this.pageUrl = '/pages_watch/health/healthWeekReport' + uni.$u.queryParams(options)
  378. } else {
  379. this.pageUrl = '/pages_watch/health/healthWeekReport'
  380. }
  381. },
  382. handleDay(index) {
  383. this.scrollIntoView = 'dayitem' + index
  384. this.current = index
  385. this.getHealthTongueList()
  386. },
  387. goShare() {
  388. //#ifdef APP-PLUS
  389. this.shareItem.title = '健康周报';
  390. this.shareItem.imageUrl = "/static/logo.png";
  391. this.shareItem.isMini = false;
  392. this.shareItem.path = '/pages_watch/health/healthWeekReport?isShare=1&userId=' + this.userId +
  393. '&deviceId=' + this.deviceId + '&selectUser=' + this.shareItem.selectUser;
  394. let cdn = uni.getStorageSync('h5Path');
  395. this.shareItem.url = cdn + this.shareItem.path;
  396. this.showShare = true;
  397. //#endif
  398. },
  399. handleList() {
  400. uni.navigateTo({
  401. url: "/pages_watch/health/healthReportHistory"
  402. })
  403. },
  404. initData(day) {
  405. const val = this.getLastWeekRange(1, day)
  406. this.dayList = this.getLastWeekRange(0, day)
  407. const param = {
  408. startTime: val[0],
  409. endTime: val[1].split(' ')[0] + ' 23:59:59',
  410. deviceId: this.deviceId,
  411. userId: this.userId,
  412. isFamily: this.isFamily,
  413. }
  414. this.$nextTick(() => {
  415. this.getUserHealthInfo(param)
  416. this.getHealthReport(param)
  417. this.getBpByDate(param)
  418. this.getBgByDate(param)
  419. this.getHrByDate(param)
  420. this.getSpByDate(param)
  421. this.getSleepByDate(param)
  422. })
  423. },
  424. getUserHealthInfo(param) {
  425. uni.showLoading({
  426. title: '加载中'
  427. })
  428. getUserHealthInfoByDeviceId(param).then(res => {
  429. uni.hideLoading()
  430. if (res.code == 200) {
  431. this.healthInfo = res.data || {}
  432. this.tongueDateList = this.healthInfo.tongueDateList || []
  433. if (this.tongueDateList && this.tongueDateList.length > 0) {
  434. this.handleDay(0)
  435. } else {
  436. this.dataList = []
  437. }
  438. }
  439. }).catch(() => {
  440. uni.hideLoading()
  441. })
  442. },
  443. getHealthReport(param) {
  444. uni.showLoading({
  445. title: '加载中'
  446. })
  447. queryHealthReport(param).then(res => {
  448. uni.hideLoading()
  449. if (res.code == 200) {
  450. this.healthReport = res.data || {};
  451. this.chartData.series[0].data = res.data && res.data.score ? res.data.score / 100 : 0;
  452. if (res.data && res.data.list && res.data.list.length > 0) {
  453. let groupedData = this.groupHealthData(res.data.list);
  454. this.analysisList = groupedData.analyses
  455. this.precautionsList = groupedData.precautions
  456. this.predictionsList = groupedData.predictions
  457. this.suggestionsList = groupedData.suggestions
  458. } else {
  459. this.analysisList = []
  460. this.precautionsList = []
  461. this.predictionsList = []
  462. this.suggestionsList = []
  463. }
  464. }
  465. }).catch(() => {
  466. uni.hideLoading()
  467. })
  468. },
  469. groupHealthData(list) {
  470. return list.reduce((groups, item) => {
  471. groups.predictions.push(item.prediction);
  472. groups.analyses.push(item.analysis);
  473. groups.suggestions.push(item.suggestion);
  474. groups.precautions.push(item.precautions);
  475. return groups;
  476. }, {
  477. predictions: [],
  478. analyses: [],
  479. suggestions: [],
  480. precautions: []
  481. });
  482. },
  483. getReportUser() {
  484. const param = {
  485. deviceId: this.deviceId,
  486. isFamily: this.isFamily,
  487. userId: this.userId,
  488. }
  489. getUserByDeviceId(param).then((res) => {
  490. this.reportUser = this.$isEmpty(res.data) ? {} : res.data
  491. })
  492. },
  493. // 获取本周到当天的数据
  494. getLastWeekRange(type, day) {
  495. const today = day ? new Date(day) : new Date();
  496. today.setHours(0, 0, 0, 0); // 清除时间
  497. // 计算当前周的周一
  498. const currentMonday = new Date(today);
  499. currentMonday.setDate(today.getDate() - (today.getDay() === 0 ? 6 : today.getDay() - 1));
  500. // 如果没有传入day参数,则计算前一周的周一和周日
  501. const lastWeekMonday = day ? currentMonday : new Date(currentMonday);
  502. lastWeekMonday.setDate(currentMonday.getDate() - (day ? 0 : 7));
  503. // 计算前一周的周日
  504. const lastWeekSunday = new Date(lastWeekMonday);
  505. lastWeekSunday.setDate(lastWeekMonday.getDate() + 6);
  506. // 生成日期范围
  507. const dates = [];
  508. let currentDate = new Date(lastWeekMonday);
  509. while (currentDate <= lastWeekSunday) {
  510. const y = currentDate.getFullYear();
  511. const m = String(currentDate.getMonth() + 1).padStart(2, '0');
  512. const d = String(currentDate.getDate()).padStart(2, '0');
  513. dates.push(`${y}/${m}/${d} 00:00:00`);
  514. currentDate.setDate(currentDate.getDate() + 1);
  515. }
  516. if (type == 1) {
  517. const startTime = dates[0];
  518. const endTime = dates[dates.length - 1];
  519. return [startTime, endTime];
  520. } else {
  521. return dates;
  522. }
  523. },
  524. // 血压
  525. getBpByDate(param) {
  526. this.bpLoading = true
  527. bpInfo(param).then((res) => {
  528. this.bpLoading = false
  529. this.$refs.bpChart.setChartData(res.data)
  530. }).catch((err) => {
  531. this.bpLoading = false
  532. });
  533. },
  534. // 血糖
  535. getBgByDate(param) {
  536. this.bsLoading = true
  537. bgInfo(param).then((res) => {
  538. this.bsLoading = false
  539. this.$refs.bsChart.setChartData(res.data)
  540. }).catch((err) => {
  541. this.bsLoading = false
  542. });
  543. },
  544. // 心率
  545. getHrByDate(param) {
  546. this.heartLoading = true
  547. heartRateInfo(param).then((res) => {
  548. this.heartLoading = false
  549. this.$refs.heartChart.setChartData(res.data)
  550. }).catch((err) => {
  551. this.heartLoading = false
  552. });
  553. },
  554. // 血氧
  555. getSpByDate(param) {
  556. this.boLoading = true
  557. spInfo(param).then((res) => {
  558. this.boLoading = false
  559. this.$refs.boChart.setChartData(res.data)
  560. }).catch((err) => {
  561. this.boLoading = false
  562. });
  563. },
  564. // 睡眠
  565. getSleepByDate(param) {
  566. this.sleepLoading = true
  567. sleepInfo(param).then((res) => {
  568. this.sleepLoading = false
  569. this.$refs.sleep.setChartData(res.data)
  570. }).catch((err) => {
  571. this.sleepLoading = false
  572. });
  573. },
  574. // 舌诊
  575. getHealthTongueList() {
  576. let that = this;
  577. let data = {
  578. pageNum: 1,
  579. pageSize: 1,
  580. createDay: this.tongueDateList[this.current],
  581. deviceId: this.deviceId,
  582. userId: this.userId,
  583. isFamily: this.isFamily,
  584. };
  585. this.tongueLoading = true
  586. getHealthTongueList(data).then(res => {
  587. that.tongueLoading = false
  588. if (res.code == 200) {
  589. //设置列表数据
  590. that.dataList = res.data.list || [];
  591. if (that.dataList.length > 0) {
  592. const jsoninfo = JSON.parse(that.dataList[0].typeJson)
  593. let index = jsoninfo.findIndex(item => item.name === '用药调治');
  594. // #ifdef H5
  595. if (index > -1) {
  596. that.typeList = jsoninfo.splice(0, index)
  597. } else {
  598. that.typeList = jsoninfo
  599. }
  600. // #endif
  601. // #ifndef H5
  602. that.typeList = jsoninfo
  603. // #endif
  604. } else {
  605. that.typeList = []
  606. }
  607. } else {
  608. uni.showToast({
  609. icon: 'none',
  610. title: "请求失败",
  611. });
  612. that.dataList = []
  613. that.typeList = []
  614. }
  615. }).catch(() => {
  616. that.tongueLoading = false
  617. });
  618. },
  619. chooseDate() {
  620. this.$refs.calendar.open()
  621. },
  622. change(e) {
  623. this.date = e.fulldate
  624. this.initData(e.fulldate)
  625. this.$refs.calendar.close()
  626. }
  627. }
  628. }
  629. </script>
  630. <style lang="scss" scoped>
  631. @mixin u-flex($flexD, $alignI, $justifyC) {
  632. display: flex;
  633. flex-direction: $flexD;
  634. align-items: $alignI;
  635. justify-content: $justifyC;
  636. }
  637. .container {
  638. padding: 0 24rpx;
  639. position: relative;
  640. }
  641. .page-bg {
  642. width: 100%;
  643. height: auto;
  644. position: absolute;
  645. top: 0;
  646. left: 0;
  647. }
  648. .container-body {
  649. position: relative;
  650. z-index: 1;
  651. padding-bottom: calc(var(--window-bottom) + 154rpx);
  652. }
  653. .user {
  654. padding: 32rpx 0 60rpx 0;
  655. @include u-flex(row, center, center);
  656. .echartbox {
  657. width: 400rpx;
  658. height: 400rpx;
  659. position: relative;
  660. }
  661. .userinfo {
  662. position: absolute;
  663. left: 50%;
  664. top: 50%;
  665. z-index: 99;
  666. width: 290rpx;
  667. height: 290rpx;
  668. transform: translate(-50%, -50%);
  669. background-color: #fff;
  670. border-radius: 50%;
  671. flex-direction: column !important;
  672. padding: 30rpx 0 40rpx 0;
  673. box-sizing: border-box;
  674. box-shadow: 0 -8rpx 12rpx 0 rgba(255, 228, 199, 0.8);
  675. }
  676. .userinfo-avatar {
  677. width: 80rpx;
  678. height: 80rpx;
  679. border-radius: 50%;
  680. }
  681. .userinfo-score {
  682. font-family: PingFang SC, PingFang SC;
  683. font-weight: 600;
  684. font-size: 64rpx;
  685. color: #FF5C03;
  686. }
  687. .userinfo-time {
  688. font-family: Helvetica, Helvetica;
  689. font-weight: 400;
  690. font-size: 24rpx;
  691. color: #999999;
  692. }
  693. .userinfo-footer {
  694. font-family: Helvetica, Helvetica;
  695. font-weight: 400;
  696. font-size: 28rpx;
  697. color: #FFA750;
  698. width: 100%;
  699. position: absolute;
  700. left: 50%;
  701. bottom: 0;
  702. z-index: 99;
  703. transform: translateX(-50%);
  704. &-cen {
  705. margin: 0 30rpx;
  706. font-family: PingFang SC, PingFang SC;
  707. font-weight: 500;
  708. font-size: 28rpx;
  709. color: #FF5C03;
  710. }
  711. }
  712. }
  713. .userinfo-list {
  714. margin: 0 -16rpx 0 0;
  715. .userinfo-item {
  716. flex: 1;
  717. min-height: 136rpx;
  718. padding: 24rpx;
  719. box-sizing: border-box;
  720. margin: 0 16rpx 16rpx 0;
  721. background: #FFFFFF;
  722. border-radius: 16rpx 16rpx 16rpx 16rpx;
  723. font-family: PingFang SC;
  724. font-weight: 400;
  725. font-size: 24rpx;
  726. color: #757575;
  727. image {
  728. width: 56rpx;
  729. height: 56rpx;
  730. }
  731. .num {
  732. font-family: DIN, DIN;
  733. font-weight: 500;
  734. font-size: 40rpx;
  735. color: #333333;
  736. margin-right: 10rpx;
  737. }
  738. .txt {
  739. font-family: PingFang SC;
  740. font-weight: 500;
  741. font-size: 36rpx;
  742. color: #333333;
  743. }
  744. }
  745. }
  746. .userinfo-tips {
  747. font-family: PingFang SC;
  748. font-weight: 400;
  749. font-size: 26rpx;
  750. color: #FF5C03;
  751. padding: 28rpx;
  752. background: #FFFFFF;
  753. border-radius: 16rpx 16rpx 16rpx 16rpx;
  754. }
  755. .box-title {
  756. padding: 35rpx 0;
  757. font-family: PingFang SC;
  758. font-weight: 500;
  759. font-size: 36rpx;
  760. color: #222222;
  761. }
  762. .reportbox {
  763. background-color: #fff;
  764. padding: 1rpx 24rpx;
  765. border-radius: 16rpx;
  766. ::v-deep .pickebox-picker {
  767. margin: 0 !important;
  768. }
  769. }
  770. .tipsbox {
  771. margin: 10rpx 0;
  772. padding: 24rpx;
  773. background: #F5F7FA;
  774. border-radius: 16rpx 16rpx 16rpx 16rpx;
  775. border: 2rpx solid #F5F7FA;
  776. font-family: PingFang SC;
  777. font-weight: 400;
  778. font-size: 26rpx;
  779. color: #333333;
  780. word-break: break-all;
  781. }
  782. .healthinfo {
  783. padding: 0 24rpx 24rpx 24rpx;
  784. background: #FFFFFF;
  785. border-radius: 16rpx 16rpx 16rpx 16rpx;
  786. font-family: PingFang SC, PingFang SC;
  787. font-weight: 400;
  788. font-size: 26rpx;
  789. color: #333333;
  790. &-title {
  791. padding: 24rpx 0 20rpx;
  792. font-family: PingFang SC, PingFang SC;
  793. font-weight: 500;
  794. font-size: 32rpx;
  795. image {
  796. width: 32rpx;
  797. height: 32rpx;
  798. margin-right: 16rpx;
  799. }
  800. }
  801. &-tip1 {
  802. background: #FFFCFC !important;
  803. border-radius: 16rpx 16rpx 16rpx 16rpx;
  804. border: 2rpx solid #FCF4F4;
  805. }
  806. &-tip2 {
  807. background: #FAFFFC !important;
  808. border-radius: 16rpx 16rpx 16rpx 16rpx;
  809. border: 2rpx solid #EBFFF3;
  810. }
  811. &-tip3 {
  812. background: #FAFCFF !important;
  813. border-radius: 16rpx 16rpx 16rpx 16rpx;
  814. border: 2rpx solid #F6FAFF;
  815. }
  816. &-tip4 {
  817. background: #FEFAF8 !important;
  818. border-radius: 16rpx 16rpx 16rpx 16rpx;
  819. border: 2rpx solid #FDF7F3;
  820. }
  821. }
  822. .report {
  823. &-box {
  824. padding: 24rpx;
  825. background: #F5F7FA;
  826. border-radius: 16rpx 16rpx 16rpx 16rpx;
  827. }
  828. &-info {
  829. padding: 34rpx 40rpx;
  830. box-sizing: border-box;
  831. background: #FFFFFF;
  832. border-radius: 16rpx;
  833. font-family: PingFang SC, PingFang SC;
  834. font-weight: 400;
  835. font-size: 24rpx;
  836. color: #333333;
  837. &-restit {
  838. margin: 24rpx 0 20rpx 0;
  839. font-family: PingFang SC, PingFang SC;
  840. font-weight: 400;
  841. font-size: 28rpx;
  842. color: #757575;
  843. text-align: center;
  844. }
  845. &-res {
  846. padding-bottom: 10rpx;
  847. font-family: PingFang SC, PingFang SC;
  848. font-weight: 600;
  849. font-size: 48rpx;
  850. color: #FF5C03;
  851. text-align: center;
  852. }
  853. &-item {
  854. margin-bottom: 30rpx;
  855. display: flex;
  856. align-items: baseline;
  857. font-family: SourceHanSansCN-Regular;
  858. font-size: 27rpx;
  859. color: #414141;
  860. line-height: 36rpx;
  861. word-break: break-all;
  862. .item-title {
  863. font-family: SourceHanSansCN-Bold;
  864. font-weight: bold;
  865. font-size: 27rpx;
  866. color: #414141;
  867. }
  868. }
  869. }
  870. &-time {
  871. font-family: PingFang SC, PingFang SC;
  872. font-weight: 400;
  873. font-size: 24rpx;
  874. color: #999999;
  875. text-align: center;
  876. }
  877. &-title {
  878. margin: 24rpx 0;
  879. padding-left: 14rpx;
  880. font-family: PingFang SC, PingFang SC;
  881. font-weight: 500;
  882. font-size: 32rpx;
  883. color: #FF5C03;
  884. position: relative;
  885. line-height: 32rpx;
  886. &::after {
  887. content: "";
  888. width: 6rpx;
  889. height: 100%;
  890. background: #FF5C03;
  891. border-radius: 3rpx 3rpx 3rpx 3rpx;
  892. position: absolute;
  893. top: 0;
  894. left: 0;
  895. }
  896. }
  897. }
  898. .item-title {
  899. display: block;
  900. padding-bottom: 10rpx;
  901. font-weight: 500;
  902. font-size: 28rpx;
  903. color: #222222;
  904. }
  905. .item-round {
  906. flex-shrink: 0;
  907. width: 16rpx;
  908. height: 16rpx;
  909. background: #FF5C03;
  910. margin-right: 12rpx;
  911. border-radius: 50%;
  912. }
  913. .dayitem-scroll {
  914. white-space: nowrap;
  915. margin-bottom: 24rpx;
  916. }
  917. .dayitem {
  918. width: 98rpx;
  919. min-height: 88rpx;
  920. background: #FFFFFF;
  921. border-radius: 16rpx 16rpx 16rpx 16rpx;
  922. font-family: PingFang SC, PingFang SC;
  923. font-weight: 400;
  924. font-size: 24rpx;
  925. color: #757575;
  926. display: inline-flex;
  927. margin-right: 12rpx;
  928. }
  929. .active {
  930. background: #FF5C03;
  931. color: #fff;
  932. }
  933. .footerbox {
  934. width: 100%;
  935. padding: 20rpx 24rpx;
  936. padding-bottom: calc(var(--window-bottom) + 20rpx);
  937. background-color: #fff;
  938. position: fixed;
  939. bottom: 0;
  940. left: 0;
  941. z-index: 9;
  942. &-btn {
  943. width: 702rpx;
  944. height: 96rpx;
  945. background: #FF5C03;
  946. border-radius: 16rpx 16rpx 16rpx 16rpx;
  947. font-family: PingFang SC, PingFang SC;
  948. font-weight: 600;
  949. font-size: 36rpx;
  950. color: #FFFFFF;
  951. }
  952. }
  953. .pop-calendar {
  954. width: 100%;
  955. }
  956. </style>