1
PC-20250623MANY\Administrator
2025-07-13 f7a99184725f7ea0884cf478f169aad4e5b6583c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
  <div class="new_list">
    <page-head :title="$t('hj6')"></page-head>
 
    <news-item v-for="item in newsList" :key="item.id" :item="item"></news-item>
 
    <van-skeleton
      :row="10"
      v-if="newsList.length == 0"
      style="margin-top: 1em;"
    />
 
    <n-pagination
      :pageNo.sync="pageNum"
      :pageSize="pageSize"
      :total="total"
    ></n-pagination>
  </div>
</template>
 
<script>
import PageHead from "@/components/pageHead.vue";
import NewsItem from "./components/newsItem.vue";
import nPagination from "@/components/nPagination.vue";
import * as api from "@/axios/api";
 
export default {
  name: "newList",
  components: {
    PageHead,
    NewsItem,
    nPagination
  },
  data() {
    return {
      pageNum: 1,
      pageSize: 10,
      total: 0,
      newsList: []
    };
  },
  watch: {
    pageNum() {
      this.newsList = [];
      this.getNewsList();
    }
  },
  created() {
    this.getNewsList();
  },
  methods: {
    // 获取新闻列表
    async getNewsList() {
      let options = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        type: 1
      };
      let data = await api.getNewsList(options);
 
      this.newsList = data.data.list;
      this.total = data.data.total;
    }
  }
};
</script>
 
<style lang="less" scoped>
.new_list {
  font-size: 10vw;
  width: 100%;
  background-color: #fff;
  min-height: 100vh;
  padding-bottom: 0.1em;
}
</style>