<template>
	<home-frame @toPath="toPath">
		<view class="main">
			<view class="one">
				<view class="one_1">
					<input type="text" placeholder="搜索视频" @tap="toCommon('')">
				</view>
				<view class="one_2">
					<button size="mini">筛选</button>
				</view>
			</view>
			<view class="two">
				<scroll-view scroll-y="true" class="scroll-view">
					<view class="list-scroll-view">
						<view class="two_0 two_1">
							<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000">
								<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
								</swiper-item>
							</swiper>
						</view>
						<view class="two_0 two_2">
							<view class="list textOver" v-for="(item,index) in linkList" :key="index">
								<image class="image" :src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''"
									mode="">
								</image>
								<view class="name">
									{{item.name}}
								</view>
							</view>
						</view>
						<view class="two_0 two_4">
							<view class="top">
								<view class="top_1 textOver">
									<span>最新</span>
								</view>
								<view class="top_2">
									<span>更多<uni-icons color="var(--rgbfff)" size="12" type="forward"></uni-icons>
									</span>
								</view>
							</view>
							<view class="info">
								<view class="list" v-for="(item,index) in videoList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
									<view class="name textOver">
										{{item.name}}
									</view>
									<view class="other">
										<view class="other_1">
											<uni-icons type="eye" color="var(--rgbfff)" size="12"></uni-icons>
											{{item.view_num}}
										</view>
										<view class="other_2">
											{{item.time_num}}
										</view>
									</view>
								</view>
							</view>
							<view class="btn">
								<button>查看更多</button>
							</view>
						</view>
						<view class="two_0 two_5">
							<view class="top">
								<view class="top_1 textOver">
									<span>Hot</span>
								</view>
								<view class="top_2">
									<span>更多<uni-icons color="var(--rgbfff)" size="12" type="forward"></uni-icons>
									</span>
								</view>
							</view>
							<view class="info">
								<view class="list" v-for="(item,index) in videoList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
									<view class="name textOver">
										{{item.name}}
									</view>
									<view class="other">
										<view class="other_1">
											<uni-icons type="eye" color="var(--rgbfff)" size="12"></uni-icons>
											{{item.view_num}}
										</view>
										<view class="other_2">
											{{item.time_num}}
										</view>
									</view>
								</view>
							</view>
							<view class="btn">
								<button>查看更多</button>
							</view>
						</view>
						<view class="two_0 two_5">
							<view class="top">
								<view class="top_1 textOver">
									<span>恐怖</span>
								</view>
								<view class="top_2">
									<span>更多<uni-icons color="var(--rgbfff)" size="12" type="forward"></uni-icons>
									</span>
								</view>
							</view>
							<view class="info">
								<view class="list" v-for="(item,index) in videoList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
									<view class="name textOver">
										{{item.name}}
									</view>
									<view class="other">
										<view class="other_1">
											<uni-icons type="eye" color="var(--rgbfff)" size="12"></uni-icons>
											{{item.view_num}}
										</view>
										<view class="other_2">
											{{item.time_num}}
										</view>
									</view>
								</view>
							</view>
							<view class="btn">
								<button>查看更多</button>
							</view>
						</view>
						<view class="two_0 two_6">
							<view class="top">
								<view class="top_1 textOver">
									<span>动作</span>
								</view>
								<view class="top_2">
									<span>更多<uni-icons color="var(--rgbfff)" size="12" type="forward"></uni-icons>
									</span>
								</view>
							</view>
							<view class="info">
								<view class="list" v-for="(item,index) in videoList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
									<view class="name textOver">
										{{item.name}}
									</view>
									<view class="other">
										<view class="other_1">
											<uni-icons type="eye" color="var(--rgbfff)" size="12"></uni-icons>
											{{item.view_num}}
										</view>
										<view class="other_2">
											{{item.time_num}}
										</view>
									</view>
								</view>
							</view>
							<view class="btn">
								<button>查看更多</button>
							</view>
						</view>
						<view class="two_0 two_6">
							<view class="top">
								<view class="top_1 textOver">
									<span>科幻</span>
								</view>
								<view class="top_2">
									<span>更多<uni-icons color="var(--rgbfff)" size="12" type="forward"></uni-icons>
									</span>
								</view>
							</view>
							<view class="info">
								<view class="list" v-for="(item,index) in videoList" :key="index">
									<image class="image"
										:src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
									</image>
									<view class="name textOver">
										{{item.name}}
									</view>
									<view class="other">
										<view class="other_1">
											<uni-icons type="eye" color="var(--rgbfff)" size="12"></uni-icons>
											{{item.view_num}}
										</view>
										<view class="other_2">
											{{item.time_num}}
										</view>
									</view>
								</view>
							</view>
							<view class="btn">
								<button>查看更多</button>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
	</home-frame>
