<template>
	<view>
		<view class="containertop">
			<view :class="topselect==0?'containertop1':'containertop2'" @click="clickselect(0)">
				推荐
			</view>
			<view :class="topselect==1?'containertop1':'containertop2'" @click="clickselect(1)">
				新闻
			</view>
			<view :class="topselect==2?'containertop1':'containertop2'" @click="clickselect(2)">
				案例
			</view>
		</view>
		<view class="container" v-if="topselect==0">
			<!--1 hbuilderx 1-->
			<view class="account_number">
				<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
					:interval="interval" :duration="duration">
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
				</swiper>
			</view>
<view class="toptabbarfinance">
<view class="topfinance" @click="electricityprice">
<image class="topfinanceimage" src="https://esos-iot.bjdexn.cn/myminio/project/923d69838676416b91579b2d9ea81a00.png" mode=""></image>
<view class="topfinance_title">
	查询电价
</view>
<view class="topfinance_subtitle">
	掌握收益趋势
</view>
</view>
<view class="topfinance" @click="calculation">  
	<image class="topfinanceimage" src="https://esos-iot.bjdexn.cn/myminio/project/c46bf20166d74c6ca6e0e5af87d5a5de.png" mode=""></image>
	<view class="topfinance_title">
		经济测算
	</view>
	<view class="topfinance_subtitle">
		金融服务全新升级
	</view>
</view>
	<view class="topfinance">
		<image class="topfinanceimage" src="https://esos-iot.bjdexn.cn/myminio/project/22495e19c9b14e01af2251b3a8151752.png" mode=""></image>
		<view class="topfinance_title">
			知识库
		</view>
		<view class="topfinance_subtitle">
			成为资深储能达人
		</view>
	</view>
</view>
			<view class="toptabbar">
				<view class="toptabbar_box">
					<view class="uni-title uni-common-mt">
						<text>最新政策</text>
					</view>
					<view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>

					</view>
				</view>
			</view>
		</view>

		<view class="container" v-if="topselect==1">

			<view class="account_number">
				<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
					:interval="interval" :duration="duration">
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
				</swiper>
			</view>
			<view class="toptabbar">
				<view class="toptabbar_box">

					<view class="uni-title uni-common-mt">
						<text>最新政策</text>
					</view>
					<view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>

					</view>
				</view>
			</view>
		</view>

		<view class="container" v-if="topselect==2">

			<view class="account_number">
				<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
					:interval="interval" :duration="duration">
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
					<swiper-item>
						<image class="swiper-item"
							src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png"
							mode=""></image>
					</swiper-item>
				</swiper>
			</view>
			<view class="toptabbar">
				<view class="toptabbar_box">

					<view class="uni-title uni-common-mt">
						<text>最新政策</text>
					</view>
					<view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="scroll-view-item_title">
								“星空计划plus”帮您再省4分／瓦时！10月..
							</view>
							<view class="scroll-view-item_subtitle">
								万亿储能，蕴藏无限机遇；携手同行，画美好蓝图！2023年..
								奇点能源分布式储能引领者
							</view>
							<image class="scroll-view-item_Himage"
								src="https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png">
							</image>
						</view>

					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<!--  login  -->
<script>   
	export default {
		data() {
			return {
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				topselect: 0
			}
		},
	 onLoad() {
	 	uni.setTabBarItem({
	 		index:0,
	 			text:t('tabBar.publicize')
	 	})
	 	uni.setTabBarItem({
	 		index:1,
	 			text:t('tabBar.products')
	 	})
	 	uni.setTabBarItem({
	 		index:2,
	 			text:t('tabBar.Devices')
	 	})
	 	uni.setTabBarItem({
	 		index:3,
	 		text:t('tabBar.My')
	 	})	
	 },
		methods: {
			changeIndicatorDots(e) {
				this.indicatorDots = !this.indicatorDots
			},
			changeAutoplay(e) {
				this.autoplay = !this.autoplay
			},
			intervalChange(e) {
				this.interval = e.target.value
			},
			durationChange(e) {
				this.duration = e.target.value
			},
			clickselect(e) {
				console.log(e);
				this.topselect = e
			},
			// 查电价
			electricityprice(){
				uni.navigateTo({
					url:'/pages/electricityprice/index'
				})
			},
			// 经济测算
			calculation(){
				uni.navigateTo({
					url:'/pages/economiccalculation/index'
				})
			}
		}
	}
