detailPage.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="box">
  3. <u-navbar is-back :border-bottom="false" :title="title"></u-navbar>
  4. <view class="content_msg">
  5. <text class="text1">{{msg.title}}</text>
  6. <text class="text2">{{msg.created_at}}</text>
  7. <view class="content">
  8. <u-parse :html="msg.content || '' "></u-parse>
  9. </view>
  10. </view>
  11. <view class="mim-view-list"></view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. title: '',
  19. msg: {},
  20. form: {
  21. id: '',
  22. }
  23. };
  24. },
  25. onLoad(options) {
  26. this.form.id = options.id
  27. switch (options.type) {
  28. case '2': //罗山新闻
  29. this.title = "罗山新闻详情"
  30. break;
  31. case '3': //罗山县情
  32. this.title = "罗山县情详情"
  33. break;
  34. case '4': //发展动态
  35. this.title = "发展动态详情"
  36. break;
  37. case '5': //营商环境
  38. this.title = "营商环境详情"
  39. break;
  40. case '6': //全域旅游
  41. this.title = "全域旅游详情"
  42. break;
  43. default: //公告版
  44. this.title = "公告详情"
  45. break;
  46. }
  47. this.infoDetailsFn()
  48. },
  49. methods: {
  50. async infoDetailsFn() {
  51. const res = await this.$u.api.infoDetails(this.form)
  52. if (res.status === "success") {
  53. this.msg = res.data
  54. }
  55. },
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. .box {
  61. background: #F7F7F7;
  62. min-height: 100vh;
  63. .content_msg {
  64. /* 去掉内部滚动条 */
  65. scrollbar-width: none;
  66. -ms-overflow-style: none;
  67. /* 兼容webkit内核浏览器 */
  68. ::-webkit-scrollbar {
  69. display: none;
  70. }
  71. padding: 32rpx;
  72. box-sizing: border-box;
  73. margin: 24rpx;
  74. // width: 91.5%;
  75. background: white;
  76. display: flex;
  77. flex-direction: column;
  78. border-radius: 12rpx;
  79. /deep/ .content {
  80. text-align: justify !important;
  81. text-justify: distribute-all-lines !important;
  82. // text-align-last: justify !important;
  83. }
  84. .text1 {
  85. font-size: 32upx;
  86. font-family: PingFang SC-粗体, PingFang SC;
  87. font-weight: normal;
  88. color: #3D3D3D;
  89. text-align: justify;
  90. text-justify: distribute-all-lines;
  91. }
  92. .text2 {
  93. padding-top: 16upx;
  94. padding-bottom: 24upx;
  95. font-size: 28upx;
  96. font-family: Arial-Regular, Arial;
  97. font-weight: 400;
  98. color: #999999;
  99. }
  100. .text3 {
  101. font-size: 28upx;
  102. font-family: PingFang SC-中等, PingFang SC;
  103. font-weight: normal;
  104. color: #3D3D3D;
  105. padding-top: 24upx;
  106. }
  107. }
  108. }
  109. </style>