</template>

<script>
	import homeFrame from "../components/home-frame.vue";
	export default {
		components: {
			homeFrame
		},
		data() {
			return {
				bannerList: [ // 轮播图
					{
						name: '轮播图1',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '轮播图2',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}
				],
				linkList: [ //热门链接
					{
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}, {
						name: '热门链接',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}
				],
				videoList: [ // 视频
					{
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}, {
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}, {
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}, {
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}, {
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}, {
						name: '哈哈哈哈',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						],
						view_num: 0,
						time_num: '00:00:00'
					}
				]
			};
		},
		onLoad() {

		},
		onShow() {

		},
		methods: {
			// 跳转页面
			toPath(e) {
				let url = `/${e.route}`;
				if (e.type == '0') uni.navigateTo({
					url
				})
				else if (e.type == '1') uni.redirectTo({
					url
				})
				else if (e.type == '2') uni.reLaunch({
					url
				})
				else if (e.type == '3') uni.switchTab({
					url
				})
			}
		},
	};
</script>

<style lang="scss">
	.main {
		background-color: var(--rgb000);
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 92vh;

		.one {
			background-color: var(--rgb111);
			display: flex;
			padding: 8px;

			.one_1 {
				flex-grow: 1;

				input {
					border: 1px solid var(--rgbf1f);
					height: 30px;
					border-radius: 2px;
					padding: 0 5px;
					font-size: 12px;
				}
			}

			.one_2 {
				button {
					height: 100%;
					background-color: var(--rgbfa4);
					color: var(--rgbfff);
				}
			}
		}

		.two {
			position: relative;
			flex-grow: 1;


			.two_0 {
				margin: 0 0 10px 0;
				padding: 0 8px;

				.top {
					margin: 0 0 10px 0;
					display: flex;
					padding: 5px 0;

					.top_1 {
						flex-grow: 1;

						span {
							color: var(--rgbfff);
							font-size: 20px;
							font-family: monospace;
							font-weight: bold;
						}
					}

					.top_2 {
						span {
							color: var(--rgbfff);
							font-size: 14px;
						}

					}
				}

				.info {
					margin: 0 0 10px 0;
					display: flex;
					justify-content: space-between;
					flex-wrap: wrap;

					.list {
						width: 48%;
						margin: 0 0 10px 0;

						.image {
							width: 100%;
							height: 100px;
							overflow: hidden;
							border-radius: 5px;
						}

						.name {
							font-size: 14px;
							color: var(--rgbfff);
						}

						.other {
							display: flex;
							color: var(--rgbfff);
							font-size: 12px;
							justify-content: space-between;
						}


					}
				}

				.btn {
					button {
						border-radius: 25px;
						background-color: var(--rgbfa4);
						color: var(--rgbfff);
						font-size: 14px;
					}
				}
			}

			.two_1 {
				.swiper {
					height: 200px;
					overflow: hidden;
				}

				.list {
					.image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.two_2 {
				display: flex;
				flex-direction: row;
				flex-wrap: wrap;
				justify-content: space-between;

				.list {
					text-align: center;
					width: 18%;
					margin: 0 0 10px 0;

					.image {
						width: 100%;
						height: 64px;
						border-radius: 90%;
						margin: 0 0 5px 0;
					}

					.name {
						font-size: 12px;
						color: #ffffff;
					}

				}
			}
		}
	}

	.scroll-view {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;

		.list-scroll-view {
			display: flex;
			flex-direction: column;
		}
	}
</style>
