yc-news.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666"></navbar>
  4. <view class="detail">
  5. <view class="title">
  6. {{detail.title}}
  7. </view>
  8. <view class="postMessage">
  9. <text>{{detail.author}}</text>
  10. <text>{{detail.published}}</text>
  11. </view>
  12. <view class="content">
  13. <view class="ql-editor-box" v-html="content">
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import img from '../../common/img';
  21. export default {
  22. data() {
  23. return {
  24. config: {
  25. back: true,
  26. title: '宜昌发布',
  27. color: '#1A1A1A',
  28. backgroundColor: [1, "#fff"],
  29. statusBarFontColor: '#1A1A1A',
  30. leftSlot: true
  31. },
  32. detail: {},
  33. content:''
  34. }
  35. },
  36. onLoad(options) {
  37. const eventChannel = this.getOpenerEventChannel();
  38. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  39. eventChannel.on('YiChangNews', res => {
  40. this.detail = res.data;
  41. const cont = res.data.content.replace(/!important/g, "");
  42. this.content = cont;
  43. })
  44. },
  45. mounted() {
  46. },
  47. methods: {
  48. }
  49. }
  50. </script>
  51. <style>
  52. page {
  53. background: #fff;
  54. }
  55. </style>
  56. <style lang="scss" scoped>
  57. ::v-deep img {
  58. max-width: 100% !important;
  59. height: auto !important;
  60. // object-fit:contain;
  61. // vertical-align: bottom;
  62. }
  63. .container {
  64. // padding-bottom: 100rpx;
  65. }
  66. .detail {
  67. padding: 42rpx 30rpx 40rpx 30rpx;
  68. // margin: 30rpx;
  69. background-color: #fff;
  70. border-radius: 20rpx;
  71. .title {
  72. margin-bottom: 40rpx;
  73. font-size: 35rpx;
  74. font-family: PingFang SC, PingFang SC-Bold;
  75. font-weight: 700;
  76. color: #1a1a1a;
  77. line-height: 56rpx;
  78. letter-spacing: -0.7rpx;
  79. }
  80. .postMessage {
  81. display: flex;
  82. align-items: center;
  83. // justify-content: space-between;
  84. padding: 0 10rpx;
  85. margin-bottom: 30rpx;
  86. font-size: 26rpx;
  87. font-family: PingFang SC, PingFang SC-Medium;
  88. font-weight: 500;
  89. color: #999999;
  90. text {
  91. margin-right: 30rpx;
  92. }
  93. & view {
  94. display: flex;
  95. align-items: center;
  96. width: 50%;
  97. text:last-child {
  98. flex: 1;
  99. overflow: hidden;
  100. white-space: nowrap;
  101. text-overflow: ellipsis;
  102. }
  103. // margin-right: 50rpx;
  104. }
  105. .mb20 {
  106. margin-bottom: 20rpx;
  107. }
  108. .icon-img {
  109. margin-right: 8rpx;
  110. color: #FA6138;
  111. font-size: 36rpx;
  112. }
  113. }
  114. .look-box {
  115. display: flex;
  116. align-items: center;
  117. .look-icon {
  118. font-size: 36rpx;
  119. margin-right: 8rpx;
  120. margin-top: 8rpx;
  121. }
  122. }
  123. * {
  124. word-break: break-all;
  125. }
  126. .content /deep/ img {
  127. max-width: 100%;
  128. }
  129. .content /deep/ .ql-align-center {
  130. text-align: center;
  131. }
  132. .content /deep/ .ql-align-right {
  133. text-align: right;
  134. }
  135. .content /deep/ blockquote {
  136. display: block;
  137. border-left: 8px solid #d0e5f2;
  138. padding: 5px 10px;
  139. margin: 10px 0;
  140. line-height: 1.4;
  141. font-size: 100%;
  142. background-color: #f1f1f1;
  143. }
  144. .content /deep/ .ql-indent-1 {
  145. margin-left: 60rpx;
  146. }
  147. .content /deep/ .ql-indent-2 {
  148. margin-left: 120rpx;
  149. }
  150. .content /deep/ .ql-indent-3 {
  151. margin-left: 180rpx;
  152. }
  153. .content /deep/ .ql-indent-4 {
  154. margin-left: 240rpx;
  155. }
  156. .content /deep/ .ql-indent-5 {
  157. margin-left: 300rpx;
  158. }
  159. .content {
  160. /deep/ .ql-editor-box {
  161. .ql-video {
  162. width: 100%;
  163. // height: 45vw;
  164. }
  165. }
  166. }
  167. .browse {
  168. margin-top: 30rpx;
  169. font-size: 24rpx;
  170. font-family: PingFang SC, PingFang SC-Medium;
  171. font-weight: 500;
  172. color: #999999;
  173. view {
  174. display: flex;
  175. align-items: center;
  176. }
  177. .icon-img {
  178. margin-right: 8rpx;
  179. color: #FA6138;
  180. font-size: 36rpx;
  181. }
  182. }
  183. }
  184. .footer-box {
  185. position: fixed;
  186. left: 0;
  187. bottom: 0;
  188. width: 100%;
  189. padding: 30rpx;
  190. display: flex;
  191. justify-content: space-between;
  192. align-items: center;
  193. background-color: #fff;
  194. box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .1);
  195. }
  196. .btn {
  197. max-width: 400rpx;
  198. padding: 0 20rpx;
  199. line-height: 60rpx;
  200. text-align: center;
  201. color: #fff;
  202. background-color: #3775F6;
  203. border-radius: 8rpx;
  204. overflow: hidden;
  205. text-overflow: ellipsis;
  206. white-space: nowrap;
  207. }
  208. .footer-tools {
  209. flex-shrink: 0;
  210. .look-icon {
  211. margin-right: 4rpx;
  212. font-size: 40rpx;
  213. }
  214. &>view {
  215. display: flex;
  216. align-items: center;
  217. font-size: 30rpx;
  218. }
  219. }
  220. </style>