<template>
	<view>
		<image  v-if="type"  class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image>
		<view  v-if="type" class="welcome_jumpes" @click="leap_over" >跳过{{remaining}}</view>
		<view  v-if="banner" class="welcome_jumpes" @click="leap_overto" >跳过</view>
		<!-- 轮播图 -->
		<view class="uni-padding-wrap" v-if="banner" >
			<view class="page-section swiper">
				<view class="page-section-spacing">
					<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
						<swiper-item v-for="(item,index) in imgurl" :key="index">
							<view class="swiper-item uni-bg-red">
								<image :src="item" mode="aspectFill"></image>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
		</view>
		<!-- 用户协议弹窗 -->
		<view class="welcome_backes" v-if="protocol">
			<view class="content">
				<view class="title">用户协议</view>
				<text class="protocol_content">
					亲，感谢您对德铭阳光在线的信任!
					请注意，在您使用本软件过程中我们会按照《德铭阳光在线隐私保护声明》、《权限声明》 收集、使用和共享您的个人信息，请认真阅读并充分理解。特别提示:
					1、为向您提供交易相关基本功能，我们会收集、使用必要的信息; 
					2、基于您的授权，我们可能会获取您的位置等信息，您有权拒绝或取消授权;
					3、我们会采取业界先进的安全措施保护您的信息安全;
					4、未经您同意，我们不会从第三方处获取、共享或向其提供您的信息;
					5、您可以查询、更正、删除您的个人信息，我们也提供账户注销的渠道。
				</text>
				<view class="to_agree" @click="to_agree">我同意</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				remaining : 3,
				type:true,
				banner : false,
				protocol : false,
				heightes:'',
				imgurl: ['../../static/pageA/welcome_banner.jpg', '../../static/pageA/welcome_img2.jpg', '../../static/pageA/welcome_img3.jpg'],
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500
			};
		},
		onLoad() {
			
				
		},
		methods: {
			apiwelcome(){
				this.$u.api.documentInfo({
					document_code:'agreement'
				}).then((res)=>{
					console.log('协议',res)
					
				})
				// 启动页
				this.$u.api.pageList({}).then((res)=>{
					console.log('协议',res)
					
				})
			},
			// 3秒倒计时
			remaining_time(){
				this.timer=setInterval(() => {
					this.remaining--;
					if(this.remaining <= 0){
						clearInterval(this.timer);
						// console.log("完了")
						this.type = !this.type
						this.banner = !this.banner;
					}
				},1000);
			},
			leap_over(){
				this.type = !this.type
				this.banner = !this.banner;
			},
			leap_overto(){
				this.protocol = true
			},
			getSystemInfo(){
				// 获取屏幕高度
				uni.getSystemInfo({
				    success: function (res) {
				        this.heightes = res.windowHeight;
						console.log( this.heightes)
				    }
				});
			},
			// 我同意
			to_agree(){
				uni.navigateTo({
				    url: '/pageA/login/login'
				});
			}
		},
		mounted(){
			// 3秒倒计时调用
			this.remaining_time()
			// 获取屏幕高度
			this.getSystemInfo()
			this.apiwelcome()
		}
	}
</script>

<style lang="scss" scoped>

	.welcome_jumpes{
		width: 90rpx;
		height: 35rpx;
		opacity:0.5;
		border-radius:18rpx;
		position: absolute;
		right: 37rpx;
		top: 34rpx;
		font-size:20rpx;
		text-align: center;
		line-height: 35rpx;
		color: #fff;
		background: #C4CAC6;
		z-index: 10;
	}
	.welcome_images {
		width: 100%;
		position: fixed;
		height: 100%
	}
	uni-swiper,uni-view,uni-image{
		width: 100%;
		position: fixed;
		height: 100%
	}
	uni-image{
		width: 100%;
	}
	// 轮播图分页器颜色
	uni-swiper .uni-swiper-dot-active{
		background-color: #fff!important;
	}
	.welcome_backes{
		width: 100%;
		position: fixed;
		height: 100%;
		background:#999999;
		.content{
			width:558rpx;
			height:730rpx;
			background:rgba(255,255,255,1);
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			top: 0;
			margin: auto;
			.title{
				width:558rpx;
				text-align: center;
				height:29rpx;
				font-size:30rpx;
				font-weight:bold;
				color:rgba(51,51,51,1);
				line-height:29rpx;
				margin: 30rpx 0 24rpx 0;
			}
			.protocol_content{
				width:494rpx;
				height:528rpx;
				font-size:24rpx;
				font-weight:400;
				color:rgba(51,51,51,1);
				display: block;
				text-align: left;
				margin: 80rpx auto 33rpx;
				letter-spacing: 1rpx;
				text-align: justify;
				line-height: 36rpx;
			}
			.to_agree{
				width:558rpx;
				font-size:30rpx;
				font-weight:bold;
				color:rgba(255,121,16,1);
				text-align: center;
				padding-top: 27rpx;
				border-top: #D8D8D8 solid 1px;
			}
		}
	}
</style>
