report.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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="baseUrl+'/images/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. //发送给朋友
  153. onShareAppMessage(res) {
  154. return {
  155. title: "舌苔检测报告",
  156. path:"/pages_user/tongue/report?isShare=1&id="+this.id
  157. }
  158. },
  159. //分享到朋友圈
  160. onShareTimeline(res) {
  161. return {
  162. title: "舌苔检测报告",
  163. path:"/pages_user/tongue/report?isShare=1&id="+this.id
  164. }
  165. },
  166. onPageScroll(e) {
  167. if(e.scrollTop > 44) {
  168. this.headerBG = '#FF8A00'
  169. } else {
  170. this.headerBG = "transparent"
  171. }
  172. },
  173. methods: {
  174. doTongue(){
  175. uni.redirectTo({
  176. url:"/pages/user/tongue/index"
  177. })
  178. },
  179. getHealthTongueById(){
  180. getHealthTongueById(this.id).then(
  181. res => {
  182. if(res.code==200){
  183. this.isLock = res.isAddQw == 1 ? true : false
  184. this.videoUrl = res.url || ''
  185. this.imageUrl = res.imageUrl || ''
  186. this.item=res.data;
  187. const jsoninfo = JSON.parse(this.item.typeJson)
  188. let index = jsoninfo.findIndex(item => item.name === '用药调治');
  189. if(index > -1) {
  190. this.typeList=jsoninfo.splice(0,index)
  191. } else {
  192. this.typeList=jsoninfo
  193. }
  194. }else{
  195. }
  196. },
  197. rej => {}
  198. );
  199. },
  200. back() {
  201. if(this.type!=null&&this.type=="back"){
  202. uni.navigateBack()
  203. }
  204. else{
  205. uni.switchTab({
  206. url:"/pages/index/index"
  207. })
  208. }
  209. },
  210. doShare(){
  211. if(this.isH5){
  212. return;
  213. }
  214. this.shareItem.title= "舌苔检测报告";
  215. this.shareItem.imageUrl="";
  216. this.shareItem.isMini=true;
  217. this.shareItem.path="/pages/user/tongue/report?isShare=1&id="+this.id
  218. let cdn=uni.getStorageSync('h5Path');
  219. this.shareItem.url=cdn+this.shareItem.path;
  220. this.showShare=true;
  221. }
  222. }
  223. }
  224. </script>
  225. <style scoped lang="scss">
  226. @mixin u-flex($flexD, $alignI, $justifyC) {
  227. display: flex;
  228. flex-direction: $flexD;
  229. align-items: $alignI;
  230. justify-content: $justifyC;
  231. }
  232. .pb50 {
  233. padding-bottom: calc(var(--window-bottom) + 50rpx);
  234. }
  235. .lockbox {
  236. margin-top: -200rpx;
  237. position: relative;
  238. z-index: 9;
  239. .mask{
  240. width: 100%;
  241. height:160rpx;
  242. margin-bottom: -2px;
  243. }
  244. &-con-tip {
  245. padding: 16rpx 24rpx 30rpx 24rpx;
  246. box-sizing: border-box;
  247. color: #FF4E00;
  248. font-size: 32rpx;
  249. font-weight: bold;
  250. }
  251. &-con {
  252. padding: 0 24rpx 40rpx 24rpx;
  253. box-sizing: border-box;
  254. font-family: PingFang SC, PingFang SC;
  255. font-weight: 400;
  256. font-size: 24rpx;
  257. color: #999999;
  258. background-color: #fff;
  259. image {
  260. width: 702rpx;
  261. height: auto;
  262. border-radius: 16rpx;
  263. overflow: hidden;
  264. margin-bottom: 40rpx;
  265. }
  266. }
  267. }
  268. .footer-btnbox {
  269. width: 100%;
  270. padding-bottom: 44rpx;
  271. @include u-flex(row, center, center);
  272. background-color: #fff;
  273. .border-btn {
  274. width: 400rpx;
  275. height: 78rpx;
  276. padding: 4rpx;
  277. box-sizing: border-box;
  278. background: linear-gradient(0deg, #FF7200, #FF9E06);
  279. box-shadow: 0rpx 9rpx 17rpx 0rpx rgba(240,134,33,0.6);
  280. border-radius: 78rpx;
  281. }
  282. .footer-btn {
  283. width: 100%;
  284. height: 100%;
  285. background: #FF7200;
  286. border-radius: 78rpx;
  287. font-family: SourceHanSansCN-Bold;
  288. font-weight: bold;
  289. font-size: 40rpx;
  290. color: #FFFFFF;
  291. line-height: 69rpx;
  292. border-radius: 33rpx;
  293. border: 3rpx solid #FFEEC5;
  294. text-align: center;
  295. &::after {
  296. border: none;
  297. }
  298. position: relative;
  299. .contact-btn{
  300. display: inline-block;
  301. position: absolute;
  302. top: 0;
  303. left: 0;
  304. width: 100%;
  305. height: 100%;
  306. opacity: 0;
  307. z-index: 9999;
  308. }
  309. }
  310. }
  311. .uni-nav-bar_bg {
  312. width: 100%;
  313. height: 782rpx;
  314. }
  315. .uni-nav-head {
  316. position: fixed;
  317. top: 0;
  318. left: 0;
  319. width: 100%;
  320. z-index: 999;
  321. height: calc(var(--status-bar-height) + 88rpx);
  322. overflow: hidden;
  323. font-family: PingFang SC, PingFang SC;
  324. font-weight: 500;
  325. color: #FFFFFF;
  326. font-size: 32rpx;
  327. }
  328. .uni-nav-barbox {
  329. width: 100%;
  330. height: calc(var(--status-bar-height) + 88rpx);
  331. padding-top: var(--status-bar-height);
  332. padding-left: 20rpx;
  333. box-sizing: border-box;
  334. @include u-flex(row, center, space-between);
  335. background-repeat: no-repeat;
  336. background-size: 100% auto;
  337. .uni-nav-back {
  338. width: 110rpx;
  339. box-sizing: border-box;
  340. @include u-flex(row, center, center);
  341. text-align: center;
  342. }
  343. }
  344. .uni-nav-bar {
  345. position: fixed;
  346. top: 0;
  347. left: 0;
  348. width: 100%;
  349. height: calc(var(--status-bar-height) + 88rpx);
  350. z-index: 994;
  351. overflow: hidden;
  352. }
  353. .videobox {
  354. width: 568rpx;
  355. height: 320rpx;
  356. margin-top: 40rpx;
  357. position: relative;
  358. .myVideo {
  359. width: 568rpx;
  360. height: 320rpx;
  361. }
  362. }
  363. .ai-container {
  364. min-height: 100vh;
  365. position: relative;
  366. background: #FF8A00;
  367. .jkda_top_bg {
  368. position: absolute;
  369. top: 0;
  370. left: 0;
  371. width: 100%;
  372. height: auto;
  373. }
  374. .ai_bottom_bg {
  375. position: absolute;
  376. bottom: 0;
  377. left: 0;
  378. width: 100%;
  379. height: auto;
  380. }
  381. &-body {
  382. position: relative;
  383. padding-top: calc(var(--status-bar-height) + 132rpx);
  384. }
  385. }
  386. .bold {
  387. height: 42rpx;
  388. font-size: 44rpx !important;
  389. color: #FF7C00 !important;
  390. border-left: 10rpx solid #FF7C00;
  391. line-height: 42rpx;
  392. margin: 54rpx 0 40rpx 0;
  393. }
  394. .ai_sz_img {
  395. width: 100%;
  396. height: auto;
  397. position: absolute;
  398. top: 0;
  399. left: 16rpx;
  400. z-index: 1;
  401. }
  402. .item-round {
  403. flex-shrink: 0;
  404. width: 23rpx;
  405. height: 23rpx;
  406. margin-right: 12rpx;
  407. background: #FF7C00;
  408. border-radius: 50%;
  409. }
  410. .report {
  411. &-avatar {
  412. width: 171rpx;
  413. height: 171rpx;
  414. padding: 3rpx;
  415. margin: 0 auto;
  416. border-radius: 50%;
  417. overflow: hidden;
  418. box-sizing: border-box;
  419. background: linear-gradient(0deg, #FF8400, #FED920);
  420. }
  421. &-user {
  422. font-family: SourceHanSansCN;
  423. font-weight: bold;
  424. font-size: 40rpx;
  425. color: #FFFFFF;
  426. line-height: 91rpx;
  427. text-shadow: 2rpx 2rpx 3rpx rgba(255, 84, 0, 0.76);
  428. text-align: center;
  429. }
  430. &-infobox {
  431. padding: 36rpx 47rpx 0 47rpx;
  432. padding-top: 184rpx;
  433. position: relative;
  434. }
  435. &-info-border {
  436. padding: 4rpx;
  437. border-radius: 45rpx;
  438. box-sizing: border-box;
  439. background: linear-gradient(0deg, #FF4E00, #FF9E06);
  440. box-shadow: 8rpx 11rpx 14rpx 0rpx rgba(255, 84, 0, 0.88);
  441. position: relative;
  442. z-index: 2;
  443. }
  444. &-info {
  445. padding: 34rpx 40rpx;
  446. box-sizing: border-box;
  447. background: #FFFFFF;
  448. border-radius: 45rpx;
  449. font-family: SourceHanSansCN-Regular;
  450. font-weight: 400;
  451. color: #4D4D4D;
  452. &-restit {
  453. margin: 27rpx 0 33rpx 0;
  454. font-family: SourceHanSansCN-Bold;
  455. font-weight: bold;
  456. font-size: 33rpx;
  457. color: #4D4D4D;
  458. text-align: center;
  459. }
  460. &-res {
  461. font-weight: 800;
  462. font-size: 54rpx;
  463. color: #FF7C00;
  464. text-align: center;
  465. }
  466. &-item {
  467. margin-bottom: 30rpx;
  468. display: flex;
  469. align-items: baseline;
  470. font-family: SourceHanSansCN-Regular;
  471. font-size: 27rpx;
  472. color: #414141;
  473. line-height: 36rpx;
  474. word-break: break-all;
  475. .item-title {
  476. font-family: SourceHanSansCN-Bold;
  477. font-weight: bold;
  478. font-size: 27rpx;
  479. color: #414141;
  480. }
  481. }
  482. }
  483. &-time {
  484. font-size: 24rpx;
  485. text-align: center;
  486. }
  487. &-title {
  488. padding-left: 10rpx;
  489. font-family: SourceHanSansCN-Bold;
  490. font-weight: bold;
  491. color: #414141;
  492. }
  493. }
  494. .banner-box {
  495. padding: 48rpx 34rpx 0 34rpx;
  496. image {
  497. width: 100%;
  498. height: auto;
  499. }
  500. }
  501. </style>