Files
2025-08-25 11:20:35 +08:00

170 lines
3.1 KiB
Vue

<template>
<view class="pagesContent">
<view class="beansList">
<view class="beansItem box" v-for="item in listData" :key="item.id">
<view class="beansLeft">
<view class="remark">{{ item.remark }}</view>
<view class="time">{{ item.createtime }}</view>
</view>
<view :class="item.jzt == '-'?'right black':'right yellow'">
{{ item.jzt }}{{ item.beans }}
</view>
</view>
</view>
<uni-load-more :status="status"/>
</view>
</template>
<script>
export default {
data() {
return {
listData: [],
status: 'more',
userInfo: {},
pages: {
pageSize: 20,
currentPage: 1,
isNextPage: true
}
}
},
onReachBottom() {
this.status = 'more';
if (this.pages.isNextPage) {
this.getList();
}
},
onLoad() {
this.userInfo = uni.getStorageSync('userinfo')
this.getList();
},
methods: {
navBack() {
uni.navigateBack(1);
},
getList() {
let that = this;
if (that.pages.isNextPage) {
that.status = 'loading';
that.$httpRequest({
url: "/api/user/userBeansInfo",
methods: "GET",
data: {
limit: that.pages.pageSize,
page: that.pages.currentPage
}
}).then(res => {
that.status = '';
if(res.rows.length>0 || res.data.length>0){
if (that.pages.currentPage == 1) {
that.listData = res.data || res.rows;
} else{
that.listData = that.listData.concat(res.data || res.rows);
}
that.pages.currentPage += 1;
}else{
that.status = 'noMore';
that.pages.isNextPage = false;
}
}).catch(err => {
that.status = '';
console.log(err)
})
}
},
}
}
</script>
<style scoped>
.pagesContent {
background-color: #F7F8F9;
min-height: 100vh;
padding: 26rpx;
}
.pageHeader {
background: linear-gradient(to right, #F1FFE9, #FFFFF4);
height: 408rpx;
padding: 0 24rpx;
padding-top: 42rpx;
}
.navBack {
font-size: 32rpx;
color: #333333;
font-weight: 600;
text-align: center;
height: 160rpx;
line-height: 160rpx;
position: relative;
}
.backIcon {
position: absolute;
left: 0rpx;
top: 0rpx;
}
.beans {
font-size: 32rpx;
color: #333333;
font-weight: 600;
margin-top: 24rpx;
}
.beansNum {
margin-top: 24rpx;
font-size: 80rpx;
color: #333;
font-weight: 600;
}
.beansCont {
padding: 40rpx 24rpx;
}
.beansListHeader {
color: #333333;
font-size: 32rpx;
font-weight: 600;
}
.beansItem {
padding: 24rpx 34rpx;
border-bottom: 1rpx solid #F8F8F8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-bottom: 24rpx;
border-radius: 12rpx;
}
.remark {
font-size: 28rpx;
color: #333;
font-weight: 600;
}
.time {
color: #999999;
font-size: 24rpx;
margin-top: 8rpx;
}
.right{
font-size: 28rpx;font-weight: 600;
}
.black{
color: #333;
}
.yellow{
color: #F98B1E;
}
</style>