首页列表

product
mhsnet 2 years ago
parent 3e7cc5c41a
commit 8ea58b80d1

@ -32,13 +32,15 @@ export default {
components: { CountTo }, components: { CountTo },
data() { data() {
return { return {
pageSize: 7,
currentPage: 1,
intervalID: undefined, intervalID: undefined,
list: [] list: []
} }
}, },
mounted: function () { mounted: function () {
this.getContractList(); this.getContractList();
//this.intervalStrat(); this.intervalStrat();
}, },
// mounted() { // mounted() {
// var date = new Date(); // var date = new Date();
@ -53,8 +55,8 @@ export default {
url: "/api/contractMobile/ContractMobile/getMobileList", url: "/api/contractMobile/ContractMobile/getMobileList",
method: "post", method: "post",
data: { data: {
currentPage: 1, currentPage: this.currentPage,
pageSize: 7, pageSize: this.pageSize,
json: "", json: "",
keyword: "", keyword: "",
sidx: "", sidx: "",
@ -62,6 +64,11 @@ export default {
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.list = res.data.list; this.list = res.data.list;
if (this.list.length === this.pageSize) {
this.currentPage = this.currentPage + 1;
} else {
this.currentPage = 1;
}
} }
}).catch(() => { }).catch(() => {
}) })
@ -69,8 +76,8 @@ export default {
intervalStrat() { intervalStrat() {
this.intervalDel(); this.intervalDel();
this.intervalID = setInterval(() => { this.intervalID = setInterval(() => {
console.log('hi'); this.getContractList();
}, 1000); }, 5000);
}, },
intervalDel() { intervalDel() {

Loading…
Cancel
Save