<template name="cm-price">
	<!--促销活动弹窗提示-->
	<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
		<view class="tui-popup-box clearfix">
			<view class="tui-scrollview-box">
				<view class="box-text">
					<text>促销时间：</text>
					<text class="txt" v-if="Promotion.status == 1">不限时</text>
					<text class="txt" v-else>{{ Promotion.beginTime }} ～ {{ Promotion.endTime }}</text>
				</view>
				<view class="box-title" v-show="Promotion.mode ==2">
					<text>此商品参与{{Promotion.name}}，满</text>
					<text class="txt">¥{{Promotion == null ? '0.00' : Promotion.touchPrice | NumFormat}}</text>减
					<text class="txt">¥{{Promotion == null ? '0.00' : Promotion.reducedPrice | NumFormat}}</text>
				</view>
				<view class="box-title" v-show="Promotion.mode==3">
					<text>此商品参与{{Promotion.name}}，满</text>
					<text class="txt">¥{{Promotion.touchPrice}}</text>赠送商品（赠品见订单详情）
				</view>
			</view>
			<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
				<view class="tui-flex-1">
					<view class="tui-button" @click="hidePopup()">了解</view>
				</view>
			</view>
		</view>	
	</tui-bottom-popup>
</template>

<script>
	import { mapState,mapMutations } from 'vuex'
	export default{
		name:'cm-price',
		props:{
			Promotion:{
				type:Object,
			},
			popupShow:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return{
				isIphoneX:this.$store.state.isIphoneX,
			}
		},
		filters: {
			NumFormat:function(text) {//处理金额
				return Number(text).toFixed(2);
			},
		},
		created() {
			
		},
		computed: {
			...mapState(['hasLogin','isWxAuthorize'])
		},
		methods:{
			hidePopup(){
				this.$parent.popupShow = false
			},
			goGoodActiveFn(id){
				this.$parent.popupShow = false
				this.$api.navigateTo('/pages/goods/goods-active?id='+id)
			}
		},
		
	}
</script>

<style lang="scss">	
	.tui-flex-1 {
		flex: 1;
	}
	.tui-popup-box {
		position: relative;
		box-sizing: border-box;
		min-height: 220rpx;
		padding:24rpx 24rpx 0 24rpx;
	}
	.tui-scrollview-box{
		width: 100%;
		height: auto;
		float: left;
		box-sizing: border-box;
		.ladder-main{
			width: 100%;
			height: 320rpx;
			border: 1px solid rgba(225,86,22,0.3);
			border-radius: 10rpx;
			.ladder-item{
				width: 100%;
				height: 80rpx;
				float: left;
				border-bottom: 1px solid rgba(225,86,22,0.3);
				&:nth-child(1){
					.ladder-item-td{
						color: #333333;
					}
				}
				&:last-child{
					border-bottom: none;
				}
				.ladder-item-td{
					width:50%;
					text-align: center;
					line-height: 80rpx;
					font-size: $font-size-24;
					color: $color-system;
					box-sizing: border-box;
					float: left;
					&:nth-child(1){
						border-right: 1px solid rgba(225,86,22,0.3);
					}
				}
			}
		}
		.box-title{
			font-size: $font-size-26;
			color: $text-color;
			text-align: left;
			line-height: 56rpx;
			.txt{
				color: $color-system;
				margin: 0 8rpx;
			}
		}
		.box-text{
			font-size: $font-size-26;
			color: $text-color;
			text-align: left;
			line-height: 56rpx;
			.txt{
				color: $color-system;
			}
		}
		.box-product{
			width: 100%;
			height: auto;
			margin-top: 20rpx;
			.title{
				font-size: $font-size-24;
				color: $text-color;
				text-align: left;
				line-height: 54rpx;
			}
			.box-product-main{
				width: 100%;
				height: 136rpx;
				.image{
					width: 134rpx;
					height: 134rpx;
					border: 1px solid #EBEBEB;
					float: left;
					image{
						width: 100%;
						height: 100%;
						display: block;
					}
				}
				.info{
					width: 540rpx;
					height: 134rpx;
					float: left;
					margin-left: 16rpx;
					position: relative;
					.name{
						width: 100%;
						float: left;
						line-height: 40rpx;
						font-size: $font-size-28;
						color: $text-color;
						-o-text-overflow: ellipsis;
						text-overflow: ellipsis;
						display: -webkit-box;
						word-break: break-all;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 2;
						overflow: hidden;
					}
					.num{
						width: 100%;
						height: 44rpx;
						font-size: $font-size-24;
						color: $text-color;
						text-align: left;
						line-height: 44rpx;
						position: absolute;
						bottom: 0;
						left: 0;
					}
				}
			}
		}
	}
	
	.tui-popup-btn {
		width: 100%;
		height: auto;
		float: left;
		margin-top: 24rpx;
		.tui-button{
			width: 100%;
			height: 88rpx;
			background: $btn-confirm;
			line-height: 88rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: $font-size-28;
			border-radius: 14rpx;
		}
	}
</style>





















