<template>
	<view class="container">
		<navBar title="GIGESI 吉格斯" :navImg="navImg" :back="false" color="#333333" background="#FFFFFF" />

		<!-- 轮播和订购区 -->
		<view class="swiperAndBook">
			<view class="tab">
				<view class="item" v-for="(item,index) in tabList" :class="[currTabIndex==index?'itemA':'']"
					@click="currTabIndex=index">
					{{item}}
				</view>
			</view>
			<view class="bottomBtn">
				<u-swiper type='img' class="swiper" :list="bannerList" keyName="img_url" indicator indicatorMode="line"
					:autoplay="false" height="996rpx" imgMode="scaleToFill" circular
					@change="e => currentNum = e.current">
					<view slot="indicator">
					</view>
				</u-swiper>

				<view class="bookingAndIndicator">
					<view class="btn">
						<text class="btnTxt">立即订购</text>
						<image src="@/static/index/halfRight.png" mode="" style="width: 24rpx;height: 8rpx;"></image>
					</view>
					<view class="indicatorBox">
						<view class="indicator">
							<view class="indicator__dot" style="" v-for="(item, index) in bannerList" :key="index"
								:class="[index === currentNum ?'indicator__dot--active':'']">
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="bg" style="">
			<view class="controlPart" @click="toPage(1)">
				<view class="top">
					<view class="left">
						<image src="/static/index/part1_icon.png" mode="" style="width: 56rpx;height: 28rpx;"></image>
						<view class="title">
							智能控制系统
						</view>
					</view>
					<image src="/static/index/more.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				</view>
				<view class="con">
					<image src="/static/index/img1.png" mode=""></image>
				</view>
			</view>

			<view class="controlPart" @click="toPage(2)">
				<view class="top">
					<view class="left">
						<image src="/static/index/part1_icon.png" mode="" style="width: 56rpx;height: 28rpx;"></image>
						<view class="title">
							网络规划-全屋WiFi
						</view>
					</view>
					<image src="/static/index/more.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				</view>
				<view class="con">
					<image src="/static/index/img1.png" mode=""></image>
				</view>
			</view>

			<!-- 产品指南 -->
			<view class="productLead">
				<view class="top">
					<view class="left">
						<view class="bottomEng">
							PRODUCT GUIDE
						</view>
						<view class="bt">
							<view class="title">
								产品指南
							</view>
							<image src="/static/index/zhinan.png" mode="" style="width: 32rpx;height: 32rpx;"></image>
						</view>
					</view>
					<image src="/static/index/more.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				</view>
				<view class="con">
					<view class="item" v-for="i in 3">
						<image src="/static/index/img1.png" mode=""></image>
						<view class="bottom">
							灯具指南
						</view>
					</view>
				</view>
			</view>


			<!-- 展厅地址 -->
			<view class="productLead">
				<view class="top">
					<view class="left">
						<view class="bottomEng">
							ADDRESS
						</view>
						<view class="bt">
							<view class="title">
								展厅地址
							</view>
							<image src="/static/index/addr.png" mode="" style="width: 26rpx;height: 36rpx;"></image>
						</view>
					</view>
					<image src="/static/index/more.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				</view>
				<view class="conLast">

					<u-swiper type='def' class="swiper" :defList="bannerList1" keyName="img_url" indicator
						indicatorMode="line" :autoplay="false" previousMargin="30" nextMargin="30" height="490rpx"
						radius="40rpx" imgMode="scaleToFill" bgColor="rgba(255,255,255,0)" circular
						@change="e => currentNum1 = e.current" @click1="jumpLink">
						<view slot="indicator">
						</view>
						<view slot="defCon">
						</view>
					</u-swiper>
					<!-- 自定义轮播图指示器 -->
					<view class="indicatorBox1">
						<view class="indicator1">
							<view class="indicator1__dot1" style="" v-for="(item, index) in bannerList1" :key="index"
								:class="[index === currentNum1 ?'indicator1__dot1--active1':'']">
							</view>
						</view>
					</view>
				</view>
			</view>


			<u-loadmore style="" loadmoreText="已经到底啦" color="#CCCCCC" lineColor="#CCCCCC" line />
		</view>
	</view>
</template>

<script>
	import {
		getActGoodsReq
	} from '@/api/index/index.js'
	export default {
		data() {
			return {
				bannerList: [
					require('@/static/index/main.png'),
					require('@/static/index/main.png'),
					require('@/static/index/main.png')
					// 'https://img1.baidu.com/it/u=1890390320,3399874998&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800',
					// 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					// 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					// 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				],
				bannerList1: [{
						name: '大众',
						phone: '15611111111',
						addrName: '地址1',
						addrInfo: '四川省成都市XX区XX路XX号'
					},
					{
						name: '崩腾',
						phone: '15622222222',
						addrName: '地址1',
						addrInfo: '四川省成都市XX区XX路XX号'
					},
					{
						name: '宝马',
						phone: '15633333333',
						addrName: '地址1',
						addrInfo: '四川省成都市XX区XX路XX号'
					}
				],
				currentNum: 0,
				currentNum1: 0,

				tabList: ['无主灯', '主灯', '吸顶灯'],
				currTabIndex: 0,

				navImg: require('@/static/index/logo.png')
			}
		},
		methods: {
			toPage(i) {
				if (i == 2) {
					uni.navigateTo({
						url: '/pages/index/fullHouseWifi/index'
					})
				} else if (i == 1) {
					uni.navigateTo({
						url: '/pages/index/aiControlSys/index'
					})
				}
			},

			async testReq() {
				let res = await getActGoodsReq()
				this.$toast(res.msg)
				console.log('返回值', res);
			},

		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>