<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" @click="setIndex(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="bottom_bs" @click="equityShow = true">
			<view class="">连续签到获得更多积分</view>
			<view class="d-s"> <u-icon name="info-circle" size="14px"></u-icon>
				<view style="font-size: 14px; color: #333; margin-left: 5px; ">签到规则</view>
			</view>
		</view>
		<view class="anniu">
			签到
		</view>
		<u-overlay :show="show" @click="show = false">
			<view class="box_">
				<view class="r_size">+10积分</view>
			</view>
		</u-overlay>
		<u-popup :show="equityShow" :closeable="true" :round="10" mode="bottom" @close="equityclose">
			<view class="_tbox">
				<view class="_btop">签到规则</view>
				<view class="_bbox">
					<!-- <view class="b_title">获取您的位置信息</view> -->
					<view class="">

						1.签到时间：
						全天可签到，不限制具体时间段。
						2.签到方式：
						用户通过小程序的签到入口进行点击签到。
						3、签到奖励：
						为鼓励用户签到，我们设置了签到奖励：积分。
						签到奖励可能随着连续签到天数的增加而增加，形成签到
						激励机制。
						4、补签与断签：
						不允许用户进行补签，以恢复连续签到天数。
						断签后，用户需重新开始计算连续签到天数。
					</view>
				</view>

			</view>
		</u-popup>
	</view>
</template>

<script>
	import request from '../../utils/request';
	export default {
		data() {
			return {
				wIndex: 0,
				show: false,
				equityShow: false
			}
		},
		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: {
			equityclose() {
				this.equityShow = false
			},
			setIndex(index) {
				this.wIndex = index
				this.show = true
			},
			//滞空方法
			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;
		color: #fff !important;
	}

	.bottom_bs {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 10px;
		font-size: 14px;
		color: #999999;
	}

	.d-s {
		display: flex;
		align-items: center;
	}

	.box_ {
		width: 230px;
		height: 200px;
		background: url('http://47.94.122.58:83/qdcg.png') no-repeat;
		background-size: 100% 100%;
		position: relative;
		left: 50%;
		transform: translate(-50%, 150%);
		bottom: 10%;

	}

	.r_size {
		position: absolute;
		left: 50%;
		transform: translate(-50%, -50%);
		bottom: 10%;
		color: #FA6400;
	}

	._tbox {
		border-radius: 10px;
		background: #fff;
		width: 100%;


	}

	._btop {
		box-sizing: border-box;
		padding: 15px;
		border-bottom: 1px solid #EEEEEE;
		text-align: center;
		font-weight: 600;
		font-size: 14px;
		color: #333333;
	}

	._bbox {
		box-sizing: border-box;
		padding: 15px;
		font-weight: 400;
		font-size: 14px;
		color: #333333;
		line-height: 18px;
	}
</style>