| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <view class="content">
- <scroll-view class="list" scroll-y @scrolltolower="loadData">
- <!-- 空白页 -->
- <empty v-if="dataList.length === 0"></empty>
- <view class="item flex" v-for="(item,index) in dataList" :key="index">
- <view class="item-left">
- <view class="title">{{ item.title}}</view>
- <view class="time">{{ item.add_time}}</view>
- <view class="main">{{ item.mark}}元</view>
- </view>
- <view class="item-right">
- <view class="price">{{ item.number}}</view>
- <view class="dj">冻结中</view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </scroll-view>
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- import { getCommissionInfo} from '@/api/user.js';
- export default {
- components: {
- empty,
- uniLoadMore,
- },
- data() {
- return {
- page: 1,
- limit: 10,
- loadingType: 'More',
- dataList: [],
- }
- },
- onShow() {
- this.loadData();
- },
- methods: {
- async loadData() {
- if (this.loadingType === 'loading') {
- return;
- }
- if (this.loadingType === 'noMore'){
- return;
- }
- this.loadingType = 'loading';
- getCommissionInfo({
- page: this.page,
- limit: this.limit
- },5)
- .then(({ data }) => {
- console.log('获取佣金明细',data);
- if (data.length > 0) {
- this.dataList = this.dataList.concat(data[0].list);
- console.log(this.dataList,"dataList");
- this.page++;
- }
- if (this.limit == data.length) {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- this.loadingType = 'more';
- return;
- } else {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- this.loadingType = 'noMore';
- }
- uni.hideLoading();
- this.$set(this.dataList, 'loaded', true);
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background: #F8F6F6;
- }
- .list {
- width: 100%;
- margin-top: 20rpx;
- background: #FFFFFF;
- .item {
- padding: 38rpx 46rpx 27rpx 50rpx;
- width: 100%;
- justify-content: space-between;
- align-items: center;
- .item-left {
- text-align: left;
- .title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #666666;
- }
- .time {
- margin-top: 5rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #AEAEAE;
- }
- .main {
- margin-top: 5rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #AEAEAE;
- }
- }
- .item-right {
- text-align: right;
- .price {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF0000;
- }
- .dj {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FC4141;
- }
- }
- }
- }
- </style>
|