<template>
	<view class="page">
		<view class="index-navbar">
			<view class="" style="position: relative;">
				<u-navbar title-width='300' title='' :is-back="false" :border-bottom="false"
					:background="{background:'rgba(0,0,0,0)'}" :isFixed="true">
					<view class="u-flex u-row-between" style="padding: 0  28rpx ;width: 100vw;">
						<view class="">
							logo
						</view>
						<view class="index-search u-flex" style="margin-left: 54rpx;" @click="toindexsearch">
							<u-icon name="search" color="#979797" size="30"></u-icon>
							<input style="margin-left: 12rpx;" type="text" class="text1" placeholder="请输入书名、作者搜索"
								:disabled="true">
						</view>
						<view class="button u-flex u-row-center">
							<image src="../../static/images/release.png"
								style="width: 24rpx; height: 24rpx;margin-right: 8rpx;" mode="">
							</image>
							<text @click='contribute'>投稿</text>
						</view>
					</view>
				</u-navbar>
				<!-- <view class="back"></view> -->
				<image class="back1" src="../../static/images/bj.png" mode=""></image>
			</view>
			<view class="u-flex u-row-between pad" style="margin-top:36rpx ;">
				<view class="" v-for="(item,index) in list" :key="index" @click="onchange(index)">
					<text :class="curret==index?'one':'two' ">{{item}}</text>
					<view v-if="curret==index" class="bottom">
					</view>
				</view>
			</view>

		</view>
		<view class="" style="height: 160rpx;"></view>
		<view v-if="curret==0" class="back pad">
			<view class="wrap" v-if="curret==0">
				<u-swiper :list="list"></u-swiper>
			</view>
			<view class="jiang">
				<view class="u-flex u-row-between">
					<text class="title1">获奖教材</text>
					<view class="look">查看更多</view>
				</view>
				<view class="cai u-flex u-row-between">
					<view class="item " v-for="(item,index) in 6" :key="index" @click="toinfo()">
						<image src="/static/logo.png" class="bookimg" mode=""></image>
						<view class="title2 u-line-1">
							ERP财务管理系统管理教程
						</view>
						<view class="u-line-1 author">
							丁爱萍，林秀丽
						</view>
						<view class="bottom1">
							<text class="ding">定价</text>
							<text class="money">¥38.5</text>
						</view>                                                               
					</view>
				</view>
			</view>
			<view class="newbox">
				<view class="u-flex u-row-between">
					<text class="title1">新书推荐</text>
					<view class="look">查看更多</view>
				</view>
				<view class="u-flex video u-row-between">
					<view class="item2 " v-for="(item,index) in 6" :key="index">
						<image src="/static/logo.png" style="width: 322rpx;height: 198rpx;" mode=""></image>
						<view class="title3 u-line-1">武忠祥领衔|25考研数学领域</view>
						<view class="author u-line-1">武忠祥</view>
						<view class="money">¥1288.00</view>
					</view>
				</view>
			</view>
			<view class="" style="height: 30rpx;"></view>
		</view>
		<view v-if="curret==1" style="position: relative;z-index: 200;" class="">
			<ty-paper></ty-paper>
		</view>
		<view v-if="curret==3" style="position: relative;z-index: 200;" class="">
			<ty-video></ty-video>    
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					'首页', '纸质书', '电子书', '名师教学视频'
				],
				curret: 0
			}
		},
		onLoad() {

		},
		methods: {
			onchange(index) {
				this.curret = index
			},
			toindexsearch() {
				uni.navigateTo({
					url: "/pages/index/index-search"
				})
			},
			toinfo(){
				uni.navigateTo({
					url:'/pages/index/bookinfo'
				})
			},
			contribute(){
				uni.navigateTo({
					url:'/pages/index/contribute'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item2 {
		margin-top: 24rpx;
	}

	.title3 {
		width: 314rpx;
		height: 40rpx;
		font-size: 28rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		color: #333333;
		margin-top: 16rpx;
	}

	.video {
		flex-wrap: wrap;
	}

	.newbox {
		// width: 702rpx;
		min-height: 870rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
		margin-top: 20rpx;
		padding: 28rpx 20rpx;
	}

	.bottom1 {
		margin-top: 16rpx;
	}

	.item {
		margin-top: 20rpx;
	}

	.money {
		font-size: 28rpx;
		font-family: SFPro, SFPro;
		font-weight: 400;
		color: #CC3300;
		margin-left: 8rpx;
	}

	.ding {
		font-size: 24rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #222222;
	}

	.author {
		font-size: 24rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #444444;
		margin-top: 8rpx;
	}

	.title2 {
		width: 198rpx;
		height: 36rpx;
		font-size: 26rpx;
		font-family: SFPro, SFPro;
		font-weight: 500;
		color: #333333;
		line-height: 30rpx;
		margin-top: 16rpx;
	}

	.bookimg {
		width: 202rpx;
		height: 266rpx;
		background: #D8D8D8;
		border-radius: 8rpx;
	}

	.cai {
		padding-top: 10rpx;
		flex-wrap: wrap;
	}

	.look {
		width: 130rpx;
		height: 40rpx;
		background: rgba(6, 169, 113, 0.1);
		border-radius: 24rpx;
		font-size: 20rpx;
		font-weight: 400;
		color: #06A971;
		line-height: 40rpx;
		text-align: center;
		// padding: 6rpx 12rpx;
		box-sizing: border-box;
	}

	.title1 {
		font-size: 32rpx;
		font-family: STSongti-SC, STSongti-SC;
		font-weight: bold;
		color: #000000;
	}

	.jiang {
		// width: 702rpx;
		height: 978rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 28rpx 20rpx 0;
	}

	.back {
		position: relative;
		min-height: 80vh;
		z-index: 200;
	}

	.wrap {
		margin-top: 40rpx;
		height: 280rpx;
		border-radius: 20rpx;
	}

	.pad {
		padding: 0 28rpx;
	}

	.one {
		font-size: 32rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		color: #222222;
	}

	.two {
		font-size: 30rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #555555;
	}

	.bottom {
		width: 64rpx;
		height: 12rpx;
		background: linear-gradient(270deg, rgba(6, 169, 113, 0) 0%, #0ED4AA 100%);
		margin-top: -15rpx;
	}

	.index-search {
		width: 414rpx;
		height: 60rpx;
		background: #FFFFFF;
		border-radius: 38rpx;
		padding-left: 34rpx;
	}

	.page {
		// padding: 0 28rpx;
		min-height: 100vh;
		background: rgba(243, 243, 243, 1);
	}

	.button {
		width: 128rpx;
		height: 60rpx;
		background: #06A971;
		border-radius: 30rpx;
		// margin-left: 24rpx;
		line-height: 60rpx;
		text-align: center;
		font-size: 24rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
	}

	.index-navbar {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		z-index: 100;

		// overflow: hidden;
		.back1 {
			position: absolute;
			top: 0;
			left: 0;
			z-index: -1;
			width: 100vw;
			height: 432rpx;
		}
	}
</style>