<template>
	<view class="container activity">
		<view class="activity-banner">
			<image class="activity-banner-image" :src="activityBanner" mode=""></image>
		</view>
		<!-- 商品列表 -->
		<view class="container-section tui-skeleton clearfix">
			<view class="product-list" v-for="(pro,index) in productList" :key="index" @click.stop="Details(pro)">
				<view class="product-list-image">
					<image class="product-image" :src="pro.image" mode=""></image>
					<image class="product-icon" :src="StaticUrl+'icon-hot.png'" mode="" v-if="pro.activistatus == 1"></image>
				</view>
				<view class="product-list-msg">
					<view class="product-msg-name">{{ pro.name }}</view>
					<view class="product-list-tag" v-if="pro.activistatus == 1"><text class="tag">活动价</text></view>
					<view class="product-list-pri">
						<view class="price">￥{{ pro.price | PriceFormat}}</view>
						<view class="carts" @click.stop="handAddCarts">
							<view class="carts-add">
								<text class="iconfont icon-gouwuche"></text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				activityBanner:`${this.$Static}banner.png`,
				productList:[
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:2,
						price:888,
					},
					{
						image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
						name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
						activistatus:1,
						price:888,
					},
					
				],//商品列表
			}
		},
		onLoad() {
			
		},
		filters: {
			//处理金额
			PriceFormat: function(text) {
				return Number(text).toFixed(2)
			}
		},
		methods:{
			Details(pro){
				this.$api.navigateTo(`/pages/goods/product?id=${pro.productId}`)
			},
			handAddCarts(pro){
				this.$util.msg('加入成功',1500,true,'success')
			},
		},
		onPullDownRefresh() {//下拉刷新
			uni.stopPullDownRefresh()
		},
		onShow() {
			
		}
	}
</script>

<style lang="scss">
	page{
		height: auto !important;
		background-color: $color-system;
	}
	.activity-banner{
		width: 100%;
		height: 600rpx;
		float: left;
		margin-bottom: 64rpx;
		.activity-banner-image{
			width: 100%;
			height: 100%;
			display: block;
		}
	}
	.container-section{
		width: 100%;
		height: auto;
		box-sizing: border-box;
		padding: 0 24rpx;
		.product-list{
			width: 339rpx;
			height: 532rpx;
			float: left;
			margin-right: 24rpx;
			margin-bottom: 24rpx;
			background-color: #FFFFFF;
			border-radius: 16rpx;
			&:nth-child(2n){
				margin-right: 0;
			}
			.product-list-image{
				width: 100%;
				height: 339rpx;
				float: left;
				position: relative;
				.product-image{
					width: 100%;
					height: 100%;
					display: block;
					border-radius: 16rpx 16rpx 0 0;
				}
				.product-icon{
					width: 68rpx;
					height: 55rpx;
					display: block;
					position: absolute;
					top: 0;
					left: 34rpx;
				}
			}
			.product-list-msg{
				width: 100%;
				height: 193rpx;
				box-sizing: border-box;
				padding: 16rpx 24rpx;
				float: left;
				position: relative;
				.product-msg-name{
					width: 100%;
					height: 72rpx;
					line-height: 35rpx;
					text-overflow: ellipsis;
					overflow: hidden;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					line-clamp: 2;
					-webkit-box-orient: vertical;
					font-size: $font-size-26;
					color: #333333;
					text-align: justify;
					float: left;
				}
				.product-list-tag{
					width: 100%;
					height: 30rpx;
					margin-top: 8rpx;
					float: left;
					.tag{
						display: inline-block;
						width: 80rpx;
						height: 30rpx;
						background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png)top center no-repeat;
						background-size: contain;
						font-size: 22rpx;
						line-height: 30rpx;
						text-align: center;
						color: #f83c6c;
						float: left;
					}
				}
				.product-list-pri{
					width: 100%;
					height: 44rpx;
					float: left;
					position: absolute;
					bottom: 16rpx;
					left: 0;
					box-sizing: border-box;
					padding: 0 24rpx;
					.price{
						float: left;
						font-size:$font-size-26;
						color: #f83c6c;
						font-weight: bold;
						line-height: 44rpx;
					}
					.carts{
						float: right;
						.carts-add{
							width: 44rpx;
							height: 44rpx;
							text-align: center;
							line-height: 44rpx;
							background-color: #ff457b;
							border-radius: 50%;
							.iconfont{
								font-size: 32rpx;
								color: #FFFFFF;
							}
						}
					}
				}
			}
		}
	}
	
</style>
