detail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="content">
  3. <nav-bar title="新闻详情"></nav-bar>
  4. <view class="headerBox">
  5. <view class="title">{{ listData.title }}</view>
  6. <view class="time">
  7. 发布时间:{{ $method.formDate(listData.createTime, "yyyy/mm/dd") }}
  8. </view>
  9. </view>
  10. <view
  11. class="ql-editor html_content"
  12. style="white-space: pre-wrap; height: auto;padding-bottom: 30px;"
  13. v-html="listData.titleContent"
  14. ></view>
  15. <!-- <view class="content">
  16. <view v-if="detail.mobileDetailHtml" v-html="detail.mobileDetailHtml"
  17. style="width: 100%; overflow: hidden"></view>
  18. </view> -->
  19. </view>
  20. </template>
  21. <script>
  22. // import "quill/dist/quill.core.css";
  23. import {
  24. mapGetters
  25. } from "vuex";
  26. export default {
  27. data() {
  28. return {
  29. listData:{},
  30. };
  31. },
  32. onLoad(option) {
  33. uni.hideTabBar();
  34. // console.log(option,987)
  35. this.init(option.id);
  36. },
  37. onShow() {
  38. },
  39. methods: {
  40. init(id) {
  41. this.$api
  42. .consultationdetails(id)
  43. .then(res => {
  44. if(res.data.code==200){
  45. this.listData =res.data.data;
  46. }
  47. // this.list = res.rows;
  48. // this.total = res.total;
  49. })
  50. .finally(() => {
  51. });
  52. },
  53. },
  54. };
  55. </script>
  56. <style>
  57. .html_content {
  58. padding: 20rpx;;
  59. img {
  60. max-width: 100% !important;
  61. height: auto !important;
  62. }
  63. }
  64. .headerBox {
  65. padding: 20rpx 40rpx 0rpx;
  66. }
  67. .title {
  68. font-size: 32rpx;
  69. color: #222;
  70. font-weight: bold;
  71. margin: 30rpx 0rpx;
  72. text-align: center;
  73. border-bottom: 1rpx solid #eee;
  74. padding-bottom: 40rpx;
  75. }
  76. .time {
  77. text-align: center;
  78. margin: 10rpx 0rpx;
  79. color: #333;
  80. font-size: 24rpx;
  81. }
  82. .last_next {
  83. border-top: 1rpx dashed #eee;
  84. padding: 30rpx 30rpx 50rpx;
  85. & > p {
  86. cursor: pointer;
  87. user-select: none;
  88. margin-top: 30rpx;
  89. font-size: 24rpx;
  90. color: #666;
  91. display: flex;
  92. align-items: center;
  93. & > span {
  94. flex-shrink: 0;
  95. &:last-child {
  96. flex: 1;
  97. overflow: hidden;
  98. white-space: nowrap;
  99. text-overflow: ellipsis;
  100. margin-left: 24rpx;
  101. }
  102. }
  103. }
  104. }
  105. </style>