diseaseDetails.vue 3.0 KB

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