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