index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <el-col
  10. :span="24"
  11. class="newsList"
  12. v-for="(item, index) in newsList"
  13. :key="index"
  14. @click.native="$router.push({ path: '/meetingBrief/detail', query: { type: item.type, id: item.id } })"
  15. >
  16. <el-col :span="24" class="zjjs" v-if="item.type === '4'">
  17. <el-col :span="24" class="image">
  18. <el-image :src="item.filedir" style="max-width:100%;max-height: 100%;"></el-image>
  19. </el-col>
  20. <el-col :span="24" class="text">
  21. <p class="title textOver">{{ item.title }}</p>
  22. </el-col>
  23. </el-col>
  24. <el-col :span="24" v-else>
  25. <el-col :span="8" class="image">
  26. <el-image :src="item.filedir"></el-image>
  27. </el-col>
  28. <el-col :span="16" class="text">
  29. <p class="title textOver">{{ item.title }}</p>
  30. <p class="type">
  31. {{
  32. item.type == '0'
  33. ? '会议简介'
  34. : item.type == '1'
  35. ? '会议日程'
  36. : item.type == '2'
  37. ? '主办方介绍'
  38. : item.type == '3'
  39. ? '协办方介绍'
  40. : item.type == '4'
  41. ? '专家介绍'
  42. : item.type == '5'
  43. ? '继续教育学分申请'
  44. : item.type == '6'
  45. ? '温馨提示'
  46. : '暂无'
  47. }}
  48. </p>
  49. <p class="time">发布时间:{{ item.publish_time }}</p>
  50. </el-col>
  51. </el-col>
  52. </el-col>
  53. </el-col>
  54. </el-col>
  55. </el-row>
  56. </div>
  57. </template>
  58. <script>
  59. import { mapState, createNamespacedHelpers } from 'vuex';
  60. import NavBar from '@/layout/common/topInfo.vue';
  61. const { mapActions: news } = createNamespacedHelpers('news');
  62. export default {
  63. name: 'index',
  64. props: {},
  65. components: {
  66. NavBar,
  67. },
  68. data: function() {
  69. return {
  70. // 头部标题
  71. title: '',
  72. // meta为true
  73. isleftarrow: '',
  74. // 返回
  75. navShow: true,
  76. newsList: [],
  77. };
  78. },
  79. created() {
  80. this.search();
  81. this.getTitle();
  82. },
  83. methods: {
  84. ...news({ newsquery: 'query' }),
  85. getTitle() {
  86. if (this.type === '0') {
  87. this.title = '会议简介';
  88. } else if (this.type === '1') {
  89. this.title = '会议日程';
  90. } else if (this.type === '2') {
  91. this.title = '主办方介绍';
  92. } else if (this.type === '3') {
  93. this.title = '协办方介绍';
  94. } else if (this.type === '4') {
  95. this.title = '专家介绍';
  96. } else if (this.type === '6') {
  97. this.title = '温馨提示';
  98. } else if (this.type === '7') {
  99. this.title = '联系客服';
  100. }
  101. },
  102. async search() {
  103. let res = await this.newsquery({ type: this.type });
  104. if (this.$checkRes(res)) {
  105. this.$set(this, `newsList`, res.data);
  106. }
  107. },
  108. },
  109. computed: {
  110. ...mapState(['user']),
  111. type() {
  112. return this.$route.query.type;
  113. },
  114. pageTitle() {
  115. return `${this.$route.meta.title}`;
  116. },
  117. },
  118. mounted() {
  119. //this.title = this.$route.meta.title;
  120. this.isleftarrow = this.$route.meta.isleftarrow;
  121. },
  122. };
  123. </script>
  124. <style lang="less" scoped>
  125. .style {
  126. width: 100%;
  127. min-height: 667px;
  128. position: relative;
  129. background-color: #f9fafc;
  130. }
  131. .top {
  132. height: 46px;
  133. overflow: hidden;
  134. position: relative;
  135. z-index: 999;
  136. }
  137. .main {
  138. min-height: 570px;
  139. .newsList {
  140. margin: 10px;
  141. border-bottom: 1px dashed #ccc;
  142. width: 95%;
  143. .zjjs {
  144. float: left;
  145. width: 50%;
  146. height: 161px;
  147. }
  148. .image {
  149. height: 120px;
  150. .el-image {
  151. border-radius: 10px;
  152. }
  153. }
  154. .text {
  155. padding: 0 10px;
  156. .title {
  157. padding: 10px 0;
  158. }
  159. .type {
  160. font-size: 14px;
  161. color: #ccc;
  162. padding: 5px 0;
  163. }
  164. .time {
  165. font-size: 14px;
  166. color: #ccc;
  167. padding: 5px 0;
  168. }
  169. }
  170. }
  171. }
  172. </style>