<template>
	<view class="seckill-section m-t" v-if="list.length>0">
		<view class="s-header">
			<view class="f-left-icon">
				<image src="https://hy.liuniu946.com/app/index/huo.png" mode=""></image>
			</view>
			<view class="tit-box"><text class="tit">今日上新</text></view>
			<view class="textNav iconfont iconenter" @click="navTo('/pages/index/sx')">更多</view>
		</view>
		<scroll-view class="floor-list" scroll-x>
			<view class="scoll-wrapper position-relative" >
				<view v-for="(item, index) in list" :key="index" class="floor-item" @click="navTo('/pages/product/product?id=' + item.id + '&isVip=' + 0)">
					<image class="list-image" :src="item.image" mode="aspectFill"></image>
					<text class="title clamp">{{ item.store_name }}</text>
					<view class="price-box">
						<text class="price">￥{{ item.price }}</text>
						<!-- <text class="price1">原价{{ item.ot_price }}</text> -->
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		getSeckillList,
		getSeckillClass
	} from '@/api/product.js';
	import {
		timeComputed
	} from '@/utils/rocessor.js';
	export default {
		props: {
			list: {
			    type: Array,
			    default () {
			      return []
			    }
			  },
		},
		data() {
			return {
			};
		},
		created: function(e) {
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url
				});
			},
		}
	};
</script>

<style lang="scss">
	
	/* 秒杀专区 */
	.yuezhuan{
		text-align: center;
		z-index: 999;
		position: absolute;
		text-align: center;
		width:30%;
		
	}
	.yuezhuan image{
		margin-top: -12rpx;
		float: right;
		width: 80rpx;
		height: 80rpx;
	}
	.yuezhuan text{
		margin-top: 8rpx;
		text-align: center;
		font-size: 22rpx;
		color: #AD0B04;
		margin-left: 80rpx;
		position: absolute;
	}
	.seckill-section {
		padding: 4rpx 30rpx 24rpx;

		.s-header {
			display: flex;
			align-items: center;
			height: 92rpx;
			line-height: 1;

			.tit-box {
				flex-shrink: 0;
			}

			.tit {
				@extend %font-title;
			}

			.f-left-icon {
				// @extend %f-left-icon;
				margin-right: 5rpx;
				width: 37rpx;
				height: 36rpx;

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

			.textNav {
				line-height: 1;
				padding: 15rpx 0;
				flex-shrink: 0;
				flex-grow: 1;
				min-width: 100rpx;
			}

			.tip-box {
				flex-grow: 1;
				display: flex;
				justify-content: flex-start;
				align-items: center;
			}

			.tip {
				font-size: $font-sm;
				color: #FF4C4C;
				font-weight: bold;
				padding-left: 10rpx;
				padding-right: 10rpx;
			}

			.timer {
				display: inline-block;
				width: 40rpx;
				height: 36rpx;
				text-align: center;
				line-height: 36rpx;
				margin-right: 14rpx;
				font-size: $font-sm + 2rpx;
				color: #fff;
				border-radius: 2px;
				background: rgba(0, 0, 0, 0.8);
			}

			.iconenter {
				font-size: $font-sm;
				color: $font-color-light;
				flex: 1;
				text-align: right;
			}
		}

		.floor-list {
			white-space: nowrap;
			background-color: white;
			padding: 20rpx;
			border-radius: 5rpx;
			box-shadow: $box-shadow;
		}

		.scoll-wrapper {
			
			display: flex;
			justify-content: left;
			align-items: center;

			.noGoodsBg {
				display: flex;
				align-items: center;
				justify-content: center;
				height: 100%;
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				color: $font-color-light;
			}
			
			.floor-item {
				
				display: flex;
				justify-content: center;
				flex-direction: column;
				width: 200rpx;
				height: 300rpx;
				margin: 0 10rpx;
				background: #FFFFFF;
				border: 3rpx solid #F0E6CF;
				border-radius: 10rpx;

				.list-image {
					margin: 10rpx auto;
					width: 180rpx;
					height: 180rpx;
					border-radius: 6rpx;
				}
				.clamp{
					margin-left: 10rpx;
				}
				.price-box{
					display: flex;
				}
				.price {
					color: $color-red;
				}
				.price1{
					font-size: 22rpx;
					font-weight: 500;
					text-decoration: line-through;
					color: #969696;
					line-height: 26px;
				}
			}
			.item{
				display: flex;
				justify-content: center;
				margin: 0 auto;
			}
		}
	}
</style>
