<template>
	<view style="width:100%;padding: 12px;" :style="{
			'background-color': goodsInfo.backgroundColor,
		}">
		<view class="her_Two_study" :style="{
			'padding-top':goodsInfo.PaddingTop+'px',
			'padding-right':goodsInfo.PaddingRight+'px',
			'padding-bottom':goodsInfo.PaddingBottom+'px',
			'padding-left':goodsInfo.PaddingLeft+'px'
		}">
			<view class="good-five-stydy" v-for="(item, gli) in goodsInfo.list" :key="gli" :style="{'borderRadius':goodsInfo.SearchFilletPX+'px'}" style="margin-right:30rpx" @click="openGood(item)">
				<view :class="{'img-box2':(!item.name||item.name==''),'img-box':(item.name&&item.name!='')}">
					<image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.picUrl" />
				</view>
				<view class="good-info" v-if="item.name && item.name!=''">
					<view class="good-name">{{ item.name }}</view>
					<view style="width: 130px;">
						<view class="style_five_label" 
						:style="{background:mainColor}" v-for="(subItem,subIndex) in item.lableNameList"  :key="subIndex">
							{{subItem}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
	</view>
</template>

<script>
	import auth from '@/components/auth/index.vue';
	export default {
		components: {
			auth
		},
		props: ['goodsInfo'],
		data() {
			return {
				mainColor: '',
				showAuth: false,
				u: {},
			};
		},
		created() {
			this.mainColor = this.$uiConfig.mainColor;
			
		},
		mounted(){
		    
		},
		methods: {
			openGood(item) {
				this.u = uni.getStorageSync('mall_UserInfo');
			
					
					uni.navigateTo({ url: "/pages/kotra/activeInner?Id=" + item.id });
				
			},
			reloadUserinfo() {
				this.u = uni.getStorageSync('mall_UserInfo');
				// this.showAuth = false;
			},
			//关闭登录窗口
			gbAuth() {
				this.showAuth = false;
			}
		}
	};
</script>

<style>
	.good-five-stydy {
		position: relative;
		margin-bottom: 14px;
		display: flex;
		box-sizing: border-box;
		padding: 0 1px 1px 0;
		width:600px;
	}
	.good-five-stydy:last-child{
		margin-bottom:0!important;
	}
	.good-five-stydy .img-box {
		width: 110px;
		height: 80px;
		border-radius: 4px;
		overflow: hidden;
		box-shadow: 0 4px 10px 1px #D2D2D2;
	}
	
	.good-five-stydy .img-box2 {
		width: 278rpx;
		height: 144rpx;
		border-radius: 4px;
		overflow: hidden;
		box-shadow: 0 4px 10px 1px #D2D2D2;
	}

	.good-five-stydy .good-info {
		height: 70px;
		padding: 0 12px ;
		flex: 1;
		border: 10rpx;
		padding-bottom: 0;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		/* width:20%; */
	}

	.good-five-stydy .good-info .good-name {
		font-size: 13px;
		margin-bottom:5px;
		white-space:pre-wrap;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
		width:130px;
	}

	.good-five-stydy .good-info .good-price-info {
		display: flex;
		justify-items: center;
		align-items: flex-end;
		height: 22px;
		flex: 1;
		padding-bottom: 10rpx;
	}

	.good-five-stydy .good-info .good-price-info .price {
		color: #999999;
		flex: 1;
		font-size: 14px;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.good-five-stydy .good-info .good-price-info .buy {
		width: 24px;
		text-align: right;
	}
	.her_Two_study {
		overflow-x: auto !important;
		display: flex;
		white-space: nowrap;
	}
	.style_five_label{
		float:left;
		padding: 0px 5px;
		border-radius: 2px;
		height: 18px;
		line-height: 18px;
		font-size: 10px;
		color: #FAF8F9;
		margin:0 5px 5px 0;
	}
</style>
