healthReport.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <template>
  2. <view class="content">
  3. <!-- 个人信息 -->
  4. <view :style="{height:statusBarHeight}"></view>
  5. <view class="top-box" >
  6. <view class="back-box x-f">
  7. <image src="/static/image/device/back_icon32.png"></image>
  8. <view @click="goBack()">返回</view>
  9. </view>
  10. <view class="tab-box">
  11. 健康报告
  12. </view>
  13. <!-- <view :style="{width: width < height ?'18px':'102px'}"></view> -->
  14. </view>
  15. <view class="user-info">
  16. <view class="info-box">
  17. <view class="left">
  18. <view class="head-box">
  19. <image class="img" src="@/static/images/pages_watch/images/my_heads_icon.png" mode="aspectFill">
  20. </image>
  21. </view>
  22. <view class="info">
  23. <text class="name one-t">{{userInfo.username}}</text>
  24. <div class="info-top">
  25. <text class="sex">性别:{{userInfo.sex==1?'男':userInfo.sex==0?'女':'-'}}</text>
  26. <text>年龄:{{userInfo.age|| '-'}}岁</text>
  27. </div>
  28. <div class="phone">
  29. 手机号:{{userInfo.phone|| '-'}}
  30. </div>
  31. </view>
  32. </view>
  33. <!-- <image class="right" src="@/static/image/my/icon_edit.png" mode="aspectFill" @click="editInfo"></image> -->
  34. </view>
  35. <view class="userinfo-list x-bc">
  36. <view class="userinfo-item x-bc">
  37. <view>
  38. <view>身高</view>
  39. <view style="margin-top: 8rpx;"><text class="num">{{userInfo.height || '--'}}</text>cm</view>
  40. </view>
  41. <image src="@/static/images/pages_watch/icons/height_icon.png" mode="aspectFill"></image>
  42. </view>
  43. <view class="userinfo-item x-bc">
  44. <view>
  45. <view>体重</view>
  46. <view style="margin-top: 8rpx;"><text class="num">{{userInfo.weight || '--'}}</text>kg</view>
  47. </view>
  48. <image src="@/static/images/pages_watch/icons/weight_icon.png" mode="aspectFill"></image>
  49. </view>
  50. </view>
  51. <view class="userinfo-list x-bc">
  52. <view class="userinfo-item">
  53. <view>
  54. <view>既往病史</view>
  55. <view style="margin-top: 8rpx;height: 80rpx;" class="two-t"><text
  56. class="txt">{{userInfo.previousMedicalHistory|| '--'}}</text></view>
  57. </view>
  58. <!-- <image src="@/static/images/pages_watch/icons/weight_icon.png" mode="aspectFill"></image> -->
  59. </view>
  60. <view class="userinfo-item">
  61. <view>
  62. <view>过敏史</view>
  63. <view style="margin-top: 8rpx;height: 80rpx;" class="two-t"><text
  64. class="txt">{{userInfo.historyOfAllergies|| '--'}}</text></view>
  65. </view>
  66. <!-- <image src="@/static/image/healthRecords/gms_icon.png" mode="aspectFill"></image> -->
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 详细信息 -->
  71. <view class="info-detail">
  72. <view class="item">
  73. <view class="x-bc">
  74. <text class="label">舌诊</text>
  75. <text class="time">{{infoTongue.createTime||'-'}}</text>
  76. </view>
  77. <view class="content" v-if="infoTongue">
  78. <view class="desc">
  79. {{infoTongue.taiseName||'无'}}:{{infoTongue.taiseDesc||'-'}}
  80. </view>
  81. <view class="desc">
  82. {{infoTongue.shemianName||'无'}}:{{infoTongue.shemianDesc||'-'}}
  83. </view>
  84. <view class="desc">
  85. {{infoTongue.botai==1?"有剥苔":"未见剥苔"}}:{{infoTongue.botaiDesc||'-'}}
  86. </view>
  87. <view class="desc">
  88. {{infoTongue.liewen==1?"有裂纹":"未见裂纹"}}:{{infoTongue.liewenDesc||'-'}}
  89. </view>
  90. <view class="desc">
  91. {{infoTongue.chihen==1?"有齿痕":"未见齿痕"}}:{{infoTongue.chihenDesc||'-'}}
  92. </view>
  93. </view>
  94. </view>
  95. <view class="item column">
  96. <view class="left">
  97. <view class="x-bc">
  98. <text class="label">面诊</text>
  99. <text class="time">{{formatCreateTime(infoSurface.createTime)||'-'}}</text>
  100. </view>
  101. <view class="content">
  102. <view class="desc">
  103. 面色:{{infoSurface.complexionResult||'-'}}
  104. </view>
  105. <view class="desc">
  106. 区域色斑:{{infoSurface.spotProblems||'-'}}
  107. </view>
  108. <view class="desc">
  109. 浮肿特征:{{infoSurface.swellingProblems||'-'}}
  110. </view>
  111. <view class="desc">
  112. 光泽度:{{infoSurface.glowResult||'-'}}
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="item">
  118. <view class="x-bc">
  119. <text class="label">脉诊</text>
  120. <text class="time">{{infoPulse.createTime||'-'}}</text>
  121. </view>
  122. <view class="content">
  123. <view class="desc">
  124. 左手:{{leftHandResult}}
  125. </view>
  126. <view class="desc">
  127. 右手:{{rightHandResult}}
  128. </view>
  129. <view class="desc">
  130. 脉搏总结:{{infoPulse.pulseSummary||'-'}}
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="footer" @click="addApp">
  136. <text>更多报告详情,请下载芳华未来APP</text>
  137. </view>
  138. <view v-if="isCode" class="mask">
  139. <view class="popup-container2">
  140. <view class="title-t">扫码下载APP</view>
  141. <!-- <view class="title-r">点击确认查看检测报告</view> -->
  142. <image style="width: 200px;height: 200px;margin-bottom: 20px;" src="@/static/images/afangh.png"></image>
  143. <view class="btn-r" @click="closeP">关闭</view>
  144. </view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. import {
  150. getUserInfoByUserId,
  151. selectQueryFsUser,
  152. getDiagnosis
  153. } from '@/api/user.js';
  154. export default {
  155. data() {
  156. return {
  157. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  158. avatar: "",
  159. nickName: "",
  160. deptName: "",
  161. postNames: "",
  162. phonenumber: "",
  163. email: "",
  164. sex: "",
  165. isShow: false,
  166. isCode:false,
  167. userId: undefined,
  168. userInfo: {},
  169. infoTongue: {},
  170. infoSurface: {},
  171. infoPulse: {},
  172. leftHandResult:null,
  173. rightHandResult:null,
  174. userId:null
  175. }
  176. },
  177. onLoad(options) {
  178. if (options.userId) {
  179. this.userId=options.userId
  180. this.getDiagnosis(this.userId)
  181. }
  182. //this.getDiagnosis('4054874814')
  183. },
  184. onShow() {
  185. },
  186. methods: {
  187. goBack(){
  188. uni.navigateBack({
  189. delta:1
  190. })
  191. },
  192. formatCreateTime(rawTime) {
  193. // 先处理“无时间”的情况,返回默认值 "-"
  194. if (!rawTime) return "-";
  195. const date = new Date(rawTime); // 将原始时间转为 Date 对象
  196. const year = date.getFullYear();
  197. const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始,补0成两位数
  198. const day = String(date.getDate()).padStart(2, "0"); // 日期补0
  199. const hour = String(date.getHours()).padStart(2, "0"); // 小时补0
  200. const minute = String(date.getMinutes()).padStart(2, "0"); // 分钟补0
  201. const second = String(date.getSeconds()).padStart(2, "0");
  202. // 返回最终格式(可按需调整,如只显示日期则去掉 hour:minute)
  203. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  204. },
  205. closeP(){
  206. this.isCode=false
  207. },
  208. addApp() {
  209. this.isCode=true
  210. // let platform = uni.getSystemInfoSync().platform;
  211. // // let isAndroid=platform=="android";
  212. // if (platform === 'android') {
  213. // // #ifdef H5
  214. // window.open("https://m.malink.cn/s/2UZjMz", '_blank');
  215. // // #endif
  216. // } else if(platform === 'ios'){
  217. // // #ifdef H5
  218. // window.open("https://apps.apple.com/cn/app/%E8%8A%B3%E5%8D%8E%E6%9C%AA%E6%9D%A5/id6738688148",
  219. // '_blank');
  220. // // #endif
  221. // }
  222. },
  223. selectQueryFsUser(userId) {
  224. uni.showLoading({
  225. title: '加载中'
  226. })
  227. var data = {
  228. userId: userId
  229. };
  230. selectQueryFsUser(data).then(
  231. res => {
  232. if (res.code == 200) {
  233. this.userInfo = res.data
  234. uni.hideLoading()
  235. } else {
  236. uni.showToast({
  237. title: res.msg,
  238. icon: 'none'
  239. });
  240. uni.hideLoading()
  241. }
  242. },
  243. rej => {}
  244. );
  245. },
  246. getDiagnosis(userId) {
  247. uni.showLoading({
  248. title: '加载中'
  249. })
  250. var data = {
  251. userId: userId
  252. };
  253. getDiagnosis(data).then(
  254. res => {
  255. if (res.code == 200) {
  256. this.userInfo = res.data.user
  257. this.infoSurface = res.data.HealthSurface?res.data.HealthSurface:'暂无信息'
  258. this.infoTongue = res.data.HealthTongue?res.data.HealthTongue:'暂无信息'
  259. this.infoPulse = res.data.HealthPulse?res.data.HealthPulse:'暂无信息'
  260. this.leftHandResult=res.data.HealthPulse.leftHandResult?JSON.parse(res.data.HealthPulse.leftHandResult).leftHandResult:'-'
  261. this.rightHandResult=res.data.HealthPulse.rightHandResult?JSON.parse(res.data.HealthPulse.rightHandResult).rightHandResult:'-'
  262. uni.hideLoading()
  263. } else {
  264. uni.showToast({
  265. title: res.msg,
  266. icon: 'none'
  267. });
  268. uni.hideLoading()
  269. }
  270. },
  271. rej => {}
  272. );
  273. },
  274. }
  275. }
  276. </script>
  277. <style scoped lang="scss">
  278. page {
  279. background: linear-gradient(#FBF4EE 0%, #fff 100%);
  280. background-repeat: no-repeat;
  281. }
  282. .top-box {
  283. padding: 0 24rpx;
  284. margin-top: 20px;
  285. width: 100%;
  286. display: flex;
  287. align-items: center;
  288. justify-content: space-between;
  289. margin-bottom: 30px;
  290. .title {
  291. font-family: Source Han Serif CN, Source Han Serif CN;
  292. font-weight: bold;
  293. font-size: 30px;
  294. color: #8F6726;
  295. text-align: center;
  296. }
  297. .tab-box{
  298. font-size: 36rpx;
  299. color: #8F6726;
  300. }
  301. .back-box {
  302. width: 102px;
  303. height: 47px;
  304. background: #FFFFFF;
  305. border-radius: 6px 6px 6px 6px;
  306. border: 1px solid #8F6726;
  307. // padding: 12px 8px;
  308. justify-content: center;
  309. view {
  310. font-family: PingFang SC, PingFang SC;
  311. font-weight: 400;
  312. font-size: 18px;
  313. color: #8F6726;
  314. text-align: center;
  315. margin-left: 10px;
  316. }
  317. // position: absolute;
  318. // left: 30px;
  319. image {
  320. width: 24px;
  321. height: 24px;
  322. }
  323. }
  324. .select {
  325. min-width: 160px;
  326. height: 47px;
  327. background: #FFFFFF;
  328. border-radius: 6px 6px 6px 6px;
  329. border: 1px solid #8F6726;
  330. padding: 12px;
  331. display: flex;
  332. align-items: center;
  333. justify-content: center;
  334. image {
  335. width: 24px;
  336. height: 24px;
  337. &:last-child {
  338. width: 12px;
  339. height: 12px;
  340. }
  341. }
  342. .date {
  343. width: 100%;
  344. display: flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. }
  348. .text {
  349. margin-left: 10px;
  350. margin-right: 10px;
  351. font-family: PingFang SC, PingFang SC;
  352. font-weight: 400;
  353. font-size: 18px;
  354. color: #8F6726;
  355. text-align: center;
  356. }
  357. }
  358. }
  359. .mask {
  360. position: fixed;
  361. top: 0;
  362. left: 0;
  363. right: 0;
  364. bottom: 0;
  365. background-color: rgba(0, 0, 0, 0.5);
  366. display: flex;
  367. justify-content: center;
  368. align-items: center;
  369. z-index: 999;
  370. animation: fadeIn 0.3s ease;
  371. }
  372. /* 弹窗容器样式 */
  373. .popup-container2 {
  374. //width: 50%;
  375. min-height: 250px;
  376. background: #FBF4EE;
  377. border-radius: 12px;
  378. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  379. animation: scaleIn 0.3s ease;
  380. overflow: hidden;
  381. display: flex;
  382. flex-direction: column;
  383. align-items: center;
  384. justify-content: space-between;
  385. padding: 30px 50px;
  386. .title-t {
  387. font-size: 24px;
  388. font-weight: bold;
  389. color: #8F6726;
  390. text-align: center;
  391. margin-bottom: 20px;
  392. }
  393. .title-r {
  394. font-size: 20px;
  395. color: #8F6726;
  396. text-align: center;
  397. padding: 20px 0;
  398. }
  399. .btn-r {
  400. text-align: center;
  401. background: #8F6726;
  402. font-size: 20px;
  403. color: #FBF4EE;
  404. border-radius: 12px;
  405. width: 100%;
  406. height: 50px;
  407. line-height: 50px;
  408. }
  409. }
  410. .one-t {
  411. white-space: nowrap;
  412. /* 强制文本不换行 */
  413. overflow: hidden;
  414. /* 隐藏超出容器的内容 */
  415. text-overflow: ellipsis;
  416. /* 超出部分显示省略号 */
  417. }
  418. .two-t {
  419. display: -webkit-box;
  420. -webkit-box-orient: vertical;
  421. -webkit-line-clamp: 2;
  422. /* 强制显示2行,超出部分省略 */
  423. overflow: hidden;
  424. }
  425. .content {
  426. padding-bottom: 30rpx;
  427. // background: #FBF4EE;
  428. // 个人信息
  429. .user-info {
  430. // background: #FBF4EE;
  431. padding: 0 24rpx;
  432. .info-box {
  433. margin-top: 20rpx;
  434. margin-bottom: 20rpx;
  435. display: flex;
  436. align-items: center;
  437. justify-content: space-between;
  438. background: #FFFFFF;
  439. border-radius: 16rpx 16rpx 16rpx 16rpx;
  440. .left {
  441. width: 100%;
  442. display: flex;
  443. align-items: center;
  444. padding: 20rpx;
  445. .head-box {
  446. width: 120rpx;
  447. height: 120rpx;
  448. line-height: 100rpx;
  449. font-size: 30rpx;
  450. text-align: center;
  451. margin-right: 20rpx;
  452. .img {
  453. border-radius: 50%;
  454. width: 100%;
  455. height: 100%;
  456. }
  457. }
  458. .info {
  459. width: calc(100% - 140rpx);
  460. height: 120rpx;
  461. display: flex;
  462. flex-direction: column;
  463. justify-content: space-between;
  464. color: #333;
  465. .name {
  466. font-size: 30rpx;
  467. }
  468. .info-top {
  469. color: #999999;
  470. font-size: 24rpx;
  471. .sex {
  472. margin-right: 20rpx;
  473. }
  474. }
  475. .phone {
  476. font-size: 24rpx;
  477. color: #999999;
  478. }
  479. .title {
  480. font-size: 28rpx;
  481. }
  482. }
  483. }
  484. .right {
  485. width: 40rpx;
  486. height: 40rpx;
  487. }
  488. }
  489. .userinfo-list {
  490. margin: 0 -16rpx 0 0;
  491. .userinfo-item {
  492. flex: 1;
  493. min-height: 136rpx;
  494. padding: 24rpx;
  495. box-sizing: border-box;
  496. margin: 0 16rpx 16rpx 0;
  497. background: #FFFFFF;
  498. border-radius: 16rpx 16rpx 16rpx 16rpx;
  499. font-family: PingFang SC;
  500. font-weight: 400;
  501. font-size: 24rpx;
  502. color: #757575;
  503. image {
  504. width: 56rpx;
  505. height: 56rpx;
  506. }
  507. .num {
  508. font-family: DIN, DIN;
  509. font-weight: 500;
  510. font-size: 36rpx;
  511. color: #333333;
  512. margin-right: 10rpx;
  513. }
  514. .txt {
  515. font-family: PingFang SC;
  516. font-weight: 500;
  517. font-size: 24rpx;
  518. color: #333333;
  519. }
  520. }
  521. }
  522. .comp-info {
  523. padding: 20rpx 0 40rpx;
  524. display: flex;
  525. align-items: center;
  526. .img {
  527. width: 30rpx;
  528. height: 30rpx;
  529. margin-right: 20rpx;
  530. }
  531. .text {
  532. font-size: 30rpx;
  533. color: #fff;
  534. }
  535. }
  536. }
  537. // 详细信息
  538. .info-detail {
  539. padding: 0 24rpx;
  540. margin-top: 20rpx;
  541. overflow: hidden;
  542. .item {
  543. margin-bottom: 20rpx;
  544. border-bottom: 1px solid #f7f7f7;
  545. display: flex;
  546. flex-direction: column;
  547. justify-content: space-between;
  548. .label {
  549. font-size: 36rpx;
  550. font-weight: bold;
  551. margin-right: 20rpx;
  552. }
  553. .time {
  554. font-weight: 400;
  555. font-size: 24rpx;
  556. color: #666666;
  557. }
  558. .content {
  559. margin-top: 20rpx;
  560. padding: 20rpx;
  561. font-family: PingFang SC;
  562. font-weight: 400;
  563. font-size: 28rpx;
  564. background: #FFFFFF;
  565. border-radius: 16rpx 16rpx 16rpx 16rpx;
  566. border: 1px solid #FBF4EE;
  567. .desc {
  568. margin-bottom: 20rpx;
  569. padding-left: 20rpx;
  570. position: relative;
  571. line-height: 40rpx;
  572. &::before {
  573. content: '';
  574. position: absolute;
  575. z-index: 9;
  576. top: 15rpx;
  577. left: 0;
  578. width: 10rpx;
  579. height: 10rpx;
  580. background: #8F6726;
  581. border-radius: 5rpx;
  582. }
  583. }
  584. }
  585. }
  586. }
  587. .footer {
  588. margin: 30rpx 20rpx 0;
  589. padding: 20rpx 0;
  590. border-radius: 16rpx 16rpx 16rpx 16rpx;
  591. background: #8F6726;
  592. font-size: 28rpx;
  593. color: #fff;
  594. text-align: center;
  595. }
  596. }
  597. </style>