diseaseDetails.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. import { mapGetters } from 'vuex';
  30. export default {
  31. data() {
  32. return {
  33. diseaseId:null,
  34. item:{},
  35. };
  36. },
  37. onLoad(option) {
  38. this.diseaseId=option.diseaseId;
  39. },
  40. onShow() {
  41. this.getDiseaseById();
  42. },
  43. computed: {
  44. ...mapGetters(['logoimg']),
  45. },
  46. watch: {
  47. logoimg: {
  48. immediate: true, // 页面一进入就检查一次
  49. handler(val) {
  50. return val
  51. }
  52. },
  53. },
  54. onShareAppMessage(res) {
  55. if(this.utils.isLogin()){
  56. return {
  57. title: this.item.diseaseName,
  58. path: '/pages_index/diseaseDetails?id='+this.diseaseId,
  59. imageUrl: this.logoimg//分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  60. }
  61. }
  62. },
  63. //分享到朋友圈
  64. onShareTimeline(res) {
  65. if(this.utils.isLogin()){
  66. return {
  67. title: this.item.diseaseName,
  68. imageUrl: this.logoimg //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  69. }
  70. }
  71. },
  72. methods:{
  73. getDiseaseById(){
  74. let data = {diseaseId:this.diseaseId};
  75. getDiseaseById(data).then(
  76. res => {
  77. if(res.code==200){
  78. this.item=res.data;
  79. }else{
  80. uni.showToast({
  81. icon:'none',
  82. title: "请求失败",
  83. });
  84. }
  85. },
  86. rej => {}
  87. );
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. page{
  94. height: 100%;
  95. }
  96. .content{
  97. }
  98. .detail-cont{
  99. margin: 20rpx;
  100. padding: 15rpx;
  101. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  102. background-color: #fff;
  103. border-radius: 15rpx;
  104. .title-box{
  105. width: 100%;
  106. display: flex;
  107. justify-content: flex-start;
  108. align-items: center;
  109. .line{
  110. width: 6rpx;
  111. height:30rpx;
  112. background-color: #2BC7B9;
  113. }
  114. .title{
  115. margin-left: 15rpx;
  116. font-size: 32upx;
  117. font-family: PingFang SC;
  118. font-weight: bold;
  119. color: #333;
  120. }
  121. }
  122. .desc{
  123. margin-top: 15rpx;
  124. margin-bottom: 15rpx;
  125. font-size: 28upx;
  126. font-family: PingFang SC;
  127. color: #9a9a9c;
  128. }
  129. }
  130. </style>