diseaseDetails.vue 3.0 KB

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