<template>
	<view class="content">
		<view class="top_bg">
			<view class="hflex acenter jbetween top">
				<image src="/static/image/index1/logo2.png" class="logo"></image>
				<view class="vflex">
					<view class="top_title">線上課程,直播,活動,求職,補習,一應俱全</view>
					<view class="top_title2">「Day Day U」APP開啟更多功能</view>
				</view>
				<view class="top_btn hflex acenter jcenter" @click="detail">下載</view>
			</view>
			<view class="hflex acenter jcenter logo_box">
				<image src="/static/image/index1/logo.png" class="logo2"></image>
			</view>
			<view class="banner">
				<u-swiper :list="bannerList" keyName="logo" height="250" @change="changeBanner" @click="clickBanner">
					<view slot="indicator" class="indicator">
						<view class="indicator_dot" v-for="(item,index) in bannerList" :key="index" :class="index === current ? 'indicator_dot--active': ''"> </view>
					</view>
				</u-swiper>
			</view>
		</view>
		<view class="tabs hflex acenter jcenter">
			<block v-for="(item,index) in tabs" :key="index">
				<view class="tab_item vflex acenter jcenter" @click="toDetail(index)">
					<image :src="item.img" class="tab_img"></image>
					<view class="tab_text">{{item.name}}</view>
				</view>
			</block>
		</view>
		<view class="video">
			<video :src="video"></video>
		</view>
		<view class="btn_group hflex acenter jcenter">
			<view class="btn1 hflex acenter jcenter" @click="toLogin(1)">成為導師</view>
			<view class="btn2 hflex acenter jcenter" @click="toLogin(2)">用戶註冊</view>
		</view>
		<view class="box">
			<block v-for="(item,index) in pageList" :key="index">
				<view class="box_item vflex acenter jcenter" :id="'box' + index">
					<view class="title">{{item.name}}</view>
					<image class="box_img" :src="item.img" mode="heightFix"></image>
					<view class="box_list">
						<block v-for="(item2,index2) in item.list" :key="index2">
							<view class="vflex">
								<view class="item_title">{{item2.title}}</view>
								<view class="item_name">{{item2.name}}</view>
							</view>
						</block>
					</view>
				</view>
			</block>
		</view>
		<view class="bottom vflex acenter jcenter">
			<image :src="bottom.img1" class="bottom_img"></image>
			<view class="hflex acenter jcenter">
				<image :src="bottom.img2" class="bottom_left"></image>
				<image :src="bottom.img3" class="bottom_right"></image>
			</view>
		</view>
		<view class="footer">
			<view class="hflex acenter jcenter foot_btn1" @click="liaison">聯絡我們</view>
			<view class="hflex acenter jcenter foot_btn1" @click="open">進入桌面版</view>
		</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	var that = ''
	export default {
		data() {
			return {
				bannerList: [
					
				],
				current: 0,
				tabs: [
					{
						img: '/static/image/index1/tab1.png',
						name: '線上課程'
					},
					{
						img: '/static/image/index1/tab2.png',
						name: '直播/活動'
					},
					{
						img: '/static/image/index1/tab3.png',
						name: '上網問功課'
					},
					{
						img: '/static/image/index1/tab4.png',
						name: '招聘信息'
					},
				],
				video: '',
				pageList: [
					{
						img: '/static/image/index1/img1.png',
						name: '線上課程',
						list: [
							{
								title: '多元化內容',
								name: '課程影片數量持續更新 開啟你的知識寶庫',
							},
							{
								title: '自主學習',
								name: '隨時隨地 按你節奏展開學習',
							}
						]
					},
					{
						img: '/static/image/index1/img2.png',
						name: '直播課堂',
						list: [
							{
								title: '簡化學習',
								name: '將傳統教室移師線上 縮短學習距離',
							},
							{
								title: '無地域限制',
								name: '足不出戶都可跨地域跟大師對話',
							},
						]
					},
					{
						img: '/static/image/index1/img3.png',
						name: '上網問功課',
						list: [
							{
								title: '直擊問題',
								name: '針對功課難題 逐一解決',
							},
							{
								title: '即時發問',
								name: '無需等待 步驟簡易 想問就問',
							}
						]
					},
					{
						img: '/static/image/index1/img4.png',
						name: '招聘人材',
						list: [
							{
								title: '目標精準',
								name: '運用教育平台匯集進修人材優勢 容易找到理想僱員',
							},
							{
								title: '直接對話',
								name: '運用平台內設聊天工具 可直接與求職者交談',
							}
						]
					},
				],
				bottom: {
					img1: '/static/image/index1/bottom_img1.png',
					img2: '/static/image/index1/bottom_img2.png',
					img3: '/static/image/index1/bottom_img3.png',
				},
				video_id: ''
			}
		},
		onLoad() {
			that = this
			that.getBanner()
			that.getVideo()
		},
		methods: {
			getBanner() {
				$api.req({
					url: '/api/Index/banner_h5',
				}, function(res) {
					if(res.code == 1) {
						that.bannerList = res.data
					}
				})
			},
			getVideo() {
				$api.req({
					url: '/api/Index/video_h5',
					
				},function(res) {
					if(res.code == 1) {
						that.video = res.data
					}
				})
			},
			changeBanner(e) {
				that.current = e.current
			},
			clickBanner() {
				
			},
			toDetail(index) {
				const query = uni.createSelectorQuery().in(this);
				query.select('#box'+index).boundingClientRect(data => {
				  var top = data.top
				  uni.pageScrollTo({
				  	scrollTop: top,
				  	duration: 100
				  });
				}).exec();
			},
			detail() {
				// $api.jump('/pages/detail/detail?id=' + that.video_id)
			},
			toLogin(index) {
				var href = ''
				if(index == 1) {
					href = 'https://www.daydayu.com/index.html#/shenqing'
				} else {
					href = 'https://www.daydayu.com/index.html#/login'
				}
				location.href = href
			},
			liaison() {
				location.href="https://api.whatsapp.com/send?phone=85255035623"  
			},
			open() {
				location.href="https://www.daydayu.com/index.html#/"  
			},
		},
	}
