diseaseDetails.vue 2.8 KB

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