<template>
	<view>
		<view class="section_hot clearfix" v-for="(page, index) in list" :key="index">
			<view class="tui-group-name">
				<view class="tui-group-title">
					<view class="tui-group-l">{{ page.title }}</view>
				</view>
				<view class="tui-sub__desc">{{ page.detail }}</view>
				<view
					class="tui-group-r"
					@click="NavtoHotPage"
				>
				</view>
			</view>
			<template>
				<templateL :pageData="page" :userIdentity="userIdentity" :autoplay="autoplay"></templateL>
			</template>
		</view>
	</view>
</template>

<script>
import templateL from '@/components/cm-module/pageTemplate/templateL.vue'
export default {
	name: 'pageFloor',
	components: {
		templateL
	},
	props: {
		list: {
			type: Array
		},
		userIdentity: {
			type: Number
		},
		autoplay: {
		    type: Boolean,
		    default: true
		},
	},
	data() {
		return {
			
		}
	},
	created() {
		
	},
	watch: {
		list: {
			handler: function (el) {//监听对象的变换使用 function，箭头函数容易出现this指向不正确
				this.list = el
			},
			deep: true
		}
	},
	methods: {
		NavtoHotPage(){//跳新品橱窗页
			this.$api.navigateTo('/pages/goods/good-hot')
		},
		NavToDetailPage(page) {
			//跳转
			this.$api.navigateTo(
				`/pages/goods/good-floorMore?pageType=${this.pageType}&floorId=${page.id}&title=${
					page.title
				}`
			)
		}
	}
}
</script>

<style lang="scss">
.section_hot {
	width: 100%;
	height: 1290rpx;
	background: url(https://static.caimei365.com/app/img/hot/hot-bg.png);
	background-size: cover;
	box-sizing: border-box;
	padding: 0 24rpx;
	float: left;
	border-radius: 16rpx;
}
.tui-group-name {
	width: 100%;
	height: 165rpx;
	box-sizing: border-box;
	padding: 40rpx 0 20rpx 0;
	position: relative;
	border-radius: 16rpx 16rpx 0 0;
	.tui-group-r {
		width: 144rpx;
		height: 54rpx;
		background: url(https://static.caimei365.com/app/img/hot/hot-bt@2x.png);
		background-size: cover;
		position: absolute;
		right: 16rpx;
		top: 69rpx;
	}
}
.tui-group-title {
	width: 100%;
	height: 50rpx;
	line-height: 50rpx;
	float: left;
	.tui-group-l {
		float: left;
		font-size: 38rpx;
		font-weight: bold;
		text-align: left;
		color: #ffffff;
	}
}
.tui-sub__desc {
	width: 100%;
	float: left;
	line-height: 50rpx;
	color: #ffffff;
	font-size: $font-size-28;
}
.section_page_main {
	width: 100%;
	height: auto;
	box-sizing: border-box;
	.recommend-list {
		width: 100%;
		height: 1100rpx;
		position: relative;
		padding-bottom: 20rpx;
		.tui-banner-swiper {
			width: 100%;
			margin: 0 auto;
			height: 1100rpx;
			overflow: hidden;
			transform: translateY(0);
			.floor-item {
				width: 339rpx;
				height: 516rpx;
				margin-right: 20rpx;
				font-size: $font-size-24;
				color: $text-color;
				background: #ffffff;
				line-height: 36rpx;
				border-radius: 16rpx;
				margin-bottom: 20rpx;
				float: left;
				box-sizing: border-box;
				position: relative;
				&:nth-child(2n) {
					margin-right: 0;
				}
				.item-img {
					width: 339rpx;
					height: 339rpx;
					border-radius: 16rpx 16rpx 0 0;
					display: block;
					margin-bottom: 8rpx;
				}
				.floor-item_tag {
					width: 100%;
					height: 32rpx;
					float: left;
					margin: 20rpx 0;
					padding: 0 20rpx;
					box-sizing: border-box;
					text {
						display: inline-block;
						padding: 0 8rpx;
						border: 1px solid #e3ebf7;
						border-radius: 8rpx;
						color: #9aa5b5;
						font-size: $font-size-22;
						line-height: 32rpx;
						text-align: center;
						float: left;
					}
				}
				.floor-item-content {
					width: 100%;
					padding: 0 20rpx;
					box-sizing: border-box;
				}
				.floor-item-act {
					display: block;
					width: 100%;
					height: 32rpx;
					text-align: center;
					box-sizing: border-box;
				}
				.title-none {
					font-size: $font-size-26;
					color: #ff2a2a;
					line-height: 54rpx;
				}
				.title {
					width: 100%;
					height: 70rpx;
					display: flex;
					line-height: 35rpx;
					flex-direction: column;
					margin: 8rpx 0;
					padding: 0;
					position: relative;
					.mclap {
						width: 100%;
						line-height: 35rpx;
						text-overflow: ellipsis;
						display: -webkit-box;
						word-break: break-all;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 2;
						overflow: hidden;
						font-size: 26rpx;
						&.indent {
							text-indent: 95rpx;
						}
					}
					.mclap-tag {
						display: block;
						width: 84rpx;
						height: 32rpx;
						background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
						border-radius: 4rpx 48rpx 4px 4px;
						line-height: 32rpx;
						font-size: $font-size-22;
						color: #ffffff;
						text-align: center;
						position: absolute;
						left: 0;
						top: 0;
					}
				}
				.no-price {
					height: 54rpx;
					line-height: 54rpx;
					display: flex;
					box-sizing: border-box;
					.p-no {
						font-size: $font-size-28;
						color: $text-color;
						display: block;
						float: left;
					}
					.p-stars {
						float: left;
					}
				}
				.price {
					color: #ff2a2a;
					line-height: 54rpx;
					&.none {
						text-decoration: line-through;
						color: #999999;
					}
					.sm {
						font-size: $font-size-24;
					}
					.big {
						font-size: $font-size-28;
					}
				}
			}
		}
	}
	.swiper__recommenddots-box {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex: 1;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		height: 60rpx;
		.swiper__dots-item {
			width: 8rpx;
			height: 8rpx;
			border-radius: 100%;
			margin-left: 6px;
			background-color: #FFFFFF;
		}
		.swiper__dots-long {
			width: 32rpx;
			height: 8rpx;
			border-radius: 4rpx;
			background-color: #FFFFFF;
			transition: all 0.4s;
		}
	}
}
</style>
