<template>
	<view class="seckill-section m-t" v-if="list">
		<view class="s-header">
			<view class="f-left-icon">
				<image src="https://hy.liuniu946.com/app/index/d.png" mode=""></image>
			</view>
			<view class="tit-box"><text class="tit">好店好券</text></view>
			<view class="tip-box">
				<text class="tip" >超值体验</text>
			</view>
		</view>
		<view class="box">
			<view class="title">
				 最强商家联盟<br>	
				<text class="text">买到就是赚到</text>
			</view>
			<view class="textNav iconfont iconenter"   @click="navToo('/pages/store/index')" ></view>
		</view>
		<scroll-view class="floor-list" scroll-x>
			<view :style="{width:th}" class="scoll-wrapper" >
				<view v-for="(item, index) in list" :key="index" class="floor-item" @click="navTo('/pages/store/shopDetail?id=' + item.id)">
					<image class="list-image" :src="item.image" mode="aspectFill"></image>
					<text class="title clamp">{{ item.name }}</text>
					<view class="price-box" v-if="item.cou.lenght">
						<image src="https://hy.liuniu946.com/app/index/yhj.png" mode=""></image>
						<view  class="price">
							{{ item.cou[0].coupon_price }}元代金卷
						</view>
						<view class="price_1">
						   ￥{{ item.cou[0].use_min_price }}
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
	import {
		sycoustore,
	} from '@/api/order.js';
	import {
		timeComputed
	} from '@/utils/rocessor.js';
	export default {
		components: {
			uniCountdown
		},
		data() {
			return {
				list: [],
				page: 1,
				limit: 10,
				showTime: '', //显示的时间
				showTImeId: '', //显示时间id用于查询数据
				stopTimeH: 0,
				stopTimeM: 0,
				stopTimeS: 0,
				th:'100%'
			};
		},
		created: function(e) {
			// 载入数据
			this.getList();
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url
				});
			},
			navToo(url) {
				uni.switchTab({
					url
				})
			},
			getList() {
				sycoustore({
							page: this.page,
							limit: this.limit
						},
						this.showTImeId
					)
					.then(e => {
						this.list = e.data.list;
						console.log(e.data.list,'999999999');
						if(this.list.length>3){
							this.th=this.list.length*230+'rpx'
						}
						console.log(this.list.length,'ss');
					})
					.catch(e => {
						console.log(e);
					});
			},
			
		}
	};
</script>

<style lang="scss">
	
	/*优惠券专区 */
	.yuezhuan{
		
		text-align: center;
		z-index: 999;
		position: absolute;
		text-align: center;
		width:30%;
		
	}
	.seckill-section {
		position: relative;
		margin-top: 20rpx;
		background-color: #fff;
		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%;
				}
			}
			.tip-box {
				flex-grow: 1;
				display: flex;
				justify-content: flex-start;
				align-items: center;
			}

			.tip {
				font-size: $font-sm;
				color:#95A0B1;
				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;
			}
		}
		.box{
			position: absolute;
			width:92%;
			display: flex;
			color: #fff;
			height: 220rpx;
			border-top-right-radius: 20rpx;
			border-top-left-radius: 20rpx;
			background: linear-gradient(to right, #F75022, #FF8B6C);
			.title{
				padding: 20rpx;
				font-size:38rpx;
				margin-left: 20rpx;
				
				.text{
					font-size:28rpx ;
				}
			}
			.textNav {
				text-align: center;
				margin-left: 40%;
				margin-top:40rpx;
				line-height: 1;
				padding: 15rpx 0;
				flex-shrink: 0;
				flex-grow: 1;
				min-width: 100rpx;
			}
			}

		.floor-list {
		
			margin-top: 120rpx;
			white-space: nowrap;
			background-color:#F4F4F4;
			padding: 20rpx;
			border-bottom-right-radius: 20rpx;
			border-bottom-left-radius: 20rpx;
		}

		.scoll-wrapper {
			z-index: 99;
			top: -80rpx;
			border-radius: 20rpx;
			padding: 20rpx;
			background-color: #fff;
			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;
				/* #ifdef MP-WEIXIN */
				height: 340rpx;
				/* #endif */
				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;
				}
				/* #ifdef MP-WEIXIN */
				.price-box{
					overflow: hidden;
				}
				/* #endif */
				.price-box image{
					margin-top: 4rpx;
					margin-left:8rpx;
					width: 180rpx;
					height: 40rpx;
				}
				
				.price {
					text-align: center;
					margin-top: -40rpx;
					margin-left: 20rpx;
					font-size:20rpx !important;
					position: absolute;
					color:#fff;
				}
				.price_1{
					font-size: 22rpx;
					font-weight: 500;
					color:#FF4C4C;
					line-height: 26px;
				}
			}
			.item{
				display: flex;
				justify-content: center;
				margin: 0 auto;
			}
		}
	}
</style>
