<template>
|
<view class="container">
|
<!-- 明细列表 -->
|
<scroll-view class="list" scroll-y>
|
<view class="item" v-for="(item, index) in list" :key="index">
|
<view class="time">{{ item.createTime }}</view>
|
<view class="row">
|
<view class="desc">{{ item.actionName.includes('兑换')?item.actionName:'兑换'+item.actionName }}</view>
|
<view class="count green">
|
-{{ item.careNumber }}
|
</view>
|
</view>
|
</view>
|
<view class="loadingTips">{{loadTitle}}</view>
|
</scroll-view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getConsumeRecord
|
} from '../../api/store.js'
|
export default {
|
data() {
|
return {
|
limit: 20,
|
page: 1,
|
loadend: false,
|
loadTitle: '',
|
list: [],
|
zoneId:null
|
};
|
},
|
onLoad(options) {
|
uni.setNavigationBarTitle({
|
title: '消耗明细'
|
});
|
this.zoneId=options.zoneId
|
this.getConsumeRecord()
|
},
|
onReachBottom() {
|
this.getConsumeRecord();
|
},
|
methods: {
|
getConsumeRecord() {
|
if (this.loadend) return
|
let that = this
|
let where = {
|
limit: this.limit,
|
page: this.page,
|
zoneId:this.zoneId
|
}
|
uni.showLoading();
|
getConsumeRecord(where).then(res => {
|
let list = res.data.list;
|
if (res.data.page < res.data.totalPage) {
|
that.loadend = false;
|
} else {
|
that.loadend = true;
|
}
|
that.loadTitle = that.loadend ? '已全部加载' : '加载更多';
|
if (res.data.page == 1) {
|
that.$set(that, 'list', list);
|
} else {
|
that.$set(that, 'goodList', that.list.concat(list));
|
}
|
uni.hideLoading()
|
}).catch(err => {
|
that.loadTitle = '加载更多';
|
uni.hideLoading()
|
});
|
}
|
}
|
};
|
</script>
|
|
<style scoped lang="scss">
|
.container {
|
min-height: 100vh;
|
background-color: #f5f5f5;
|
overflow: hidden;
|
}
|
|
.nav-bar {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding: 20rpx 30rpx;
|
background-color: #f5f5f5;
|
}
|
|
.back-btn {
|
font-size: 40rpx;
|
width: 80rpx;
|
}
|
|
.title {
|
font-size: 36rpx;
|
font-weight: bold;
|
}
|
|
.nav-right {
|
display: flex;
|
}
|
|
.circle-btn {
|
width: 80rpx;
|
height: 60rpx;
|
border: 1rpx solid #333;
|
border-radius: 30rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-left: 10rpx;
|
}
|
|
.list {
|
padding: 20rpx;
|
box-sizing: border-box;
|
}
|
|
.item {
|
background-color: #fff;
|
border-radius: 20rpx;
|
padding: 30rpx;
|
margin-bottom: 20rpx;
|
}
|
|
.time {
|
font-size: 26rpx;
|
color: #999;
|
margin-bottom: 20rpx;
|
}
|
|
.row {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.desc {
|
font-size: 30rpx;
|
}
|
|
.count {
|
font-size: 30rpx;
|
font-weight: bold;
|
color: #333;
|
}
|
|
.count.green {
|
color: #00c853;
|
}
|
|
.loadingTips {
|
width: max-content;
|
padding: 3vw 0 3vw 60rpx;
|
font-size: 27rpx;
|
line-height: 2em;
|
margin: 0 auto;
|
color: #DDDDDD;
|
background: url('https://ossacmall.bluedeer.com.cn/app/static/images/h_loading.png') left center/41rpx auto no-repeat;
|
}
|
</style>
|