<template name="goods">
	<view class="goods-template">
		 <!-- 商品列表 -->
		<view class="goods-list">
			<view v-for="(item, index) in shopOrderData" :key="index" class="goods-item clearfix">
				<view class="shoptitle">
					<view class="title-logo"><image :src="item.shopLogo" mode=""></image></view>
					<view class="title-text">{{item.shopName}}</view> 
				</view>
				<view class="productlist" v-for="(pros,idx) in item.orderProductList" :key="idx">
					<view class="goods-pros-t">
						<view class="pros-left">
							<view class="pros-img"><image :src="pros.productImage" alt="" /></view>
						</view>
						<view class="pros-product">
							<view class="producttitle">{{pros.name}}</view>
							<view class="productspec">规格：{{pros.productUnit}}</view>
							<view class="product-view">
								<view class="view-num">单价：{{pros.price.toFixed(2)}}</view>
								<view class="view-num">数量(赠品)：{{pros.num}}({{pros.presentNum}})</view>
							</view>
							<view class="product-view">
								<view class="view-num">税率：{{pros.taxRate}}%</view>
								<view class="view-num">折扣：{{discount == null ? '0' : discount}}%</view>
							</view>
							<view class="product-view">
								<view class="view-num">折后单价：{{pros.discountPrice.toFixed(2)}}</view>
							</view>
							<view class="product-view">
								<view class="view-num">合计：{{pros.totalFee.toFixed(2)}}</view>
							</view>
						</view>	
					</view>
				</view>	
				<view class="goods-pros-m" v-if="item.note!=''">
					<view class="m-text">留言:</view>
					<view class="m-input">
						<view class="text">{{item.note ? item.note : ''}}</view>
					</view>	
				</view>
				<view class="goods-pros-b">
					<view class="count">共{{item.itemCount}}件商品</view>
					<view class="sum">商品总额：<text class="money">￥{{item.productAmount.toFixed(2)}}</text></view>
				</view>
			</view>
		</view>	
	</view>
</template>

<script>
	export default{
		name:"goods",
		props:{
			shopOrderData:{
				type:Array
			}
		},
		data() {
			return{
				initData:[]
			}
		},
		created(){
			this.initData = this.shopOrderData
		},
		computed: {

		},
		methods:{

		}
	}
</script>

<style lang="scss">
	.goods-template{
		width: 100%;
		height: auto;
		background: #FFFFFF;
		float: left;
		margin-top: 24rpx;
		.goods-list{
			width: 100%;
			height: auto;
			background: #F7F7F7;
			.goods-item{
				width: 702rpx;
				padding:24rpx;
				height: auto;
				background: #FFFFFF;
				margin-bottom: 24rpx;
				&:last-child{
					margin-bottom: 0;
				}
			}
			.shoptitle{
				width: 100%;
				float: left;
				height: 56rpx;
				line-height: 56rpx;
				margin-bottom: 12rpx;
				.title-logo{
					width: 48rpx;
					height: 48rpx;
					float: left;
					image{
						width: 48rpx;
						height: 48rpx;
					}
				}
				.title-text{
					float: left;
					margin-left: 16rpx;
					font-size: $font-size-28;
					color: $text-color;
					text-align: left;
					line-height: 56rpx;
					font-weight: bold;
				}
			}
			.productlist{
				width: 100%;
				height: auto;
			}	
			.goods-pros-t{
				display: flex;
				align-items: center;
				width: 100%;
				height: 260rpx;
				padding: 12rpx 0;
				.pros-left{
					width: 210rpx;
					height: 100%;
					margin:0 26rpx 0 0;
				}
				.pros-img{
					width: 210rpx;
					height: 210rpx;
					border-radius: 10rpx;
					border:1px solid #f3f3f3;
					image{
						width: 100%;
						height: 100%;
						border-radius: 10rpx;
					}
				}
			}
			.pros-product{
				width: 468rpx;
				height: 100%;
				line-height: 36rpx;
				font-size: $font-size-26;	
				position: relative;
				.product-view{
					width: 100%;
					height: auto;
					display: flex;
					.view-num{
						flex: 1;
						text-align: left;
						font-size: $font-size-26;
						color: #666666;
						line-height: 44rpx;
					}
				}
				.producttitle{
					width: 100%;
					display: inline-block;
					height: auto;							
					text-overflow:ellipsis;
					display: -webkit-box;
					word-break: break-all;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
					margin-bottom: 8rpx;
				}
				.productspec{
					height: 44rpx;
					color: #666666;
					line-height: 44rpx;
				}
				.productprice{
					height: 48rpx;
					position: absolute;
					width: 100%;
					bottom: 0;
					.price{
						line-height: 48rpx;
						font-size: $font-size-28;
						width: 48%;
						color: #FF2A2A;
						float: left;
					}
					.count{
						height: 100%;
						float: right;
						position: relative;
						.small{
							color: #666666;
						}
					}
				}
			}
			.goods-pros-m{
				width: 100%;
				height: auto;
				line-height: 76rpx;
				font-size: $font-size-26;
				color: $text-color;
				float: left;
				.m-text{
					width: 62rpx;
					float: left;
					padding-right: 20rpx;
					font-weight:bold;
				}
				.m-input{
					display: -webkit-box;
					display: -webkit-flex;
					display: flex;
					-webkit-box-align: center;
					-webkit-align-items: center;
					align-items: center;
					position: relative;
					width: 620rpx;
					height: auto;
					padding: 20rpx 0 10rpx 0;
					background: #FFFFFF;
					.text{
						width: 100%;
						height: 100%;
						font-size: $font-size-26;
						line-height: 36rpx;
						color: #333333;
					}
				}
			}
			.goods-pros-b{
				width:100%;
				height: 40rpx;
				margin-top: 12rpx;
				float: left;
				.count{
					float: left;
					font-size: $font-size-28;
					line-height: 40rpx;
					color: $text-color;
					display: flex;
					justify-content: flex-end;
				}
				.sum{
					font-size: $font-size-28;
					line-height: 40rpx;
					color: $text-color;
					display: flex;
					justify-content: flex-end;
					.money{
						color: #FF2A2A;
						font-size: $font-size-28;
					}
				}
			}
		}
	}
</style>
