<template>
	<view>
		<ms-tabs :type="type" v-model="active" lineAnimated="true" @input='switchTabs'></ms-tabs>
		<view class="content">
			<view v-show="active===0">
				<view class="dayGift-box" v-for="(day,index) in dayGiftList" :key='day.giftTime'>
					<view>{{index + 1}}</view>
					<view style="margin-left: -35%">{{day.giftTime}}</view>
					<view style="color: #1AAD19;">+{{day.giftCounts}}次</view>
				</view>
		        <view class="dayGift-box" style="justify-content: center;" v-if="!dayGiftList.length">暂无明细</view>
			</view>
			<view v-show="active===1">
				<view class="dayGift-box" v-for="(friend,index) in inviteFriendList" :key='friend.giftTime'>
					<view>{{index + 1}}</view>
					<view style="margin-left: -28%" class="flex-column">
					    <view class="flex-row">
							<image :src="friend.friendHead" mode="aspectFit"></image>
							<text>{{friend.friendName}}</text>
						</view>
						<view class="friend-time">{{friend.giftTime}}</view>
					</view>
					<view style="color: #1AAD19;">+{{friend.giftCounts}}次</view>
				</view>
			    <view class="dayGift-box" style="justify-content: center;" v-if="!inviteFriendList.length">暂无明细</view>
			</view>
		</view>
	</view>
</template>

<script>
	var md5 = require("../../../common/md5.js");
	import msTabs from '@/components/ms-tabs/ms-tabs.vue'
	export default {
		components: {
			msTabs
		},
		data() {
			return {
				type: [{
					title: '每日赠送次数'
				}, {
					title: '邀好友奖励次数'
				}],
				active: 0,
				dayGiftList:[
					// {
					// 	giftTime:'2019.12.03 00:00',
					// 	giftCounts:'3'
					// },
					// {
					// 	giftTime:'2019.12.04 00:00',
					// 	giftCounts:'3'
					// },
					// {
					// 	giftTime:'2019.12.05 00:00',
					// 	giftCounts:'3'
					// },
					],
				inviteFriendList:[
					{
						friendHead:'/static/userDefault.png',
						friendName:'小瓶子',
						giftCounts:'10',
						giftTime:'2019.12.05 00:00',
					},
					{
						friendHead:'/static/userDefault.png',
						friendName:'小瓶子',
						giftCounts:'10',
						giftTime:'2019.12.06 00:00',
					},
					{
						friendHead:'/static/userDefault.png',
						friendName:'小瓶子',
						giftCounts:'10',
						giftTime:'2019.12.07 00:00',
					},
				]
			}
		},
		methods: {
			switchTabs(){
				console.log(this.active)
			},
			getDayRequest(){},
			getFriendRequest(){},
		}
	}
</script>

<style lang="scss">
	page {
		height:100%
	}
	.content {
		height:100%;
		background: #fff;
		margin-bottom: 20rpx;
		.title {
			margin-left: 20rpx;
			padding: 20rpx 0;
			color: #818586;
			border-bottom: 1px solid #f6f6f6;
		}
		.btn {
			background: $uni-color-primary;
			background: #007aff;
			color: #fff;
			padding: 20rpx;
			display: inline-block;
			border-radius: 10rpx;
		}
		.dayGift-box{
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;
			padding: 20rpx;
			border-bottom: 1px solid #ccc;
		}
		.flex-column {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			align-items: center;
		}
		.flex-row {
			display: flex;
			justify-content: flex-start;
			align-items: center;
			width: 300rpx;
		}
		.flex-row image {
			width: 60upx;
			height: 60upx;
			border-radius: 50%;
			margin-right: 2%;
		}
		.friend-time {
			font-size: 26upx;
			color: #999;
			margin-left: -15%;
			width: 230rpx;
			margin-top: 3%;
		}
	}
	
	

</style>
