<template name="cm-price">
	<!-- 商品详情价格判断 -->
	<view class="wrap-main">
		<view class="" v-if="userIdentity == 1">
			<view class="wrap-main-price">
				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
					<view class="p-active" v-if="product.actStatus == 1">
						<image class="icon-active" :src="iconActive" mode="" ></image>
					</view>
					<view class="p-price tui-skeleton-fillet">
						<text class="txt sm">￥</text>
						<text class="txt big">{{retailPrice}}</text>
						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
					</view>
					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
				</view>
				<view class="wrap-ladder" v-else>
					<view class="ladder-text">
						<text class="ladder-h1">说明：</text>
						<text class="ladder-p">本商品有以下优惠购物方案</text>
					</view>
					<view class="ladder-main tui-skeleton-fillet">
						<view class="ladder-left">
							<view class="ladder-b">起订量:</view>
							<view class="ladder-b">价格:</view>
						</view>
						<view class="ladder-right">
							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
								<view class="ladder-a">￥{{ladder.buyPrice.toFixed(2)}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>	
		</view>
		<view class="" v-if="userIdentity == 4">
			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == '1'">
				<text>未公开价格</text>
			</view>
			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == '2'">
				<text class="wrap-main-text">价格仅会员可见</text>
				<text class="wrap-main-none" @click.stop="goUpgradeApply">去升级会员查看价格</text>
			</view>
			<view class="wrap-main-price" v-if="product.price1TextFlag == '0'">
				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
					<view class="p-active" v-if="product.actStatus == 1">
						<image class="icon-active" :src="iconActive" mode="" ></image>
					</view>
					<view class="p-price tui-skeleton-fillet">
						<text class="txt sm">￥</text>
						<text class="txt big">{{retailPrice}}</text>
						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
					</view>
					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
				</view>
				<view class="wrap-ladder" v-else>
					<view class="ladder-text">
						<text class="ladder-h1">说明：</text>
						<text class="ladder-p">本商品有以下优惠购物方案</text>
					</view>
					<view class="ladder-main tui-skeleton-fillet">
						<view class="ladder-left">
							<view class="ladder-b">起订量:</view>
							<view class="ladder-b">价格:</view>
						</view>
						<view class="ladder-right">
							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
								<view class="ladder-a">￥{{ladder.buyPrice.toFixed(2)}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>					
		</view>
		<view class="" v-if="userIdentity == 2">
			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
				<text>未公开价格</text>
			</view>
			<view class="wrap-main-price" v-else>
				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
					<view class="p-active" v-if="product.actStatus == 1">
						<image class="icon-active" :src="iconActive" mode="" ></image>
					</view>
					<view class="p-price tui-skeleton-fillet">
						<text class="txt sm">￥</text>
						<text class="txt big">{{retailPrice}}</text>
						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
					</view>
					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
				</view>
				<view class="wrap-ladder" v-else>
					<view class="ladder-text">
						<text class="ladder-h1">说明：</text>
						<text class="ladder-p">本商品有以下优惠购物方案</text>
					</view>
					<view class="ladder-main tui-skeleton-fillet">
						<view class="ladder-left">
							<view class="ladder-b">起订量:</view>
							<view class="ladder-b">价格:</view>
						</view>
						<view class="ladder-right">
							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
								<view class="ladder-a">￥{{ladder.buyPrice.toFixed(2)}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>	
		</view>
	</view>
</template>

<script>
	import iconActive from '@/static/temp/icon-active.png'
	export default{
		name:'cm-price',
		props:{
			product:{
				type:Object,
				default: {}
			},
			userIdentity: {
				type: Number,
				default: 2
			},
			ladderPriceList:{
				type: Array,
				default:[]
			},
			retailPrice:{
				type:String,
				default:0.00
			},
			smallMoney:{
				type:String,
				default:0.00
			},
			minBuyNumber:{
				type: Number,
				default: 1
			}
		},
		data() {
			return{
				iconActive:iconActive
			}
		},
		created() {
			
		},
		methods:{
			goUpgradeApply(){
				this.$api.navigateTo('/pages/login/apply')
			}
		},
		
	}
</script>

<style lang="scss">	

</style>





















