<!--packageA/mycomponent/goodsComponent/buyNow/buyNow.wxml-->
<wxs module="util">
  var getRatio = function (num) { 
		return Number(num).toFixed(2)
	};
	var propotion = function (string){
		return string.indexOf("%");
	}
	var fiexd = function(string){
		return string.toFixed(2);
	}
  module.exports.getRatio = getRatio;
  module.exports.propotion = propotion;
  module.exports.fiexd = fiexd;
</wxs>
<!-- w无规格start -->
<view class="shadeMode_2  {{popupSpecs2?'shadeModeShow':''}}" wx:if="{{popupSpecs2}}" >
	<view class="specifications">
		<view class="icon_close" bindtap="hidePopView2">
			<view class="guanbi_icon">
				<van-icon name="close" size='40rpx' />
			</view>
		</view>
		<view class="shopimg">
			<view class="chooser_img" bindtap="showSkuImages_Methob">
				<image src="{{popThumb}}" mode='widthFix' wx:if="{{goodsType != 'zhpGroup'}}"/>
				<image src="{{goodsInfo.thumb}}" mode='widthFix' wx:if="{{goodsType == 'zhpGroup'}}"/>
			</view>
			<view class="right">
				<view class="price" wx:if="{{goods_plugin.point_goods}}">
					<text wx:if="{{popMoney > 0}}">
						<text id="option_price">{{popMoney}}</text>
						<text class="point-text" style="font-size: 13px">元</text>
						<text id="option_price">+</text>
					</text>
					<text id="option_price">{{popPrice}}</text>
					<text class="point-text" style="font-size: 13px">{{integral}}</text>
				</view>
				<view class="price" wx:else>
					<block>
						{{language['money']}}
						<text id="option_price">{{popPrice}}</text>
						<text wx:if="{{isRent}}">/天</text>
					</block>
					<div wx:if="{{vip_show}}" class="price_Vip">
						会员价:
						{{language['money']}}
						<text id="option_price">{{goodsInfo.vip_price_show}}</text>
					</div>
					
				</view>
				<view class="option">库存{{popStock}}{{goodsInfo.sku}}</view>
				<view class="option">{{goodsDescription}} <text wx:if="{{goodsType == 'zhpGroup'}}" style="color:#f15353">共{{language['money']}}{{util.getRatio(goodsCount * goodsInfo.price)}}</text></view>			
				<view class="give_integral_wrapper" style="padding-left:0;padding-top:0.5rem;" wx:if="{{goodsInfo.goods_sale&&goodsInfo.goods_sale.first_strip_key&&goodsInfo.goods_sale.first_strip_key.points}}">
					<view class="give_integral_text">送</view>
					<view class="give_integral_num" wx:if="{{util.propotion(goodsInfo.goods_sale.first_strip_key.points)>=0}}" >{{goodsInfo.goods_sale.first_strip_key.points}}{{integral}}</view>
					<view class="give_integral_num" wx:if="{{util.propotion(goodsInfo.goods_sale.first_strip_key.points)==-1}}">{{util.fiexd(goodsInfo.goods_sale.first_strip_key.points*goodsCount)}}{{integral}}</view>
				</view>
			</view>
				
		</view>
		<view class="shopinfoContent" wx:if="{{mode ==2}}">
			<view class="shopinfo">
				<view class="dl">
					<view class="dt">等级套餐</view>
					<view class="dd" >
						<view wx:for="{{goodsInfo.detail}}" wx:key="{{i}}" wx:for-index="i"
							wx:for-item="levelchild"
							class="spec {{levelModel==levelchild.level_id?'sele':''}} "
							data-item="{{levelchild}}"  bindtap='clickLevelModel'>
							{{levelchild.level_name}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="goodsnum" wx:if="{{!isRent && goodsInfo.plugin_id != 72}}">
			<!--goodsInfo.plugin_id != 72话费商品不允许修改数量-->
			<view class="num">购买数量：</view>
			<view class="calculation" wx:if="{{mode!=2}}">
				<block wx:if="{{popStock>0}}">
					<view class="leftnav" bindtap='reduceGoods'>-</view>
					<input type="number" class="shownum" value="{{goodsCount}}" bindinput="inputGoodsNum" disabled="{{goodsType == 'grabGroup'?true:false}}" />
					<view class="rightnav" bindtap='addGoods'>+</view>
				</block>
			</view>
			<view wx:else class="calculation">{{goodsCount}}</view>
		</view>
		<view class="subbtn" bindtap="buyNowNew" wx:if="{{popStock>=1 && goodsType != 'zhpGroup'}}">确认</view>
		<view class="subbtn" bindtap="buyNowNew" wx:if="{{popStock>=1 && goodsType == 'zhpGroup'}}">确认</view>
		<view class="subbtn" style="background-color:#999999;" wx:elif="{{ popStock < 1 }}">确认</view>
	</view>
</view>
<!-- 无规格end -->

<!-- 有规格start -->
<view class="shadeMode {{popupSpecs?'shadeModeShow':''}}">
	<view class="specifications">
		<view class="icon_close" bindtap="popupSpecsbtn">
			<view class="guanbi_icon">
				<van-icon name="close" size='40rpx' />
			</view>
		</view>
		<view class="shopimg">
			<view class="chooser_img" bindtap="showSkuImages_Methob">
				<image src="{{popThumb == null || popThumb == '' || popThumb == undefined?goodsInfo.thumb:popThumb}}" />
			</view>
			<view class="right">
				<view class="price" wx:if="{{goods_plugin.point_goods}}">
					<text wx:if="{{popMoney > 0}}">
						<text id="option_price">{{popMoney}}</text>
						<text class="point-text" style="font-size: 13px">元</text>
						<text id="option_price">+</text>
					</text>
					<text id="option_price">{{popPrice}}</text>
					<text class="point-text" style="font-size: 13px">{{integral}}</text>
				</view>
				<view class="price" wx:else>
					{{language['money']}}
					<text id="option_price">{{popPrice}}</text>
					<text wx:if="{{isRent}}">/天</text>
					<block wx:if="{{isMultiSpecs}}">
						<van-loading class="m-l-w6" color="#fdbc2e" size='16' wx:if="{{specsVIPPrc == 0}}"/>
						<view class="member-price m-l-w6" wx:if="{{specsVIPPrc}}"> 会员价: {{language['money']}}{{ specsVIPPrc }} </view>
					</block>
				</view>
				<view class="option">库存{{popStock}}{{goodsInfo.sku}}</view>
				<view class="option">{{goodsDescription}}<text wx:if="{{goodsType == 'zhpGroup'}}" style="color:#f15353">共{{language['money']}}{{util.getRatio(goodsCount * popPrice)}}</text></view>
				<view class="give_integral_wrapper" style="padding-left:0;padding-top:0.5rem;" wx:if="{{give_integral_count}}">
					<view class="give_integral_text">送</view>
					<view class="give_integral_num" wx:if="{{util.propotion(give_integral_count)>=0}}">{{give_integral_count}}{{integral}}</view>
					<view class="give_integral_num" wx:if="{{util.propotion(give_integral_count)==-1}}">{{util.fiexd(give_integral_count*goodsCount)}}{{integral}}</view>
				</view>
			</view>
		</view>
		<view class="shopinfoContent" wx:if="{{mode ==2}}">
			<view class="shopinfo">
				<view class="dl">
					<view class="dt">等级套餐</view>
					<view class="dd" >
						<view wx:for="{{goodsInfo.detail}}" wx:key="{{i}}" wx:for-index="i"
							wx:for-item="levelchild"
							class="spec {{levelModel==levelchild.level_id?'sele':''}} "
							data-item="{{levelchild}}"  bindtap='clickLevelModel'>
							{{levelchild.level_name}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="select_box" wx:if="{{goodsType == 'grabGroup'}}">
			<view class="select">
				<view style="padding: 8rpx 25.6rpx;border: 1px solid #bfcbd9;margin:20rpx;border-radius: 10rpx;">
					<view class="p">{{gooddatas.limit_num}}人团</view>
				</view>
			</view>
		</view>
		<view class="shopinfoContent">
			<view class="shopinfo" wx:key="{{specsIdex}}" wx:for="{{goodsInfo.has_many_specs}}" wx:for-index="specsIdex"
				wx:for-item="specs">
				<view class="dl">
					<view class="dt">{{specs.title}}</view>
					<view class="dd" data-descr="{{specs.description}}">
						<view wx:for="{{specs.specitem}}" wx:key="{{specitemIdex}}" wx:for-index="specitemIdex"
							wx:for-item="specitem" class="spec {{specs.description==specitem.id?'sele':''}} {{specitem.c?'disab':''}}"
							data-specitem="{{specitem}}" data-specsidex="{{specsIdex}}" bindtap='selectSpecs'>
							{{specitem.title}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="select_box" wx:if="{{gooddatas.has_many_level!=''&&gooddatas.has_many_level!=null&&gooddatas.has_many_level!=undefined && goodsType== 'group_goods'}}">
			<view class="select " wx:for="{{gooddatas.has_many_level}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" catchtap="selectGroup">
				<view class="{{groupModel == item.id?'vantRadioshow':'' }}" style="padding: 8rpx 25.6rpx;border: 1px solid #bfcbd9;margin:20rpx;">
					<view class="p">{{language['money']}}{{item.min_price}} 起</view>
					<view class="p">{{item.member_num}}人团</view>
				</view>
			</view>
		</view>
		<view class="goodsnum" wx:if="{{goodsInfo.plugin_id != 72}}">
			<!--goodsInfo.plugin_id != 72话费商品不允许修改数量-->
			<view class="num">购买数量：</view>
			<view class="calculation" wx:if="{{mode!=2}}">
				<view class="leftnav" bindtap='reduceGoods'>-</view>
				<input type="number" class="shownum" value="{{goodsCount}}" bindinput="inputGoodsNum" disabled="{{goodsType == 'grabGroup'?true:false}}" />
				<view class="rightnav" bindtap='addGoods'>+</view>
			</view>
			<view wx:else class="calculation">{{goodsCount}}</view>
		</view>

		<view class="subbtn" bindtap="openTeam" wx:if="{{popStock>=1 && goodsType== 'group_goods'}}">确认</view>
		<view class="subbtn" bindtap="checkActivity" wx:if="{{popStock>=1 && goodsType== 'grabGroup'}}">确认</view>
		<view class="subbtn" bindtap="buyNowNew" wx:if="{{popStock>=1 && (goodsType== 'retailGood' || goodsType == 'zhpGroup')}}">确认</view>
		<view class="subbtn" bindtap="submitAction" wx:if="{{popStock>=1 && goodsType != 'group_goods' && goodsType != 'grabGroup' && goodsType != 'retailGood' &&goodsType != 'zhpGroup' }}">确认</view>
		<view class="subbtn" style="background-color:#999999;" wx:if="{{popStock == 0}}">确认</view>
	</view>
</view>
<!-- 有规格end -->

<!-- 点击查看图片 -->
<van-popup show="{{showSkuImages}}" close-on-click-overlay="{{true}}" overlay="{{true}}"
	custom-style="overflow:auto;background:rgba(0,0,0,0);" bind:click-overlay="onCloseSkuImages">
	<view class="sku_swiper">
		<swiper style="height:760rpx;" bindchange="onChangeSkuImagesIndex" current="{{activeSkuIndex}}">
			<block wx:for="{{skuImages}}" wx:key="*this">
				<swiper-item class="sku_swiper_child">
					<image src="{{item}}" mode='widthFix' />
				</swiper-item>
			</block>
		</swiper>
	</view>
	<view class="sku_other">
		<view class="sku_title" wx:if="{{goods_plugin.point_goods}}">{{ goodsInfo.has_option == 1 ?
			(goods_plugin.point_goods.min_point == goods_plugin.point_goods.max_point ? goods_plugin.point_goods.min_point :
			goods_plugin.point_goods.min_point + "-" + goods_plugin.point_goods.max_point) : goodsInfo.point
			}}{{integral}}
		</view>
		<view class="sku_title" wx:elif="{{goodsInfo.has_option == 1}}">
			{{language['money']}}{{goodsInfo.has_many_options[activeSkuIndex].product_price}}</view>
		<view class="sku_title" wx:elif="{{goodsInfo.has_option != 1}}">{{language['money']}}{{goodsInfo.price}}</view>
		<view class="swiper_num">{{activeSkuIndex+1}}/{{skuImages.length}}</view>
	</view>
</van-popup>
<!-- 点击查看图片end -->
