<!-- 签到任务 -->
<template>
	<navbar_neadVue title="签到任务" background_color="#CAF6F5"></navbar_neadVue>
	<view class="content-top">
		<view class="top">
			<view class="top-right-text">
				<text @click="GoTo()">签到明细</text>
			</view>

			<view>
				<view class="top-left-text">
					<text>{{count}}</text>
					<text>校园币</text>
				</view>

				<view class="top-left">
					<text>我的校园币</text>
				</view>
			</view>

			<view class="right-image">
				<image src="../../static/images/sign/金币.png"></image>
			</view>

			<view class="content-bottom">
				<view class="c-bottom">
					<text>
						已连续签到<text class="text-1">1</text>天
					</text>
				</view>
			</view>

			<view class="content-bottom-bot">
				<view class="bot-text">
					<text>记得去商城兑换礼物奥！</text>
				</view>

				<!-- 签到日期 -->
				<view>
					<view class="data">
						<view class="data-view" v-for="(item,index) in datetime" :key="index">
							<image v-if="item.isDate == true" class="data-image" src="../../static/images/sign/金币虚.png">
							</image>
							<image v-else class="data-image" src="../../static/images/sign/1.png"></image>
							<text class="data-text">{{item.data}}日</text>
						</view>
					</view>
				</view>

			</view>

		</view>
	</view>

	<!-- 签到任务 -->
	<view class="task">
		<view style="height: 60rpx;">
			<text class="tasktext">签到任务</text>
		</view>

		<view class="task-content" v-for="(item,index) in arr" :key="index">
			<!-- 签到按钮 -->
			<view class="task-right" @click="goTaskRight(item.id)">
				<text>{{item.type}}</text>
			</view>
			<view>
				<text class="c-text">{{item.title}}</text>
				<image style="width: 21rpx;height: 21rpx;margin-left: 36rpx;" src="../../static/images/sign/1.png">
				</image>
				<text class="count-text">{{item.count}}</text>
			</view>
			<view class="task-left">
				<text class="left-text">{{item.content.title}} <text class="left-0text">
						{{item.content.count}}
					</text>{{item.content.cuent}}</text>
			</view>
		</view>

		<view style="height: 24rpx;"></view>
	</view>

	<view class="bottom">
		<view class="bottom-left"></view>
		<view class="bottom-text">
			<text class="bottom-text-s">兑换商城</text>
			<view class="bottom-text-r" @click="GoExchange()">
				<text>更多</text>
				<image style="width: 14rpx; height: 23rpx;margin-left: 9rpx;" src="../../static/images/sign/右.png">
				</image>
			</view>
		</view>
	</view>


	<view>
		<ex></ex>
	</view>

</template>

<script setup>
	import navbar_neadVue from "@/pages/common/navbar/navbar_nead.vue";
	import ex from "@/pages/common/exchange/index.vue";

	const datetime = reactive([{
			data: "12",
			isDate: true
		},
		{
			data: "13",
			isDate: false
		},
		{
			data: "14",
			isDate: false
		},
		{
			data: "15",
			isDate: false
		},
		{
			data: "16",
			isDate: false
		},
		{
			data: "17",
			isDate: false
		},
		{
			data: "18",
			isDate: false
		}
	])

	//
	function GoTo() {
		uni.navigateTo({
			url: './signiddetails'
		});
	}

	//
	function GoExchange() {
		uni.navigateTo({
			url: './exchangemall'
		});
	}

	function goTaskRight(id) {
		arr.find(item=>item.id == id).type = "成功";
		uni.showToast({
			title: '成功',
			//将值设置为 success 或者直接不用写icon这个参数
			icon: 'success',
			//显示持续时间为 2秒
			duration: 2000
		})  
	}

	import {
		ref,
		reactive
	} from "vue";
	const count = ref("750");
	const arr = reactive([{
			id: 1,
			type: "立即签到",
			title: "每日签到",
			count: "+1",
			content: {
				title: "点击签到获得每日奖励 ",
				count: "(" + "0",
				cuent: "/" + "1" + ")"
			},
		},
		{
			id: 2,
			type: "去关注",
			title: "关注",
			count: "+2",
			content: {
				title: "关注优秀用户得奖励 ",
				count: "(" + "0",
				cuent: "/" + "1" + ")"
			},
		},
		{
			id: 3,
			type: "去点赞",
			title: "点赞",
			count: "+2",
			content: {
				title: "点赞话题获取奖励 ",
				count: "(" + "0",
				cuent: "/" + "3" + ")"
			},
		},
		{
			id: 4,
			type: "去发布",
			title: "发布话题",
			count: "+3",
			content: {
				title: "点赞话题获取奖励 ",
				count: "(" + "0",
				cuent: "/" + "1" + ")"
			},
		},
		{
			id: 5,
			type: "立即邀请",
			title: "邀请新用户",
			count: "+5",
			content: {
				title: "邀请新用户得奖励	 ",
				count: "",
				cuent: ""
			},
		}
	])
</script>




