<template>
<view class="model-6">
		<view :style="{backgroundColor:editablePageConfig.editable_page_config_content.back_color}" class="goods-list" :class="editablePageConfig.editable_page_config_content.show_format==2?'single-column':'double-column'">
		<view class="goods-item margin-bottom" v-for="(goods,index) in editablePageConfig.editable_page_config_content.goods_list" :key="index" @click="productClick(goods.goods_id)">
			<view class="goods-img">
			  <image mode="aspectFit" class="img" :src="goods.goods_image">
			  <view class="goods-tag-img" v-if="editablePageConfig.editable_page_config_content['if_show_goods_icon']==1 && editablePageConfig.editable_page_config_content['goods_icon']!=''">
				  <image mode="aspectFit" class="img" :src="editablePageConfig.editable_page_config_content.goods_icon" />
			  </view>
			</view>
			<view class="info-wrap">
			  <view class="name-wrap">
				<view class="goods-name">{{goods.goods_name}}</view>
			  </view>
			  <view class="pro-info">
				<view class="delete-price" v-if="goods['goods_marketprice']>0">
				  <text class="unit">¥</text>{{parseFloat(goods.goods_marketprice)}}
				</view>
				<view class="delete-price" v-if="goods['goods_price']>goods['goods_promotion_price']">
					<text class="unit">¥</text>{{parseFloat(goods.goods_price)}}
				</view>
				<view class="sale">{{goods.goods_salenum}}人已购</view>
			  </view>
			  <view class="lineheight-clear">
				<view class="discount-price">
				  <text class="unit">¥</text>
				  <text class="price">{{parseFloat(goods.goods_promotion_price)}}</text>
				</view>
			  </view>
			</view>
		  </view>
		</view>
</view>
</template>

<script>

export default {
  name: 'Model6',
  data () {
    return {}
  },
  props: ['editablePageConfig','editablePage'],
  components: {
  },
  computed: {

  },
  methods: {
	  productClick(goods_id) {
		  uni.navigateTo({url: '/pages/home/goodsdetail/Goodsdetail?goods_id='+goods_id })
	  }
  }
}
</script>

