index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="bg-F5">
  3. <div class="container">
  4. <tab
  5. class="tab"
  6. :titles="`${$t(`page.views.news.details.titles`)}`"
  7. :currIndex.sync="currIndex"
  8. />
  9. <load-more
  10. url="/interface/notice/getNoticeListAll"
  11. :params="params"
  12. v-slot="{ item }"
  13. >
  14. <div class="item">
  15. <div class="dateDiv">
  16. <div class="day">{{ getDateformat(item.createTime, "dd") }}</div>
  17. <div>{{ getDateformat(item.createTime, "YYYY-mm") }}</div>
  18. </div>
  19. <router-link class="conDiv" :to="`/newsDetail/${item.noticeId}`">
  20. <div class="tit">{{ item.noticeTitle }}</div>
  21. <div class="detail">
  22. <div class="desc">{{ item.noticeOutline }}</div>
  23. <span class="xq"
  24. >{{ $t("page.views.news.index.details")
  25. }}<i class="el-icon-d-arrow-right"></i
  26. ></span>
  27. </div>
  28. </router-link>
  29. </div>
  30. </load-more>
  31. </div>
  32. </div>
  33. </template>
  34. <script lang="ts">
  35. import { Component, Vue, Watch, Prop } from "vue-property-decorator";
  36. import { Dateformat } from "@/utils";
  37. @Component
  38. export default class extends Vue {
  39. @Prop(String) private index!: string;
  40. private currIndex: number = 0;
  41. private params: IAny | null = null;
  42. @Watch("index", { immediate: true })
  43. indexChange(index: string) {
  44. this.currIndex = Number(index) || 0;
  45. this.currIndexChange();
  46. }
  47. @Watch("currIndex")
  48. currIndexChange() {
  49. this.params = { noticeType: this.currIndex + 1 };
  50. }
  51. getDateformat(date: string, fmt: string) {
  52. return Dateformat(date, fmt);
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .item {
  58. width: 100%;
  59. min-height: 7rem;
  60. position: relative;
  61. padding-left: 7rem;
  62. margin-top: 2rem;
  63. box-sizing: border-box;
  64. .dateDiv {
  65. height: 8rem;
  66. width: 8rem;
  67. color: #fff;
  68. text-align: center;
  69. background: #fd5522;
  70. border-radius: 0.5rem;
  71. position: absolute;
  72. left: 0;
  73. top: 0;
  74. > div {
  75. font-size: 1.6rem;
  76. height: 2.8rem;
  77. line-height: 2.8rem;
  78. }
  79. .day {
  80. height: 5rem;
  81. line-height: 5rem;
  82. font-size: 2.5em;
  83. font-weight: bolder;
  84. border-bottom: 0.1rem solid #fff;
  85. }
  86. }
  87. .conDiv {
  88. // width: 100%;
  89. display: block;
  90. height: 100%;
  91. padding: 0 1rem;
  92. background: #fff;
  93. box-shadow: 2px 2px 12px #ddd;
  94. box-sizing: border-box;
  95. border-radius: 0.3rem;
  96. margin-left: 3.5rem;
  97. .tit {
  98. height: 3rem;
  99. line-height: 3rem;
  100. font-size: 1.6rem;
  101. font-weight: bolder;
  102. }
  103. .detail {
  104. height: 5rem;
  105. line-height: 1.6rem;
  106. div {
  107. height: 3.2rem;
  108. line-height: 1.6rem;
  109. font-size: 1.2rem;
  110. color: #666;
  111. word-break: break-all;
  112. overflow: hidden;
  113. text-overflow: ellipsis;
  114. white-space: normal;
  115. display: -webkit-box;
  116. -webkit-line-clamp: 2;
  117. -webkit-box-orient: vertical;
  118. }
  119. .xq {
  120. color: #fd5522;
  121. margin-left: 1rem;
  122. font-size: 14px;
  123. }
  124. }
  125. }
  126. }
  127. </style>