移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

workDetail.vue 2.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. :title="title"
  5. fixed
  6. placeholder
  7. left-arrow
  8. @click-left="onClickLeft"
  9. />
  10. <div class="listBox">
  11. <p class="title">{{detail.title}}</p>
  12. <p class="wordForm">{{detail.createBy}}<span>{{detail.newsTime}} 发布</span></p>
  13. <div id="content"></div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { newsDetail } from "@/api/lawEnforcement/index";
  19. import law from "@/components/common/law_footer";
  20. export default {
  21. name: "index",
  22. components: {
  23. law
  24. },
  25. data() {
  26. return {
  27. //是否显示加载
  28. loading: false,
  29. //是否滚动到底部
  30. finished: false,
  31. //查询参数
  32. queryParams: {
  33. pageNum: 1,
  34. pageSize: 5,
  35. deptId:100,
  36. number:2
  37. },
  38. //新闻集合
  39. newList:[],
  40. //轮播图集合
  41. bannerList:'',
  42. title:'',
  43. detail:[]
  44. };
  45. },
  46. created() {
  47. var type = this.$route.query.type ;
  48. if (type == 'work'){
  49. this.queryParams.number = '003'
  50. this.title = '工作动态'
  51. this.goDetail();
  52. }
  53. if (type == 'notice'){
  54. this.queryParams.number = '001'
  55. this.title = '通知公告'
  56. this.goDetail();
  57. }
  58. if (type == 'enforcement'){
  59. this.queryParams.number = '002'
  60. this.title = '执法依据'
  61. this.goDetail();
  62. }
  63. },
  64. methods: {
  65. goDetail(){
  66. newsDetail(this.$route.query.id).then(response => {
  67. console.log(response)
  68. this.detail = response.data
  69. document.getElementById('content').innerHTML = response.data.content;
  70. var imgs=document.getElementsByTagName('img');
  71. console.log(imgs)
  72. for(var i=0;i<imgs.length;i++){
  73. imgs[i].setAttribute('width','100%');
  74. }
  75. });
  76. }
  77. },
  78. };
  79. </script>
  80. <style scoped lang="scss">
  81. @font-face {
  82. font-family: SourceHanSansCNBold;
  83. src: url("../../../assets/fonts/SourceHanSansCN-Bold.otf");
  84. }
  85. .wid100{
  86. width: 100%;
  87. }
  88. .app-container {
  89. padding: 10PX ;
  90. }
  91. /deep/ .van-nav-bar--fixed{
  92. background: url("../../../../static/images/lawEnforcement/head_bg.png") 100%;
  93. }
  94. /deep/ .van-nav-bar .van-icon{
  95. color: #ffffff;
  96. }
  97. /deep/ .van-nav-bar__title{
  98. color: #ffffff;
  99. }
  100. .title{
  101. font-size: 22PX;
  102. font-family: SourceHanSansCNBold;
  103. text-align: center;
  104. }
  105. .wordForm{
  106. text-align: center;
  107. margin: 15PX 0 20PX;
  108. span{
  109. color: #C9C9C9;
  110. margin-left: 10PX;
  111. }
  112. }
  113. .listBox{
  114. border-radius: 8Px;
  115. overflow: hidden;
  116. box-shadow: 0PX 5PX 5PX #cccccc;
  117. background: #ffffff;
  118. padding: 30PX 10PX;
  119. }
  120. </style>