<style lang="scss" scoped>
.model-6 .goods-list{
	border-radius:5px;
}
.model-6 .goods-list.single-column .goods-item {
	padding:13px;
	background:#fff;
	margin:5px 0;
	border-radius:5px;
	display:flex;
	position:relative;
}
.model-6 .goods-list.single-column .goods-item:first-child{
	margin-top: 0;
}
.model-6 .goods-list.single-column .goods-item:last-child{
	margin-bottom: 0;
}
.model-6 .goods-list.single-column .goods-item .goods-img {
	width:90px;
	height:90px;
	overflow:hidden;
	border-radius:5px;
	margin-right:10px;
	background:#e5e5e5;
	display:flex;
	justify-content:center;
	align-items:center;
}
.model-6 .goods-list.single-column .goods-item .goods-img .img {
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.single-column .goods-item .goods-tag {
	color:#fff;
	line-height:1;
	padding:4px 6px;
	position:absolute;
	border-top-left-radius:5px;
	border-bottom-right-radius:5px;
	top:13px;
	left:13px;
	font-size:12px;
	background: #FF4544 
}
.model-6 .goods-list.single-column .goods-item .goods-tag-img {
	position: absolute;
	border-top-left-radius: 5px;
	width: 40px;
	height: 40px;
	top: 13px;
	left: 13px;
	z-index: 5;
	overflow: hidden;
	margin: 0;
}
.model-6 .goods-list.single-column .goods-item .goods-tag-img .tag-wrap{
	background: #eee;
	font-size: 12px;
	padding: 5px;
	text-align: center;
	color: #999;
}
.model-6 .goods-list.single-column .goods-item .goods-tag-img .img {
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.single-column .goods-item .info-wrap {
	flex:1;
	display:flex;
	flex-direction:column;
}
.model-6 .goods-list.single-column .goods-item .name-wrap {
	flex:1;
}
.model-6 .goods-list.single-column .goods-item .goods-name {
	font-size:14px;
	line-height:1.3;
	overflow:hidden;
	text-overflow:ellipsis;
	display:-webkit-box;
	-webkit-line-clamp:2;
	-webkit-box-orient:vertical;
}
.model-6 .goods-list.single-column .goods-item .discount-price {
	display:inline-block;
	font-weight:bold;
	line-height:1;
	margin-top:8px;
	color:#f44;
}
.model-6 .goods-list.single-column .goods-item .discount-price .unit {
	font-size:12px;
}
.model-6 .goods-list.single-column .goods-item .pro-info {
	display:flex;
	margin-top:8px;
}
.model-6 .goods-list.single-column .goods-item .pro-info .delete-price {
	text-decoration:line-through;
	flex:1;
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.single-column .goods-item .pro-info .sale {
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.single-column .goods-item .pro-info .sale {
	font-size:12px;
}
.model-6 .goods-list.single-column .goods-item .pro-info > view {
	line-height:1;
}
.model-6 .goods-list.single-column .goods-item .pro-info > view:nth-child(2) {
	text-align:right;
}
.model-6 .goods-list.single-column .goods-item .member-price-tag {
	display:inline-block;
	width:30px;
	line-height:1;
	margin-left:3px;
}
.model-6 .goods-list.single-column .goods-item .member-price-tag image {
	width:100%;
}
.model-6 .goods-list.double-column {
	display:flex;
	flex-wrap:wrap;
	margin: 0;
	padding: 0;
}
.model-6 .goods-list.double-column .goods-item {
	flex:1;
	position:relative;
	background:#fff;
	flex-basis:48%;
	max-width:calc((100% - 15px) / 2);
	margin-right:15px;
	margin-bottom:10px;
	border-radius:5px;
}
.model-6 .goods-list.double-column .goods-item:nth-child(2n) {
	margin-right:0;
}
.model-6 .goods-list.double-column .goods-item .goods-img {
	position:relative;
	height:0;
	overflow:hidden;
	padding-top:100%;
	border-top-left-radius:5px;
	border-top-right-radius:5px;
	background-color:#E8E8E8;
}
.model-6 .goods-list.double-column .goods-item .goods-img .img {
	position:absolute;
	top:50%;
	left:50%;
	transform:translate(-50%,-50%);
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.double-column .goods-item .goods-tag {
	color:#fff;
	line-height:1;
	padding:4px 8px;
	position:absolute;
	border-bottom-right-radius:5px;
	top:0;
	left:0;
	font-size:12px;
	background: #FF4544;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img {
	position: absolute;
	border-top-left-radius: 5px;
	width: 40px;
	height: 40px;
	top: 0;
	left: 0;
	z-index: 5;
	overflow: hidden;
	margin: 0;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
	background: #eee;
	font-size: 12px;
	padding: 5px;
	text-align: center;
	color: #999;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
	background: #eee;
	font-size: 12px;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .img {
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.double-column .goods-item .info-wrap {
	padding:0 13px 13px 13px;
}
.model-6 .goods-list.double-column .goods-item .goods-name {
	font-size:14px;
	line-height:1.3;
	overflow:hidden;
	text-overflow:ellipsis;
	display:-webkit-box;
	-webkit-line-clamp:2;
	-webkit-box-orient:vertical;
	margin-top:10px;
}
.model-6 .goods-list.double-column .goods-item .discount-price {
	display:inline-block;
	font-weight:bold;
	line-height:1;
	margin-top:8px;
	color:#f44;
	font-size: 14px;
}
.model-6 .goods-list.double-column .goods-item .pro-info {
	display:flex;
	margin-top:8px;
}
.model-6 .goods-list.double-column .goods-item .pro-info .delete-price {
	text-decoration:line-through;
	flex:1;
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.double-column .goods-item .pro-info .sale {
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.double-column .goods-item .pro-info .delete-price .unit {
	margin-right:3px;
}
.model-6 .goods-list.double-column .goods-item .pro-info > view {
	line-height:1;
}
.model-6 .goods-list.double-column .goods-item .pro-info > view:nth-child(2) {
	text-align:right;
}
.model-6 .goods-list.double-column .goods-item .member-price-tag {
	display:inline-block;
	width:30px;
	line-height:1;
	margin-left:3px;
}
.model-6 .goods-list.double-column .goods-item .member-price-tag image {
	width:100%;
}
.model-6 .goods-list.double-column {
	display:flex;
	flex-wrap:wrap;
	margin: 0;
	padding: 0;
}
.model-6 .goods-list.double-column .goods-item {
	flex:1;
	position:relative;
	background:#fff;
	flex-basis:48%;
	max-width:calc((100% - 15px) / 2);
	margin-right:15px;
	margin-bottom:10px;
	border-radius:5px;
}
.model-6 .goods-list.double-column .goods-item:nth-child(2n) {
	margin-right:0;
}
.model-6 .goods-list.double-column .goods-item .goods-img {
	position:relative;
	height:0;
	overflow:hidden;
	padding-top:100%;
	border-top-left-radius:5px;
	border-top-right-radius:5px;
	background-color:#E8E8E8;
}
.model-6 .goods-list.double-column .goods-item .goods-img .img {
	position:absolute;
	top:50%;
	left:50%;
	transform:translate(-50%,-50%);
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.double-column .goods-item .goods-tag {
	color:#fff;
	line-height:1;
	padding:4px 8px;
	position:absolute;
	border-bottom-right-radius:5px;
	top:0;
	left:0;
	font-size:12px;
	background: #FF4544;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img {
	position: absolute;
	border-top-left-radius: 5px;
	width: 40px;
	height: 40px;
	top: 0;
	left: 0;
	z-index: 5;
	overflow: hidden;
	margin: 0;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
	background: #eee;
	font-size: 12px;
	padding: 5px;
	text-align: center;
	color: #999;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
	background: #eee;
	font-size: 12px;
}
.model-6 .goods-list.double-column .goods-item .goods-tag-img .img {
	width: 100%;
	height: 100%;
}
.model-6 .goods-list.double-column .goods-item .info-wrap {
	padding:0 13px 13px 13px;
}
.model-6 .goods-list.double-column .goods-item .goods-name {
	font-size:14px;
	line-height:1.3;
	overflow:hidden;
	text-overflow:ellipsis;
	display:-webkit-box;
	-webkit-line-clamp:2;
	-webkit-box-orient:vertical;
	margin-top:10px;
}
.model-6 .goods-list.double-column .goods-item .discount-price {
	display:inline-block;
	font-weight:bold;
	line-height:1;
	margin-top:8px;
	color:#f44;
}
.model-6 .goods-list.double-column .goods-item .pro-info {
	display:flex;
	margin-top:8px;
}
.model-6 .goods-list.double-column .goods-item .pro-info .delete-price {
	text-decoration:line-through;
	flex:1;
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.double-column .goods-item .pro-info .sale {
	font-size:12px;
	line-height:1;
	color:#999;
}
.model-6 .goods-list.double-column .goods-item .pro-info .delete-price .unit {
	margin-right:3px;
}
.model-6 .goods-list.double-column .goods-item .pro-info > view {
	line-height:1;
}
.model-6 .goods-list.double-column .goods-item .pro-info > view:nth-child(2) {
	text-align:right;
}
.model-6 .goods-list.double-column .goods-item .member-price-tag {
	display:inline-block;
	width:30px;
	line-height:1;
	margin-left:3px;
}
.model-6 .goods-list.double-column .goods-item .member-price-tag image {
	width:100%;
}
</style>
