| | |
| | | <!-- 新闻内容 --> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <hr class="namehr" /> |
| | | <el-col :span="24"> |
| | | <div> |
| | | <el-row class="marb10" :key="index" v-for="(item, index) in newsList"> |
| | |
| | | </div> |
| | | <!-- 分页 --> |
| | | <div class="fenye"> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange" |
| | | :current-page.sync="currentPage" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="total"> |
| | | </el-pagination> |
| | | <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination> |
| | | </div> |
| | | </el-col> |
| | | </el-card> |
| | |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | item: {} |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0]; |
| | | this.getnews(this.menuList[0]); |
| | | this.item = this.menuList[0] |
| | | this.getnews(this.menuList[0]) |
| | | } |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(val) { |
| | | console.log(`当前页: ${val}`); |
| | | this.getnews(this.item); |
| | | console.log(`当前页: ${val}`) |
| | | this.getnews(this.item) |
| | | }, |
| | | getTitle(){ |
| | | const data = Number(this.$route.query.id); |
| | | getMinTitle(data).then(res => { |
| | | console.log(res); |
| | | const data = Number(this.$route.query.id) |
| | | getMinTitle(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.menuList = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | changeMenu(val) { |
| | | this.cont = val.name |
| | | this.item = val |
| | | this.currentPage = 1 |
| | | this.getnews(val); |
| | | this.getnews(val) |
| | | }, |
| | | getnews(item){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | // 跳转到新闻展示页面 |