From 722da005a5ec126bedf752ac6bd5c5c7f6172155 Mon Sep 17 00:00:00 2001 From: fei.wang <wf18701153496@163.com> Date: 星期三, 30 四月 2025 10:52:53 +0800 Subject: [PATCH] 1.1.4 --- components/data-list/data-list.vue | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 45 insertions(+), 3 deletions(-) diff --git a/components/data-list/data-list.vue b/components/data-list/data-list.vue index 39366e8..4fb01f1 100644 --- a/components/data-list/data-list.vue +++ b/components/data-list/data-list.vue @@ -47,7 +47,9 @@ </view> </view> </view> + <!-- <page-pagination :total="pagep.totalp" layout="total,first,prev,page,next,last,limit,jumper"></page-pagination> --> </scroll-view> + <page-pagination style="position:absolute; zIndex: 9999 " :total="pagep.totalp" layout="total,first,prev,page,next,last,limit,jumper" @change="change" @sizeChange="sizeChange"></page-pagination> </view> </template> @@ -95,7 +97,7 @@ }, size: { type: [Number, String], - default: 15 + default: 10 }, loading: { type: Boolean, @@ -127,6 +129,11 @@ }, data() { return { + pagep: { + totalp: 0, + pageSizep: 10, + currentPagep: 2 + }, place:'璇疯緭鍏ョ紪鍙�', keyword:'', topheight:55, @@ -184,6 +191,38 @@ this.handleInit(); }, methods: { + change(currentPage, type) { // 褰撳墠椤垫敼鍙� + this.pagep.currentPagep = currentPage; + console.log("鐐瑰嚮浜�" + type + "锛屽綋鍓嶉〉锛�" + currentPage); + uni.showLoading({ + title: '鍔犺浇涓�' + }); + this.waiting = true; + this.$emit('load', { page: this.pagep.currentPagep, size: this.pagep.pageSizep }, res => { + + setTimeout(function () { + uni.hideLoading(); + }, 1500); + this.waiting = false; + this.loadingMask = false; + this.list = res.list; + this.total = res.total; + this.pagep.totalp = res.total; + this.currentPage++; + this.handleComputeData(); + this.computedHeight(); + }); + }, + sizeChange(pageSize) { // 姣忛〉鏉℃暟鏀瑰彉 + this.pagep.pageSizep = pageSize; + console.log("姣忛〉", pageSize, "鏉�"); + }, + changeTotal() { // 鏇存敼鎬绘潯鏁� + this.pagep.totalp = 555 + }, + changeCurrentPage() { // 鏇存敼褰撳墠椤� + this.pagep.currentPagep = 3 + }, // 鏁版嵁鍔犺浇 loadData() { this.waiting = true; @@ -192,6 +231,7 @@ this.loadingMask = false; this.list = res.list; this.total = res.total; + this.pagep.totalp = res.total; this.currentPage++; this.handleComputeData(); this.computedHeight(); @@ -241,6 +281,7 @@ this.pullDownHeight = 0; this.list = res.list; this.total = res.total; + this.pagep.totalp = res.total; this.currentPage++; this.handleComputeData(); this.computedHeight(); @@ -257,6 +298,7 @@ this.pullDownHeight = 0; this.list = res.list; this.total = res.total; + this.pagep.totalp = res.total; this.currentPage++; this.handleComputeData(); this.computedHeight(); @@ -268,10 +310,10 @@ this.getRect('.data-list-components').then(res => { // #ifdef H5 - this.componentsHeight = `calc(100vh - ${res.top}px - var(--window-top))`; + this.componentsHeight = `calc(100vh - ${res.top-200}px - var(--window-top))`; // #endif // #ifndef H5 - this.componentsHeight = `${this.vuex_custom_index_height-100}px`; + this.componentsHeight = `${this.vuex_custom_index_height-168}px`; // #endif this.autoLoad = true; this.$nextTick(() => { -- Gitblit v1.9.3