</script>

<style lang="scss" scoped>
	.content::v-deep {
		.top_bg {
			width: 100%;
			height: 722rpx;
			background: url('../../static/image/index1/top_bg.png') no-repeat;
			background-size: 100%;
			.logo_box {
				width: 100%;
				// padding: 50rpx 0;
				.logo2 {
					width: 182rpx;
					height: 89rpx;
				}
			}
			.top {
				width: 100%;
				height: 120rpx;
				background: #FFFFFF;
				box-shadow: 0px 6rpx 12rpx 0px rgba(0,0,0,0.16);
				box-sizing: border-box;
				padding: 20rpx;
				.logo {
					width: 68rpx;
					height: 68rpx;
				}
				.top_title {
					font-size: 26rpx;
					font-weight: 500;
					color: #333333;
					line-height: 30rpx;
				}
				.top_title2 {
					font-size: 26rpx;
					font-weight: 400;
					color: #999999;
					line-height: 30rpx;
					padding-top: 4rpx;
				}
				.top_btn {
					width: 114rpx;
					height: 46rpx;
					background: #231E7F;
					border-radius: 36rpx;
					font-size: 28rpx;
					font-weight: 400;
					color: #FFFFFF;
				}
			}
			.banner {
				position: relative;
				.u-swiper {
					overflow: unset !important;
				}
				.u-swiper__indicator {
					position: absolute;
					// left: 296rpx;
					bottom: -29rpx;
				}
				.indicator {
					width: 100%;
					@include flex(row);
					justify-content: center;
			
					&_dot {
						 height: 16rpx;
						 width: 16rpx;
						 border-radius: 100px;
						 background: linear-gradient(180deg, #4AC1FD 0%, #B259FA 100%);
						 margin: 0 5px;
						 transition: background-color 0.3s;
						 opacity: 0.35;
				
						&--active {
							 background: linear-gradient(180deg, #4AC1FD 0%, #B259FA 100%);
							 opacity: 1;
						 }
					}
				}
				 .indicator-num {
					padding: 2px 0;
					background-color: rgba(0, 0, 0, 0.35);
					border-radius: 100px;
					width: 35px;
					@include flex;
					justify-content: center;
			
					&__text {
						 color: #FFFFFF;
						 font-size: 12px;
					 }
				}

			}

		}
		.tabs {
			width: 100%;
			box-sizing: border-box;
			padding: 60rpx 0 48rpx;
			.tab_item {
				width: 25%;
				.tab_img {
					width: 68rpx;
					height: 68rpx;
				}
				.tab_text {
					padding-top: 5rpx;
					font-size: 24rpx;
					font-weight: 400;
					color: #666666;
					line-height: 33rpx;
				}
			}
		}
		.video {
			width: 100%;
			height: 422rpx;
			uni-video {
				width: 100%;
				height: 422rpx;
			}
		}
		.btn_group {
			width: 100%;
			padding: 36rpx 0 0;
			.btn1 {
				width: 246rpx;
				height: 68rpx;
				background: #231E7F;
				border-radius: 40rpx;
				margin-right: 64rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 28rpx;
				letter-spacing: 1rpx;
			}
			.btn2 {
				width: 246rpx;
				height: 68rpx;
				background: #5581FB;
				border-radius: 40rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 28rpx;
				letter-spacing: 1rpx;
			}
		}
		.box {
			width: 100%;
			box-sizing: border-box;
			padding: 0 52rpx;
			.box_item {
				width: 100%;
				padding: 48rpx 0 0;
				.title {
					font-size: 36rpx;
					font-weight: 600;
					color: #59CCC2;
					line-height: 36rpx;
					background: linear-gradient(180deg, #4AC1FD 0%, #B259FA 100%);
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
				}
				.box_img {
					// width: 646rpx;
					height: 330rpx;
					margin: 24rpx 0;
				}
				.box_list {
					width: 100%;
					.item_title {
						font-size: 28rpx;
						font-weight: 400;
						color: #666666;
						line-height: 28rpx;
						padding: 26rpx 0 0 24rpx;
						position: relative;
					}
					.item_title::before {
						content: "";
						width: 12rpx;
						height: 12rpx;
						border: 2rpx solid #9E6DFB;
						position: absolute;
						top: 32rpx;
						left: -12rpx;
						border-radius: 50%;
					}
					.item_name {
						font-size: 24rpx;
						font-weight: 400;
						color: #666666;
						line-height: 34rpx;
						padding: 20rpx 0 0 24rpx;
					}
				}
			}
		}
		.bottom {
			width: 100%;
			padding: 40rpx 0 20rpx;
			.bottom_img {
				width: 316rpx;
				height: 368rpx;
				margin-bottom: 48rpx;
			}
			.bottom_left {
				width: 216rpx;
				height: 64rpx;
				margin-right: 56rpx;
			}
			.bottom_right {
				width: 216rpx;
				height: 64rpx;
			}
		}
		.footer {
			width: 100%;
			height: 262rpx;
			background: url('@/static/image/index1/footer_bg.png') no-repeat;
			background-size: 100%;
			.foot_btn1 {
				width: 490rpx;
				height: 68rpx;
				background: linear-gradient(180deg, #4AC1FD 0%, #B259FA 100%);
				border-radius: 8rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 28rpx;
				margin: 8rpx auto 20rpx;
			}
		}
	}
</style>
