diseaseDetails.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="content" v-if="item!=null" >
  3. <u-navbar
  4. :title="item.diseaseName"
  5. :autoBack="true"
  6. ></u-navbar>
  7. <view style="height: 180rpx;"></view>
  8. <view class="detail-cont">
  9. <view class="title-box">
  10. <view class="line"></view>
  11. <view class="title">疾病名称</view>
  12. </view>
  13. <view class="desc" v-html="item.diseaseName"></view>
  14. <view class="title-box">
  15. <view class="line"></view>
  16. <view class="title">病情症状</view>
  17. </view>
  18. <view class="desc" v-html="item.symptom"></view>
  19. <view class="title-box">
  20. <view class="line"></view>
  21. <view class="title">病情诊断</view>
  22. </view>
  23. <view class="desc" v-html="item.diagnose"></view>
  24. <view class="title-box">
  25. <view class="line"></view>
  26. <view class="title">相关检验</view>
  27. </view>
  28. <view class="desc" v-html="item.inspect"></view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import {getDiseaseById} from '@/api/disease'
  34. export default {
  35. data() {
  36. return {
  37. diseaseId:null,
  38. item:{},
  39. };
  40. },
  41. onLoad(option) {
  42. this.diseaseId=option.diseaseId;
  43. },
  44. onShow() {
  45. this.getDiseaseById();
  46. },
  47. onShareAppMessage(res) {
  48. if(this.utils.isLogin()){
  49. return {
  50. title: this.item.diseaseName,
  51. path: '/pages_index/diseaseDetails?id='+this.diseaseId,
  52. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  53. }
  54. }
  55. },
  56. //分享到朋友圈
  57. onShareTimeline(res) {
  58. if(this.utils.isLogin()){
  59. return {
  60. title: this.item.diseaseName,
  61. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  62. }
  63. }
  64. },
  65. methods:{
  66. getDiseaseById(){
  67. let data = {diseaseId:this.diseaseId};
  68. getDiseaseById(data).then(
  69. res => {
  70. if(res.code==200){
  71. this.item=res.data;
  72. }else{
  73. uni.showToast({
  74. icon:'none',
  75. title: "请求失败",
  76. });
  77. }
  78. },
  79. rej => {}
  80. );
  81. },
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. page{
  87. height: 100%;
  88. }
  89. .detail-cont{
  90. margin: 20rpx;
  91. padding: 15rpx;
  92. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  93. background-color: #fff;
  94. border-radius: 15rpx;
  95. .title-box{
  96. width: 100%;
  97. display: flex;
  98. justify-content: flex-start;
  99. align-items: center;
  100. .line{
  101. width: 6rpx;
  102. height:30rpx;
  103. background-color: #018C39;
  104. }
  105. .title{
  106. margin-left: 15rpx;
  107. font-size: 32upx;
  108. font-family: PingFang SC;
  109. font-weight: bold;
  110. color: #333;
  111. }
  112. }
  113. .desc{
  114. margin-top: 15rpx;
  115. margin-bottom: 15rpx;
  116. font-size: 28upx;
  117. font-family: PingFang SC;
  118. color: #9a9a9c;
  119. }
  120. }
  121. </style>