readshow_1.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div id="readshow_1">
  3. <van-row>
  4. <van-col span="24" class="main">
  5. <van-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detail(item)">
  6. <van-col span="19" class="textOver title">
  7. {{ item.title }}
  8. </van-col>
  9. <van-col span="5" class="date">
  10. {{ item.publish_time }}
  11. </van-col>
  12. <van-col span="24" class="textOver orgin">
  13. 来源:<span>{{ item.origin }} </span>
  14. </van-col>
  15. <van-col span="24" class="titlejj">
  16. 简介:<span>{{ item.brief }}</span>
  17. </van-col>
  18. </van-col>
  19. </van-col>
  20. </van-row>
  21. </div>
  22. </template>
  23. <script>
  24. import { mapState, createNamespacedHelpers } from 'vuex';
  25. const { mapActions: roadShow } = createNamespacedHelpers('roadShow');
  26. export default {
  27. name: 'readshow_1',
  28. props: {},
  29. components: {},
  30. data: function() {
  31. return {
  32. list: [],
  33. };
  34. },
  35. async created() {
  36. if (this.id) await this.search();
  37. },
  38. methods: {
  39. ...roadShow(['query']),
  40. async search({ skip = 0, limit = 100, ...info } = {}) {
  41. let res = await this.query({ skip, dock_id: this.dock_id, ...info });
  42. if (this.$checkRes(res)) this.$set(this, `list`, res.data);
  43. },
  44. // 详情页面
  45. detail(data) {},
  46. },
  47. computed: {
  48. ...mapState(['user']),
  49. id() {
  50. return this.$route.query.id;
  51. },
  52. },
  53. metaInfo() {
  54. return { title: this.$route.meta.title };
  55. },
  56. watch: {
  57. test: {
  58. deep: true,
  59. immediate: true,
  60. handler(val) {},
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .main {
  67. padding: 0 5px;
  68. .list {
  69. padding: 5px 0;
  70. border-bottom: 1px dashed #ccc;
  71. .title {
  72. font-size: 16px;
  73. font-weight: bold;
  74. }
  75. .date {
  76. font-size: 14px;
  77. text-align: right;
  78. padding: 3px 0 0 0;
  79. }
  80. .orgin {
  81. font-size: 14px;
  82. padding: 5px 0;
  83. span {
  84. color: #999;
  85. }
  86. }
  87. .titlejj {
  88. font-size: 14px;
  89. overflow: hidden;
  90. text-overflow: ellipsis;
  91. -webkit-line-clamp: 2;
  92. word-break: break-all;
  93. display: -webkit-box;
  94. -webkit-box-orient: vertical;
  95. span {
  96. color: #999;
  97. }
  98. }
  99. }
  100. }
  101. </style>