</script> 
<!--  -->
<style scoped>
	.uni-page {
		width: 100%;
		height: 100%;
	}

	.container {
		background: linear-gradient(to bottom, #007545 -40%, #f0f5f5 40%, #f0f5f5 100%);
		box-sizing: border-box;
		padding-bottom: 20rpx;
	}

	.containertop {
		width: 100%;
		height: 140rpx;
		display: flex;
		background-color: rgba(240, 245, 245, 0.8);
		/* 最后一个参数 0.5 表示 50% 透明度 */
		padding-left: 20rpx;
		padding-top: 80rpx;
		box-sizing: border-box;
		position: fixed;
		top: 0rpx;
		left: 0rpx;
		z-index: 9;
	}

	.containertop1 {
		margin-right: 60rpx;
		color: #007545;
	}

	.containertop2 {
		margin-right: 60rpx;
		color: #222222;

	}

	.account_number {
		width: 100%;
		height: 208px;
		box-sizing: border-box;
		/* background-image: url('https://esos-iot.bjdexn.cn/myminio/project/58c54d56edd94c3f9c5fb50f5727ff37.png'); */
		background-repeat: no-repeat;
		background-size: 100%;
	}

	.swiper {
		width: 100%;
		height: 100%;
	}

	.swiper-item {
		display: block;
		width: 100%;
		height: 100%;
		text-align: center;
	}

	.account_image {
		width: 100%;
	}

	.toptabbar {
		width: 100%;
		padding: 0rpx 20rpx;
		margin-top: 30rpx;
		box-sizing: border-box;
	}

	.toptabbar_box {
		width: 100%;
		background-color: #ffffff;
		border-radius: 10rpx;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
	}

	.uni-margin-wrap {
		width: 100%;
		margin-top: 20rpx;
		border-radius: 10rpx;
		overflow: auto;
	}


	.uni-bg-red {
		display: flex;
		flex-direction: column;
		padding: 8rpx;
		box-sizing: border-box;
	}

	.swiper-items {
		width: 100%;
		height: 240rpx;
		border-radius: 10rpx;
		overflow: auto;
	}

	.swiper_title {
		width: 100%;
		height: 20rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
	}

	.scroll-Y {
		height: 300rpx;
	}

	.uni-title {
		margin-bottom: 10rpx;
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
	}

	.scroll-view-item {
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
		font-size: 36rpx;
	}

	.scroll-view-item_H {
		width: 100%;
		height: 456rpx;
		text-align: center;
		font-size: 36rpx;
	}

	.uni-bg-green {
		margin-top: 40rpx;
		border-radius: 10rpx;
	}

	.scroll-view-item_title {
		width: 100%;
		height: 40rpx;
		font-size: 28rpx;
		font-weight: 600;
		white-space: nowrap;
		/* 禁止换行 */
		overflow: hidden;
		/* 隐藏溢出内容 */
		text-overflow: ellipsis;
		/* 显示省略号 */
		width: 100%;
		/* 设置宽度（或具体值） */
		display: block;
		/* 块级元素（或 inline-block） */
		text-align: left;
	}

	.scroll-view-item_subtitle {
		width: 100%;
		height: 40rpx;
		font-size: 24rpx;
		color: #999999;
		margin: 8rpx 0rpx;
		white-space: nowrap;
		/* 禁止换行 */
		overflow: hidden;
		/* 隐藏溢出内容 */
		text-overflow: ellipsis;
		/* 显示省略号 */
		width: 100%;
		/* 设置宽度（或具体值） */
		display: block;
		/* 块级元素（或 inline-block） */
		text-align: left;
	}

	.scroll-view-item_Himage {
		width: 100%;
		height: 360rpx;
		border-radius: 10rpx;
	}
		.toptabbarfinance{
			display: flex;
			justify-content: space-around;
			justify-content: space-between;
			padding: 0rpx 20rpx;
			margin-top: 20rpx;
			box-sizing: border-box;
		}
	.topfinance{
		width: 32%;
		height: 200rpx;
		padding: 10rpx 0rpx;
		border-radius: 8rpx;
		display: flex;
		flex-direction: column;
		 justify-content: center;
		align-items: center;
		background-color: #f0f5f5;
		/* background-color: #ffffff; */
		box-sizing: border-box;
	}
	.topfinanceimage{
		width: 80rpx;
		height: 80rpx;
		
	}
	.topfinance_title{
		font-size: 32rpx;
		font-weight: 550;
		margin-top: 8rpx;
	}
	.topfinance_subtitle{
		font-size: 22rpx;
		color: #959595;
	}
</style>