From b8d504ddbd7dc0edb03b24e3ae46425e8bee0fc5 Mon Sep 17 00:00:00 2001 From: liudan <18634735655@163.com> Date: Mon, 26 Feb 2024 23:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news/park/recordHistory.vue | 86 ++++++++++++++++++------------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/pages/news/park/recordHistory.vue b/pages/news/park/recordHistory.vue index f5ab41b..29a08db 100644 --- a/pages/news/park/recordHistory.vue +++ b/pages/news/park/recordHistory.vue @@ -17,7 +17,9 @@ - + + + @@ -28,6 +30,8 @@ return { presaList: [], isLoading: false, + total:0, + page:1, }; }, onLoad() { @@ -45,46 +49,50 @@ let start= year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second return (Date.parse(end.replace(/-/g, '/'))-Date.parse(start.replace(/-/g, '/'))) }, - onCancel(item) { - let app = this - uni.showModal({ - title: "温馨提示", - content: "是否取消该订单?", - confirmColor: "#F21A1C", - complete(res) { - if (res.confirm) { - GoodsApi.canlpresale({ - id: item.id - }) - .then(result => { - if (result.status == 200) { - uni.showToast({ - title:'取消成功', - icon:'none' - }) - app.getPresaleList() - } - }) - .finally(() => app.isLoading = false) + onCancel(item) { + let app = this + uni.showModal({ + title: "温馨提示", + content: "是否取消该订单?", + confirmColor: "#F21A1C", + complete(res) { + if (res.confirm) { + GoodsApi.canlpresale({ + id: item.id + }) + .then(result => { + if (result.status == 200) { + uni.showToast({ + title:'取消成功', + icon:'none' + }) + app.getPresaleList() + } + }) + .finally(() => app.isLoading = false) + } } + }) + }, + async getPresaleList() { + let app = this + let res = await GoodsApi.presaleList({page:this.page}); + console.log(res) + if (res.status == 200 && res.data.list.data.length>0) { + res.data.list.data.forEach(function(item) { + item.p_time = app.beginTime(item.p_time) + }); + app.presaList.push(...res.data.list.data) + app.total = res.data.list.total } - }) + }, }, - async getPresaleList() { - let app = this - let { - status, - message, - data - } = await GoodsApi.presaleList(); - if (status == 200 && data.length>0) { - data.forEach(function(item) { - item.p_time = app.beginTime(item.p_time) - }); - app.presaList =data + onReachBottom() { + if(this.presaList.length @@ -195,4 +203,10 @@ } } } + .empty{ + height: calc(100vh - 88rpx); + display: flex; + align-items: center; + justify-content: center; + }