<style scoped>
	@import '../../pages/common/navbar/navbar.css';

	.content-top {
		/* height: 424rpx; */
		height: 502rpx;
		background: linear-gradient(-180deg, #c9f6f5, #ffffff);
	}

	.top {
		margin-left: 32rpx;
		margin-right: 32rpx;
	}

	.top-right-text>text {
		font-weight: Regular;
		/* width: 95rpx; */
		height: 24rpx;
		font-size: 24rpx;
		text-align: left;
		color: #000000;
		float: right;
		margin-top: 24rpx;
	}

	.top-left-text {
		padding-top: 99rpx;
		padding-left: 1rpx;
	}

	.top-left-text>text:first-child {
		color: #000000;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 48rpx;
		text-align: left;
		line-height: 46.29rpx;
	}

	.top-left-text>text:last-child {
		color: #000000;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 28rpx;
		text-align: left;
		line-height: 46.29rpx;
	}

	.top-left>text {
		display: block;
		font-weight: Regular;
		/* width: 119rpx; */
		font-size: 24rpx;
		text-align: left;
		color: #6F6F6F;
		padding-left: 1rpx;
		line-height: 24rpx;
	}

	.right-image>image {
		width: 248rpx;
		height: 289rpx;
		position: absolute;
		top: 279rpx;
		right: 32rpx;
		z-index: 7;
	}

	.content-bottom {
		width: 319rpx;
		height: 60rpx;
		border-radius: 20rpx 20rpx 0 0;
		background: #ffffff;
		margin-top: 48rpx;
	}

	.c-bottom {
		padding-left: 26rpx;
		padding-top: 8rpx;
	}

	.c-bottom>text:first-child {
		color: #000000;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 28rpx;
		text-align: left;
		line-height: 46.29rpx;
	}

	.text-1 {
		color: #fa3939;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 28rpx;
		text-align: left;
		line-height: 46.29rpx;
	}

	.content-bottom-bot {
		position: relative;
		/* 		width: 686rpx; */
		height: 214rpx;
		border-radius: 0 32rpx 32rpx 32rpx;
		background: #ffffff;
		z-index: 9;
	}

	.bot-text {
		padding-left: 24rpx;
		display: block;
		/* padding-top: 12rpx; */
	}

	.bot-text>text {
		font-weight: Regular;
		width: 248rpx;
		height: 24rpx;
		font-size: 24rpx;
		text-align: left;
		color: #6F6F6F;
	}

	.task {
		width: 686rpx;
		/* height: 484rpx; */
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		background: #ffffff;
		/* background: #fa3939; */
		margin-left: 32rpx;
		margin-right: 32rpx;
		margin-top: 24rpx;
	}

	.tasktext {
		display: block;
		font-weight: Regular;
		width: 144rpx;
		height: 36rpx;
		font-size: 36rpx;
		text-align: left;
		color: #000000;
		padding-top: 24rpx;
		margin-left: 24rpx;
	}

	.task-content {
		margin-left: 24rpx;
		margin-top: 24rpx;
	}

	.task-right {
		margin-top: 16rpx;
		width: 120rpx;
		height: 48rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		background: #f99b46;
		float: right;
		margin-right: 24rpx;
	}

	.c-text {
		font-weight: Regular;
		width: 95rpx;
		height: 24rpx;
		font-size: 24rpx;
		text-align: left;
		color: #000000;
	}

	.count-text {
		font-weight: Regular;
		width: 20rpx;
		height: 16rpx;
		font-size: 20rpx;
		text-align: left;
		color: #F99B46;
		padding-left: 3rpx;
		line-height: 16rpx;
		vertical-align: middle;
	}

	.task-right>text {
		font-weight: Regular;
		width: 95rpx;
		height: 25rpx;
		font-size: 24rpx;
		text-align: left;
		color: #FFFFFF;
		display: block;
		margin: auto;
		text-align: center;
		line-height: 48rpx;
	}

	.task-left {
		/* display: block; */
		height: 20rpx;
	}

	.left-text {
		display: block;
		color: #999999;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 20rpx;
		text-align: left;
		/* margin-top: 12rpx; */
	}

	.left-0text {
		color: #fb5c5c;
		font-weight: Regular;
		font-face: Microsoft YaHei;
		font-size: 20rpx;
		text-align: left;
	}

	.bottom {
		margin-right: 32rpx;
		margin-left: 32rpx;
		margin-top: 24rpx;
	}

	.bottom-left {
		width: 4rpx;
		height: 30rpx;
		border-radius: 2rpx 2rpx 2rpx 2rpx;
		background: #f99b46;
		float: left;
		margin-top: 8rpx;
	}

	.bottom-text-s {
		font-weight: Regular;
		/* width: 123rpx; */
		height: 31rpx;
		font-size: 30rpx;
		text-align: left;
		color: #000000;
		margin-left: 24rpx;
		vertical-align: baseline;
	}

	.bottom-text-r {
		float: right;
		font-weight: Regular;
		/* width: 47rpx; */
		height: 24rpx;
		line-height: 48rpx;
		font-size: 24rpx;
		text-align: left;
		color: #999999;
		vertical-align: middle;
		margin-right: 32rpx;
	}

	.bottom-text-r>text {}


	.data {
		display: flex;
		margin-left: 24rpx;
		padding-left: 2rpx;
		margin-top: 48rpx;
	}

	.data-view {
		margin-right: 45rpx;
	}

	.data-image {
		display: flex;
	}

	.data-image {
		width: 42rpx;
		height: 44rpx;
	}

	.data-text {
		display: block;
		font-weight: Regular;
		width: 60rpx;
		height: 22rpx;
		font-size: 24rpx;
		text-align: center;
		vertical-align: middle;
		color: #7E7E7E;
		margin-left: -8rpx;
		margin-top: 12rpx;
	}
</style>