notice-detail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!-- 新闻 详情 -->
  2. <template>
  3. <view class="container">
  4. <!-- #ifdef H5 -->
  5. <!-- 顶部自定义导航 -->
  6. <tn-nav-bar fixed :bottomShadow="false" backTitle=" ">
  7. <view class="">
  8. <text class="tn-text-lg">公告</text>
  9. <text class="tn-text-xl tn-padding-left-sm tn-icon-group-circle"></text>
  10. </view>
  11. </tn-nav-bar>
  12. <!-- #endif -->
  13. <view>
  14. <view style="background-color: #FFFFFF;padding: 30rpx 30rpx 30rpx 30rpx;">
  15. <view class="titleBox text-xl text-black text-bold">{{newsData.name}}</view>
  16. <view class="flex justify-between text-df text-gray margin-top-sm margin-bottom-sm">
  17. <text>{{newsData.create_time_text}}</text>
  18. <!-- <text>{{newsData.type | typeF}}</text> -->
  19. </view>
  20. <!-- <image mode="widthFix" :src="newsData.img"></image> -->
  21. <!-- 中间文章区域 -->
  22. <view class="contentBox text-lg text-black margin-top-sm margin-tb-lg">
  23. <view class="margin-top-sm" v-html="newsData.contents">
  24. </view>
  25. <!-- <view class="margin-top-sm" v-for="(item, index) in newsData.contents.split('&')" v-html="item">
  26. </view> -->
  27. </view>
  28. </view>
  29. </view>
  30. <view class="cu-bar bg-white tabbar border shop bottomBox">
  31. <!-- <button class="action" open-type="share">
  32. <view class="cuIcon-share text-green">
  33. <view class="cu-tag badge">{{newsData.commentNum}}</view>
  34. </view>
  35. 返回
  36. </button> -->
  37. <!-- <button class="action" open-type="contact">
  38. <view class="cuIcon-service text-green">
  39. <view class="cu-tag badge"></view>
  40. </view>
  41. 联系我们
  42. </button> -->
  43. <view class="btn-group">
  44. <!-- <button style="width: 80%;height: 70rpx;" @click="handleClick()"
  45. class="cu-btn bg-gradual-blue round shadow-blur">
  46. <view class="cuIcon-appreciatefill text-white margin-right-xs"></view>
  47. 前往
  48. </button> -->
  49. <tn-button shape="round" backgroundColor="#5677fc" padding="30rpx 0" width="200rpx" shadow @click="handleBack()" fontBold plain>
  50. <text class="primary-color">返回列表</text>
  51. </tn-button>
  52. <tn-button shape="round" backgroundColor="#5677fc" padding="30rpx 0" width="200rpx" shadow @click="handleGo()" v-if="newsData && newsData.front_info" fontBold>
  53. <text class="tn-color-white">点击前往</text>
  54. </tn-button>
  55. </view>
  56. </view>
  57. <view class="safe-area-inset-bottom"></view>
  58. </view>
  59. </template>
  60. <script>
  61. import noticeApi from "@/common/api/notice.js"
  62. export default {
  63. data() {
  64. return {
  65. newsData: [],
  66. requestStatus: false // 事件防抖
  67. }
  68. },
  69. onLoad(option) {
  70. console.log(option)
  71. this.getData(option.id);
  72. },
  73. methods: {
  74. // 获取详情
  75. getData(id) {
  76. console.log(id);
  77. noticeApi.getNoticeDetail(this, {id: id}).then(res => {
  78. if (res && res.data) {
  79. this.newsData = res.data
  80. }
  81. })
  82. },
  83. handleBack() {
  84. this.utils.goto('notice-list')
  85. },
  86. handleGo() {
  87. if (this.newsData && this.newsData.front_info) {
  88. this.utils.goto(this.newsData.front_info.full_url)
  89. }
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang="scss">
  95. button::after {
  96. border: none;
  97. background: transparent;
  98. }
  99. uni-button {
  100. background: transparent;
  101. }
  102. .container {
  103. background-color: #f2f2f2;
  104. width: 750rpx;
  105. }
  106. .solid {
  107. border-radius: 50rpx;
  108. text-indent: 12rpx;
  109. }
  110. image {
  111. width: 750rpx;
  112. }
  113. .bottomBox {
  114. width: 750rpx;
  115. position: fixed;
  116. left: 0;
  117. bottom: 0rpx;
  118. }
  119. .primary-color {
  120. color: #5677fc;
  121. }
  122. </style>