healthReportOld.vue 15 KB

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