report.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <view class="ai-container">
  3. <view class="uni-nav-head">
  4. <cover-view class="uni-nav-barbox" :style="{backgroundColor:headerBG,backgroundImage: baseUrl+'/images/ai_top_bg.png'}">
  5. <cover-view class="uni-nav-back" @click="back()">返回</cover-view>
  6. <cover-view class="uni-nav-title">AI舌诊体质辨识报告</cover-view>
  7. <cover-view style="min-width: 104rpx;"></cover-view>
  8. </cover-view>
  9. </view>
  10. <image class="jkda_top_bg" :src="baseUrl+'/images/ai_top_bg.png'" mode="widthFix"></image>
  11. <image class="ai_bottom_bg" :src="baseUrl+'/images/ai_bottom_bg.png'" mode="widthFix"></image>
  12. <view class="ai-container-body" v-if="item!=null">
  13. <view class="report-avatar">
  14. <image :src="item.avatar" mode="aspectFill" style="width: 100%;height: 100%;"></image>
  15. </view>
  16. <view class="report-user">
  17. <text>{{item.name}}</text>
  18. <text style="padding: 0 18rpx 0 10rpx;">{{item.sex==1?"男":"女"}}</text>
  19. <text>{{item.age}}岁</text>
  20. </view>
  21. <view class="report-infobox">
  22. <image class="ai_sz_img" :src="baseUrl+'/images/ai_sz_img.png'" mode="widthFix"></image>
  23. <view class="report-info-border">
  24. <view class="report-info">
  25. <view class="report-time">检测时间 {{item.createTime}}</view>
  26. <view class="report-info-restit">您属于{{item.typeName}}</view>
  27. <view class="report-info-res">{{item.typeName}}</view>
  28. <!-- 视频 -->
  29. <view class="videobox" v-if="videoUrl">
  30. <video class="myVideo" :src="videoUrl" :poster="imageUrl" :autoplay='true'></video>
  31. </view>
  32. <!-- 舌苔特征 -->
  33. <view class="report-title bold">舌苔特征</view>
  34. <view class="report-info-item">
  35. <view class="item-round"></view>
  36. <view>
  37. <text class="item-title">{{item.taiseName}}:</text>
  38. <text>{{item.taiseDesc}}</text>
  39. </view>
  40. </view>
  41. <view class="report-info-item">
  42. <view class="item-round"></view>
  43. <view>
  44. <text class="item-title">{{item.shemianName}}:</text>
  45. <text>{{item.shemianDesc}}</text>
  46. </view>
  47. </view>
  48. <view class="report-info-item">
  49. <view class="item-round"></view>
  50. <view>
  51. <text class="item-title">{{item.botai==1?"有剥苔":"未见剥苔"}}:</text>
  52. <text>{{item.botaiDesc}}</text>
  53. </view>
  54. </view>
  55. <view class="report-info-item">
  56. <view class="item-round"></view>
  57. <view>
  58. <text class="item-title">{{item.liewen==1?"有裂纹":"未见裂纹"}}:</text>
  59. <text>{{item.liewenDesc}}</text>
  60. </view>
  61. </view>
  62. <view class="report-info-item">
  63. <view class="item-round"></view>
  64. <view>
  65. <text class="item-title">{{item.chihen==1?"有齿痕":"未见齿痕"}}:</text>
  66. <text>{{item.chihenDesc}}</text>
  67. </view>
  68. </view>
  69. <!-- 体质解析 -->
  70. <view class="report-title bold" >体质解析</view>
  71. <view class="report-info-item" v-for="(item) in typeList">
  72. <view class="item-round"></view>
  73. <view>
  74. <text class="item-title">{{item.name}}:</text>
  75. <text>{{item.value}}</text>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 解锁 -->
  82. <view class="lockbox">
  83. <image class="mask x-c" src="/static/images/other/bg_bar.png"></image>
  84. <view class="lockbox-con y-f">
  85. <view class="lockbox-con-tip">联系伴学助手,查看全部内容</view>
  86. <image src="@/static/bxzs.jpg" mode="widthFix"></image>
  87. <view>注:报告内容参考王琦教授《九种体质使用手册》</view>
  88. </view>
  89. </view>
  90. <!-- 分享弹窗 -->
  91. <u-popup :show="showShare" @close="showShare = false" >
  92. <share-box :shareItem="shareItem" :showCopy="false" @closeShare='showShare = false' ></share-box>
  93. </u-popup>
  94. <view class="footer-btnbox">
  95. <!-- <view class="border-btn">
  96. <button class="footer-btn footer-btn-left">保存本图</button>
  97. </view> -->
  98. <view class="border-btn">
  99. <!-- #ifdef APP-PLUS -->
  100. <view class="footer-btn" v-if="isShare==null" @click="doShare()">分享好友</view>
  101. <!-- #endif -->
  102. <!-- #ifndef APP-PLUS -->
  103. <view class="footer-btn" v-if="isShare==null">
  104. 分享好友
  105. <button class="contact-btn" data-name="shareBtn" open-type="share">分享</button>
  106. </view>
  107. <!-- #endif -->
  108. <!-- #ifdef H5 -->
  109. <view class="footer-btn" v-if="isShare!=null&&isShare==1" @click="doTongue()">
  110. 开始检测
  111. </view>
  112. <!-- #endif -->
  113. </view>
  114. </view>
  115. <!-- <view class="banner-box">
  116. <image src="@/static/images/banner.png" mode="widthFix"></image>
  117. </view> -->
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. import {getHealthTongueById} from '@/api/healthTongue.js'
  123. export default {
  124. data() {
  125. return {
  126. type:null,
  127. id:null,
  128. isShare:null,
  129. avatar:null,
  130. item:null,
  131. typeList:[],
  132. baseUrl:uni.getStorageSync('requestPath'),
  133. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  134. defaultHeadimg: "/static/images/my_heads_icon.png",
  135. showShare:false,
  136. shareItem:{ imageUrl:"",title:"",path:"",isMini:true },
  137. isLock: true,
  138. videoUrl: '',
  139. imageUrl: '',
  140. headerBG:"transparent"
  141. }
  142. },
  143. onLoad(options) {
  144. this.type=options.type;
  145. this.isShare=options.isShare;
  146. this.id=options.id;
  147. // var json=uni.getStorageSync("tongueResult")
  148. // this.item=JSON.parse(json);
  149. // this.typeList=JSON.parse(this.item.typeJson)
  150. this.getHealthTongueById()
  151. },
  152. onShow() {
  153. if(!this.$isLogin()) {
  154. this.$showLoginPage()
  155. }
  156. },
  157. //发送给朋友
  158. onShareAppMessage(res) {
  159. return {
  160. title: "舌苔检测报告",
  161. path:"/pages_user/tongue/report?isShare=1&id="+this.id
  162. }
  163. },
  164. //分享到朋友圈
  165. onShareTimeline(res) {
  166. return {
  167. title: "舌苔检测报告",
  168. path:"/pages_user/tongue/report?isShare=1&id="+this.id
  169. }
  170. },
  171. onPageScroll(e) {
  172. if(e.scrollTop > 44) {
  173. this.headerBG = '#FF8A00'
  174. } else {
  175. this.headerBG = "transparent"
  176. }
  177. },
  178. methods: {
  179. doTongue(){
  180. uni.redirectTo({
  181. url:"/pages/user/tongue/index"
  182. })
  183. },
  184. getHealthTongueById(){
  185. getHealthTongueById(this.id).then(
  186. res => {
  187. if(res.code==200){
  188. this.isLock = res.isAddQw == 1 ? true : false
  189. this.videoUrl = res.url || ''
  190. this.imageUrl = res.imageUrl || ''
  191. this.item=res.data;
  192. const jsoninfo = JSON.parse(this.item.typeJson)
  193. let index = jsoninfo.findIndex(item => item.name === '用药调治');
  194. if(index > -1) {
  195. this.typeList=jsoninfo.splice(0,index)
  196. } else {
  197. this.typeList=jsoninfo
  198. }
  199. }else{
  200. }
  201. },
  202. rej => {}
  203. );
  204. },
  205. back() {
  206. if(this.type!=null&&this.type=="back"){
  207. uni.navigateBack()
  208. }
  209. else{
  210. uni.switchTab({
  211. url:"/pages/index/index"
  212. })
  213. }
  214. },
  215. doShare(){
  216. //#ifdef APP-PLUS
  217. this.shareItem.title= "舌苔检测报告";
  218. this.shareItem.imageUrl="/static/logo.png";
  219. this.shareItem.isMini=true;
  220. this.shareItem.path="/pages_user/tongue/report?isShare=1&id="+this.id
  221. let cdn=uni.getStorageSync('h5Path');
  222. this.shareItem.url=cdn+"/pages/user/tongue/report?isShare=1&id="+this.id
  223. console.log("this.shareItem==",this.shareItem)
  224. this.showShare=true;
  225. //#endif
  226. }
  227. }
  228. }
  229. </script>
  230. <style scoped lang="scss">
  231. @mixin u-flex($flexD, $alignI, $justifyC) {
  232. display: flex;
  233. flex-direction: $flexD;
  234. align-items: $alignI;
  235. justify-content: $justifyC;
  236. }
  237. .pb50 {
  238. padding-bottom: calc(var(--window-bottom) + 50rpx);
  239. }
  240. .lockbox {
  241. margin-top: -200rpx;
  242. position: relative;
  243. z-index: 9;
  244. .mask{
  245. width: 100%;
  246. height:160rpx;
  247. margin-bottom: -2px;
  248. }
  249. &-con-tip {
  250. padding: 16rpx 24rpx 30rpx 24rpx;
  251. box-sizing: border-box;
  252. color: #FF4E00;
  253. font-size: 32rpx;
  254. font-weight: bold;
  255. }
  256. &-con {
  257. padding: 0 24rpx 40rpx 24rpx;
  258. box-sizing: border-box;
  259. font-family: PingFang SC, PingFang SC;
  260. font-weight: 400;
  261. font-size: 24rpx;
  262. color: #999999;
  263. background-color: #fff;
  264. image {
  265. width: 702rpx;
  266. height: auto;
  267. border-radius: 16rpx;
  268. overflow: hidden;
  269. margin-bottom: 40rpx;
  270. }
  271. }
  272. }
  273. .footer-btnbox {
  274. width: 100%;
  275. padding-bottom: 44rpx;
  276. @include u-flex(row, center, center);
  277. background-color: #fff;
  278. .border-btn {
  279. width: 400rpx;
  280. height: 78rpx;
  281. padding: 4rpx;
  282. box-sizing: border-box;
  283. background: linear-gradient(0deg, #FF7200, #FF9E06);
  284. box-shadow: 0rpx 9rpx 17rpx 0rpx rgba(240,134,33,0.6);
  285. border-radius: 78rpx;
  286. }
  287. .footer-btn {
  288. width: 100%;
  289. height: 100%;
  290. background: #FF7200;
  291. border-radius: 78rpx;
  292. font-family: SourceHanSansCN-Bold;
  293. font-weight: bold;
  294. font-size: 40rpx;
  295. color: #FFFFFF;
  296. line-height: 69rpx;
  297. border-radius: 33rpx;
  298. border: 3rpx solid #FFEEC5;
  299. text-align: center;
  300. &::after {
  301. border: none;
  302. }
  303. position: relative;
  304. .contact-btn{
  305. display: inline-block;
  306. position: absolute;
  307. top: 0;
  308. left: 0;
  309. width: 100%;
  310. height: 100%;
  311. opacity: 0;
  312. z-index: 9999;
  313. }
  314. }
  315. }
  316. .uni-nav-bar_bg {
  317. width: 100%;
  318. height: 782rpx;
  319. }
  320. .uni-nav-head {
  321. position: fixed;
  322. top: 0;
  323. left: 0;
  324. width: 100%;
  325. z-index: 999;
  326. height: calc(var(--status-bar-height) + 88rpx);
  327. overflow: hidden;
  328. font-family: PingFang SC, PingFang SC;
  329. font-weight: 500;
  330. color: #FFFFFF;
  331. font-size: 32rpx;
  332. }
  333. .uni-nav-barbox {
  334. width: 100%;
  335. height: calc(var(--status-bar-height) + 88rpx);
  336. padding-top: var(--status-bar-height);
  337. padding-left: 20rpx;
  338. box-sizing: border-box;
  339. @include u-flex(row, center, space-between);
  340. background-repeat: no-repeat;
  341. background-size: 100% auto;
  342. .uni-nav-back {
  343. width: 110rpx;
  344. box-sizing: border-box;
  345. @include u-flex(row, center, center);
  346. text-align: center;
  347. }
  348. }
  349. .uni-nav-bar {
  350. position: fixed;
  351. top: 0;
  352. left: 0;
  353. width: 100%;
  354. height: calc(var(--status-bar-height) + 88rpx);
  355. z-index: 994;
  356. overflow: hidden;
  357. }
  358. .videobox {
  359. width: 568rpx;
  360. height: 320rpx;
  361. margin-top: 40rpx;
  362. position: relative;
  363. .myVideo {
  364. width: 568rpx;
  365. height: 320rpx;
  366. }
  367. }
  368. .ai-container {
  369. min-height: 100vh;
  370. position: relative;
  371. background: #FF8A00;
  372. .jkda_top_bg {
  373. position: absolute;
  374. top: 0;
  375. left: 0;
  376. width: 100%;
  377. height: auto;
  378. }
  379. .ai_bottom_bg {
  380. position: absolute;
  381. bottom: 0;
  382. left: 0;
  383. width: 100%;
  384. height: auto;
  385. }
  386. &-body {
  387. position: relative;
  388. padding-top: calc(var(--status-bar-height) + 132rpx);
  389. }
  390. }
  391. .bold {
  392. height: 42rpx;
  393. font-size: 44rpx !important;
  394. color: #FF7C00 !important;
  395. border-left: 10rpx solid #FF7C00;
  396. line-height: 42rpx;
  397. margin: 54rpx 0 40rpx 0;
  398. }
  399. .ai_sz_img {
  400. width: 100%;
  401. height: auto;
  402. position: absolute;
  403. top: 0;
  404. left: 16rpx;
  405. z-index: 1;
  406. }
  407. .item-round {
  408. flex-shrink: 0;
  409. width: 23rpx;
  410. height: 23rpx;
  411. margin-right: 12rpx;
  412. background: #FF7C00;
  413. border-radius: 50%;
  414. }
  415. .report {
  416. &-avatar {
  417. width: 171rpx;
  418. height: 171rpx;
  419. padding: 3rpx;
  420. margin: 0 auto;
  421. border-radius: 50%;
  422. overflow: hidden;
  423. box-sizing: border-box;
  424. background: linear-gradient(0deg, #FF8400, #FED920);
  425. }
  426. &-user {
  427. font-family: SourceHanSansCN;
  428. font-weight: bold;
  429. font-size: 40rpx;
  430. color: #FFFFFF;
  431. line-height: 91rpx;
  432. text-shadow: 2rpx 2rpx 3rpx rgba(255, 84, 0, 0.76);
  433. text-align: center;
  434. }
  435. &-infobox {
  436. padding: 36rpx 47rpx 0 47rpx;
  437. padding-top: 184rpx;
  438. position: relative;
  439. }
  440. &-info-border {
  441. padding: 4rpx;
  442. border-radius: 45rpx;
  443. box-sizing: border-box;
  444. background: linear-gradient(0deg, #FF4E00, #FF9E06);
  445. box-shadow: 8rpx 11rpx 14rpx 0rpx rgba(255, 84, 0, 0.88);
  446. position: relative;
  447. z-index: 2;
  448. }
  449. &-info {
  450. padding: 34rpx 40rpx;
  451. box-sizing: border-box;
  452. background: #FFFFFF;
  453. border-radius: 45rpx;
  454. font-family: SourceHanSansCN-Regular;
  455. font-weight: 400;
  456. color: #4D4D4D;
  457. &-restit {
  458. margin: 27rpx 0 33rpx 0;
  459. font-family: SourceHanSansCN-Bold;
  460. font-weight: bold;
  461. font-size: 33rpx;
  462. color: #4D4D4D;
  463. text-align: center;
  464. }
  465. &-res {
  466. font-weight: 800;
  467. font-size: 54rpx;
  468. color: #FF7C00;
  469. text-align: center;
  470. }
  471. &-item {
  472. margin-bottom: 30rpx;
  473. display: flex;
  474. align-items: baseline;
  475. font-family: SourceHanSansCN-Regular;
  476. font-size: 27rpx;
  477. color: #414141;
  478. line-height: 36rpx;
  479. word-break: break-all;
  480. .item-title {
  481. font-family: SourceHanSansCN-Bold;
  482. font-weight: bold;
  483. font-size: 27rpx;
  484. color: #414141;
  485. }
  486. }
  487. }
  488. &-time {
  489. font-size: 24rpx;
  490. text-align: center;
  491. }
  492. &-title {
  493. padding-left: 10rpx;
  494. font-family: SourceHanSansCN-Bold;
  495. font-weight: bold;
  496. color: #414141;
  497. }
  498. }
  499. .banner-box {
  500. padding: 48rpx 34rpx 0 34rpx;
  501. image {
  502. width: 100%;
  503. height: auto;
  504. }
  505. }
  506. </style>