<template>
	<view class='container'>
		<view class="top_banner">
			<image src="../../static/imgs/qdmr.png" mode=""></image>
		</view>
		<view class="cont-title">
			<view class="or-size">已连续签到</view>
			<view class="or-num">0</view>
			<view class="or-num">5</view>
			<view class="or-size">天</view>
		</view>
		<view class="wrap-box">
			<view class="w_box" v-for="(item,index) in 30" :key="index" :class="{'acv_w' : wIndex ==  index }">
				<view class="">第6天</view>
				<image src="@/static/imgs/jinbi.png" style="width: 25px; height: 25px; "></image>
				<view class="">5积分</view>
			</view>
		</view>
		<view class="anniu">
			签到
		</view>
	</view>
</template>

<script>
	import request from '../../utils/request';
	export default {
		data() {
			return {


			}
		},
		onLoad() {

		},
		onPullDownRefresh() {
			//下拉刷新
			this.resetting() //重置方法
			this.getList() //调用请求
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// 触底加载
			if (this.pageNo >= this.totalPage) {
				uni.showToast({
					title: '没有下一页数据',
					icon: 'none'
				})
			} else {
				this.pageNo++
				this.getList()
			}
		},

		components: {

		},
		methods: {
			//滞空方法
			resetting() {
				this.pageNo = 1
				this.pageSize = 10
				this.totalPage = ''
				this.List = []
			},
			// 分页——网络请求
			async getList() {
				// uni.showLoading({
				// 	title: '加载中'
				// });
				let res = await request({
					url: '网络请求',
					method: 'get',
					data: {
						pageNo: this.pageNo,
						pageSize: this.pageSize,
					}
				})
				if (res.code == 200) {
					uni.hideLoading(); //交互反馈
					if (this.pageNo != 1) {
						this.List = this.ruleList.concat(res.result.records)
					} else {
						this.List = res.result.records
					}
					this.totalPage = res.result.pages
				}
			},
			goback() {
				uni.navigateBack()
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		width: 100%;
		box-sizing: border-box;
		padding-bottom: 50px;

	}

	.top_banner {
		width: 100%;
		height: 200px;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.cont-title {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.or-size {
		font-weight: 400;
		font-size: 14px;
		color: #333333;
	}

	.or-num {
		box-sizing: border-box;
		padding: 0px 5px;
		background: #FF9655;
		color: #fff;
		font-weight: 600;
		font-size: 32px;
		color: #FFFFFF;
		margin: 10px;
	}

	.wrap-box {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		box-sizing: border-box;
		padding: 10px;
	}

	.w_box {
		width: 19%;
		box-sizing: border-box;
		padding: 5px 15px;
		background: #F7F7F7;
		text-align: center;
		font-size: 12px;
		border-radius: 4px;
		margin-right: 1%;
		margin-bottom: 2%;

		image {
			margin: 5px auto;
		}
	}

	.anniu {
		width: 80%;
		height: 40px;
		background: #FF9655;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		border-radius: 50px;
		margin: 25px auto;
	}

	.acv_w {
		background: #FF9655 !important;
	}
</style>