news_detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666"></navbar>
  4. <view class="detail">
  5. <view class="title">
  6. {{detail.informationTitle}}
  7. </view>
  8. <view class="postMessage">
  9. <text>{{detail.informationTypeName}}</text>
  10. <text>{{detail.createTime}}</text>
  11. <!-- <view>
  12. <view class="">
  13. <text class="iconfont2 icon-img">&#xe643;</text>
  14. <text>发布者:{{detail.informationTypeName}}</text>
  15. </view>
  16. <view class="">
  17. <text class="iconfont2 icon-img">&#xe66c;</text>
  18. <text>{{detail.createTime}}</text>
  19. </view>
  20. </view>
  21. <view @click="shareHandler">
  22. <text class="iconfont2 icon-img">&#xe615;</text>
  23. <text>分享</text>
  24. </view> -->
  25. </view>
  26. <view class="content">
  27. <view class="ql-editor-box" v-html="detail.informationContent">
  28. </view>
  29. <!-- <u-parse :domain="$mConfig.imgURL" :html="detail.informationContent"></u-parse> -->
  30. </view>
  31. <!-- <view class="browse">
  32. <view class="look-box">
  33. <text class="iconfont3 look-icon">&#xe63b;</text>
  34. <text>浏览量:{{detail.browse_sum||0}}</text>
  35. </view>
  36. </view> -->
  37. </view>
  38. <!-- <view class="footer-box">
  39. <view class="btn" @click="openKongKim" v-if="detail.jumpType !== null || detail.jumpType !== undefined">
  40. <text v-if="detail.jumpType == 2">{{detail.resourceModelTitle || '一键前往'}}</text>
  41. <text v-else>一键前往</text>
  42. </view>
  43. <view class="footer-tools">
  44. <view>
  45. <text class="iconfont3 look-icon">&#xe63b;</text>
  46. <text>{{detail.browseNum||0}}</text>
  47. </view>
  48. </view>
  49. </view> -->
  50. <!-- <share ref="shares" :contentHeight="580"></share> -->
  51. </view>
  52. </template>
  53. <script>
  54. import { newsDetial } from '@/api/government.js';
  55. import share from "@/pages/public/share";
  56. import rate from "@/components/rate.vue"
  57. export default {
  58. components: {
  59. share,
  60. rate
  61. },
  62. data() {
  63. return {
  64. config: {
  65. back: true,
  66. title: '资讯详情',
  67. color: '#1A1A1A',
  68. backgroundColor: [1, "#fff"],
  69. statusBarFontColor: '#1A1A1A',
  70. leftSlot: true
  71. },
  72. detail: {}
  73. }
  74. },
  75. onLoad(options) {
  76. if (options && options.informationId) {
  77. this.getDetail(options.informationId)
  78. }
  79. },
  80. methods: {
  81. getDetail(id) {
  82. newsDetial(id).then(res => {
  83. if (res.code === 200) {
  84. this.detail = res.data
  85. }
  86. })
  87. },
  88. openKongKim() {
  89. this.$openPage(this.detail)
  90. },
  91. // shareHandler() {
  92. // if (!token) {
  93. // uni.navigateTo({
  94. // url: "/pages/login/index",
  95. // });
  96. // } else {
  97. // // 咨询分享
  98. // // this.$http.post(`/information/share/${this.detail.id}`).then(res => {})
  99. // this.$nextTick(() => {
  100. // this.$refs.shares.shareInfo("/?&shareId=" + user.id, null, null, null, null, this.detail.id);
  101. // });
  102. // }
  103. // },
  104. }
  105. }
  106. </script>
  107. <style>
  108. page {
  109. background: #fff;
  110. }
  111. </style>
  112. <style lang="scss" scoped>
  113. .container {
  114. // padding-bottom: 100rpx;
  115. }
  116. .detail {
  117. padding: 42rpx 30rpx 40rpx 30rpx;
  118. // margin: 30rpx;
  119. background-color: #fff;
  120. border-radius: 20rpx;
  121. .title {
  122. margin-bottom: 40rpx;
  123. font-size: 35rpx;
  124. font-family: PingFang SC, PingFang SC-Bold;
  125. font-weight: 700;
  126. color: #1a1a1a;
  127. line-height: 56rpx;
  128. letter-spacing: -0.7rpx;
  129. }
  130. .postMessage {
  131. display: flex;
  132. align-items: center;
  133. // justify-content: space-between;
  134. padding: 0 10rpx;
  135. margin-bottom: 30rpx;
  136. font-size: 26rpx;
  137. font-family: PingFang SC, PingFang SC-Medium;
  138. font-weight: 500;
  139. color: #999999;
  140. text {
  141. margin-right: 30rpx;
  142. }
  143. & view {
  144. display: flex;
  145. align-items: center;
  146. width: 50%;
  147. text:last-child {
  148. flex: 1;
  149. overflow: hidden;
  150. white-space: nowrap;
  151. text-overflow: ellipsis;
  152. }
  153. // margin-right: 50rpx;
  154. }
  155. .mb20 {
  156. margin-bottom: 20rpx;
  157. }
  158. .icon-img {
  159. margin-right: 8rpx;
  160. color: #FA6138;
  161. font-size: 36rpx;
  162. }
  163. }
  164. .look-box {
  165. display: flex;
  166. align-items: center;
  167. .look-icon {
  168. font-size: 36rpx;
  169. margin-right: 8rpx;
  170. margin-top: 8rpx;
  171. }
  172. }
  173. * {
  174. word-break: break-all;
  175. }
  176. .content /deep/ img {
  177. max-width: 100%;
  178. }
  179. .content /deep/ .ql-align-center {
  180. text-align: center;
  181. }
  182. .content /deep/ .ql-align-right {
  183. text-align: right;
  184. }
  185. .content /deep/ blockquote {
  186. display: block;
  187. border-left: 8px solid #d0e5f2;
  188. padding: 5px 10px;
  189. margin: 10px 0;
  190. line-height: 1.4;
  191. font-size: 100%;
  192. background-color: #f1f1f1;
  193. }
  194. .content /deep/ .ql-indent-1 {
  195. margin-left: 60rpx;
  196. }
  197. .content /deep/ .ql-indent-2 {
  198. margin-left: 120rpx;
  199. }
  200. .content /deep/ .ql-indent-3 {
  201. margin-left: 180rpx;
  202. }
  203. .content /deep/ .ql-indent-4 {
  204. margin-left: 240rpx;
  205. }
  206. .content /deep/ .ql-indent-5 {
  207. margin-left: 300rpx;
  208. }
  209. .content {
  210. /deep/ .ql-editor-box {
  211. .ql-video {
  212. width: 100%;
  213. // height: 45vw;
  214. }
  215. }
  216. }
  217. .browse {
  218. margin-top: 30rpx;
  219. font-size: 24rpx;
  220. font-family: PingFang SC, PingFang SC-Medium;
  221. font-weight: 500;
  222. color: #999999;
  223. view {
  224. display: flex;
  225. align-items: center;
  226. }
  227. .icon-img {
  228. margin-right: 8rpx;
  229. color: #FA6138;
  230. font-size: 36rpx;
  231. }
  232. }
  233. }
  234. .footer-box {
  235. position: fixed;
  236. left: 0;
  237. bottom: 0;
  238. width: 100%;
  239. padding: 30rpx;
  240. display: flex;
  241. justify-content: space-between;
  242. align-items: center;
  243. background-color: #fff;
  244. box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .1);
  245. }
  246. .btn {
  247. max-width: 400rpx;
  248. padding: 0 20rpx;
  249. line-height: 60rpx;
  250. text-align: center;
  251. color: #fff;
  252. background-color: #3775F6;
  253. border-radius: 8rpx;
  254. overflow: hidden;
  255. text-overflow: ellipsis;
  256. white-space: nowrap;
  257. }
  258. .footer-tools {
  259. flex-shrink: 0;
  260. .look-icon {
  261. margin-right: 4rpx;
  262. font-size: 40rpx;
  263. }
  264. &>view {
  265. display: flex;
  266. align-items: center;
  267. font-size: 30rpx;
  268. }
  269. }
  270. </style>