|
@@ -43,12 +43,13 @@ export const useExhibitionStore = defineStore({
|
|
|
if (this.pagination.pageNum === 1) {
|
|
|
this.lists = [];
|
|
|
}
|
|
|
- const { records, total, current, page } = data.data;
|
|
|
+ const { records, total, current, pages } = data.data;
|
|
|
const templists = this.lists.concat(records);
|
|
|
this.lists = templists;
|
|
|
this.total = total;
|
|
|
this.pagination.current = current;
|
|
|
- this.pagination.page = page;
|
|
|
+ this.pagination.pages = pages;
|
|
|
+ this.isLoadMoreLock = false;
|
|
|
return Promise.resolve(0);
|
|
|
} else {
|
|
|
this.lists = [];
|
|
@@ -95,11 +96,12 @@ export const useExhibitionStore = defineStore({
|
|
|
async loadMore(type) {
|
|
|
if (!this.isLoadMoreLock && !this.isLast) {
|
|
|
this.isLoadMoreLock = true;
|
|
|
- this.pagination.type = type;
|
|
|
+ this.pagination.type = type === "all" ? "" : type;
|
|
|
const page =
|
|
|
this.pagination.pageNum < this.pagination.pages
|
|
|
? this.pagination.pageNum + 1
|
|
|
: this.pagination.pages;
|
|
|
+
|
|
|
this.pagination.pageNum = page;
|
|
|
|
|
|
return await this.fetch();
|