<template>
	<view class="content">
		<view class="container">
			<headers :titles="titles"><uni-icons type="arrow-left" color="#fff" size="22px"></uni-icons></headers>
			<view class="list-box" v-for="(item,index) in dataList" :key="index">
				<view class="time-">{{item.tradeDate}}</view>
        <view style="background-color: white;padding: 15rpx">
          <view class="box-">
            <view class="wubox">
              云闪付扫码:{{dealNum(item.ysfTrade)}}
            </view>
            <view class="wubox">
              微信:{{dealNum(item.wxTrade)}}
            </view>
          </view>
          <view class="box-">
            <view class="wubox">
              云闪付借记卡:{{dealNum(item.ysfCardTrade)}}
            </view>
            <view class="wubox">
              支付宝:{{dealNum(item.aliTrade)}}
            </view>
          </view>
          <view class="box-">
            <view class="wubox">
              云闪付贷记卡:{{dealNum(item.ysfCrCardTrade)}}
            </view>
            <view class="wubox">

            </view>
          </view>
        </view>
			</view>
			<u-loadmore :status="status" v-if="show == true" />
		</view>

	</view>
</template>

<script>
	import headers from '../../components/header/headers.vue'
	import tabbar from '../../components/tabbar/tabbar.vue'
	import request from '../../utils/request.js'
	export default {
		data() {
			return {
				titles: "团队总交易量",
				page: 1,
				limit: 10,
				totalPage: 0,
				dataList: [],
				show: false,
				status: 'loading',
			}
		},
		onShow() {
			uni.showLoading({
				title: "加载中"
			})
			this.getDataList();
		},
		onPullDownRefresh() {
			this.page = 1,
				this.limit = 10,
				this.totalPage = 0,
				this.dataList = [],
				this.getDataList();
			console.log("刷新");
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// 触底加载
			this.show = true
			this.page++
			this.getDataList()
		},
		components: {
			headers,
			tabbar
		},
		methods: {
			dealNum(data) {
				if (data) {
					return parseFloat(data).toFixed(2)
				} else {
					return '0.00'
				}
			},
			getDataList() {
				request({
					url: '/app/uaAgent/getAgentGroupDaysShouYiList',
					method: 'post',
					data: {
						page: this.page,
						limit: this.limit
					}
				}).then(res => {
					if (res.data) {
						if (this.page != 1) {
							this.dataList = this.dataList.concat(res.data)
						} else {
							this.dataList = res.data
						}
						this.totalPage = res.total

					}
					uni.hideLoading()
				})
			},
			goback() {
				uni.navigateBack()
			}

		}
	}
</script>

<style scoped lang="scss">
	.content {
		background: #fff;
		height: 100vh;
	}

	.container {
		width: 100%;
		background: #f4f5f6;
		box-sizing: border-box;
		padding-top: 88px;
	}

	.list-box {}

	.time- {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 32rpx;
    color: #101A3E;
    padding-left: 15rpx;
    margin: 10rpx 0;
	}

	.box- {
		width: 100%;
		box-sizing: border-box;
		padding: 5px 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.wubox {
		width: 50%;
	}
</style>
