12.05前端

This commit is contained in:
@QQNZX 2023-12-05 15:43:39 +08:00
parent 6dd43b9d68
commit e7d735e93e

View File

@ -21,7 +21,7 @@
<u-empty text="积分明细" v-if="mingList.length == 0" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
<u-loadmore :status="status" v-if="show == true" />
</view>
</view>
</template>
@ -32,7 +32,11 @@
export default {
data() {
return {
title: '',
show: false,
status: 'loading',
pageNo: 1,
pageSize: 10,
totalDetail: '',
detailList: [],
mingList: [
"3", "4", "5", "6",
@ -47,6 +51,21 @@
},
onShow() {
this.getIntegralDetailList()
},
onReachBottom() {
this.show = true
if (this.detailList.length >= this.totalDetail) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
this.status = "nomore"
} else {
this.pageNo++
this.getIntegralDetailList()
}
},
methods: {
goback() {
@ -54,15 +73,30 @@
},
//
getIntegralDetailList() {
uni.showLoading({
title: '加载中'
});
request({
url: 'business/integral/integralDetail/queryByPageUni',
method: 'get',
params: {
chainStoreId: uni.getStorageSync('chainStoreId')
chainStoreId: uni.getStorageSync('chainStoreId'),
pageNo: this.pageNo,
pageSize: this.pageSize
}
}).then((res) => {
if (res.code == 200) {
this.detailList = res.data.records
if (this.pageNo != 1) {
this.detailList = this.detailList.concat(res.data.records)
} else {
this.detailList = res.data.records
}
this.totalDetail = res.data.total
// let total = res.data.total
// this.totalDetail = Math.ceil(total / this.pageSize);
console.log(this.totalDetail);
uni.hideLoading();
}
})
},
@ -73,13 +107,16 @@
<style scoped lang="scss">
.content {
background: #f4f5f6;
height: 100vh;
}
.container {
width: 100%;
height: 100vh;
background: #f4f5f6;
box-sizing: border-box;
padding-top: 88px;
padding-bottom: 15px;
}
.my-header {