You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.9 KiB
76 lines
1.9 KiB
<template>
|
|
<div class="pa-3 white fill-height d-flex flex-column">
|
|
<banner-search @getListData="getListData" />
|
|
<banner-date :phone="true" :lists="lists" :pagination="pagination" @getListData="getListData" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import BannerSearch from 'components/Banner/BannerSearch.vue';
|
|
import BannerDate from 'components/Banner/BannerDate.vue';
|
|
import { queryCarousel } from 'config/api';
|
|
|
|
export default {
|
|
name: 'BannerManage',
|
|
components: {
|
|
BannerSearch,
|
|
BannerDate,
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
str: '轮播图管理界面',
|
|
lists: {},
|
|
pagination: { current: 1, pageSize: 10 },
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
paramData: {
|
|
showPage: '',
|
|
jumpType: 0,
|
|
recStatus: 0,
|
|
},
|
|
};
|
|
},
|
|
|
|
created() {
|
|
this.getListData();
|
|
},
|
|
|
|
methods: {
|
|
// 获取轮播图列表
|
|
async getListData(condition) {
|
|
try {
|
|
if (condition && condition.current) {
|
|
this.pageNum = condition.current;
|
|
this.pageSize = condition.pageSize;
|
|
} else if (condition && !condition.pageNum) {
|
|
this.paramData = condition;
|
|
}
|
|
const params = {
|
|
param: {
|
|
showPage: this.paramData.showPage,
|
|
jumpType: this.paramData.jumpType,
|
|
recStatus: this.paramData.recStatus,
|
|
pageNum: this.pageNum,
|
|
pageSize: this.pageSize,
|
|
},
|
|
};
|
|
const res = await queryCarousel(params);
|
|
const { code, msg, data } = res.data;
|
|
if (code === 200) {
|
|
this.lists = data;
|
|
const paper = { ...this.pagination };
|
|
paper.current = data.pageNum;
|
|
paper.total = +data.total;
|
|
paper.pageSize = data.pageSize;
|
|
this.pagination = paper;
|
|
} else {
|
|
throw msg || '获取失败';
|
|
}
|
|
} catch (error) {
|
|
this.$message.error(error);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|