<!--component/skuPopup/skuPopup.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />

<view class="popup-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="popup-content{{show ? ' active' : ''}}">
	<image
	 class="popup-close"
	 mode="widthFix"
	 src="/images/close.png"
	 bindtap="hidePopup"
	/>
	<view class="top-info clearfix">
		<image mode="widthFix" src="{{picUrl && picUrl != 'undefined' ? picUrl : indexImg}}" />
		<view class="top-text">
			<!-- <view class="price-text" wx:if="{{exchangePrice <= 0}}">￥{{price / 100}}</view> -->
			<view class="price-text">￥{{utils.numberFormat(salePrice /100)}}</view>
			<view class="stock-text">库存：{{skuStock}}</view>
			<view class="sku-text">规格：
				<block wx:for="{{skuText}}" wx:key="{{index}}">{{item}} </block>
			</view>
		</view>
	</view>
	<!-- isAllowArrive  0 开启/放开 1 关闭/禁用 -->
	<scroll-view class="mid-info" scroll-y="true">
		<view
		 class="sku-info"
		 wx:for="{{specItem}}"
		 wx:for-index="i"
		 wx:key="{{i}}"
		>
			<view class="spec-name">{{item.name}}</view>
			<view
			 class="spec-values"
			 wx:for="{{item.sonList}}"
			 wx:for-index="j"
			 wx:key="{{j}}"
			 wx:for-item="specValue"
			>
				<view
				 class="spec-value {{specValue.stock == 0 ? ' disabled' : ''}}{{curSpec[i].name == specValue.name ? ' active' : ''}}"
				 bindtap="selectSku"
				 data-id="{{specValue.id}}"
				 data-index="{{i}}"
				 data-name="{{specValue.name}}"
				 data-type="{{goodType}}"
				 data-disable="{{specValue.skuStock == 0 ? true : false}}"
				 data-stock="{{skuStock}}"
				>{{specValue.name}}
				</view>

				<!-- <view wx:if="{{isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> -->
				<!-- <view wx:if="{{!isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 && goodType == 2 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> -->
			</view>
		</view>
		<!-- <view class="sku-number">
      <view class="spec-name">数量</view>
      <view class="num-panel clearfix">
        <button bindtap="minusNum">-</button>
        <input value="{{proNum}}" type="number" bindblur="inputNum"></input>
        <button bindtap="addNum">+</button>
      </view>
    </view> -->
		<view class="sku-number">
			<view class="spec-name">数量</view>
			<view class="num-panel">
				<button bindtap="minusNum">-</button>
				<input class="num-panel-ipt" value="{{proNum}}" type="number" bindblur="inputNum" />
				<button bindtap="addNum">+</button>
			</view>
		</view>
	</scroll-view>
	<!-- 按钮状态 -->
	<view wx:if="{{!currentHasUserInfo}}">
		<button
		 bindgetuserinfo="_getUserInfo"
		 data-jflag="false"
		 open-type='getUserInfo'
		 class="confirm-button {{isOutStock? 'out-stock': ''}}"
		 hover-class="btn-hover"
		>
			{{btnText}}
		</button>
	</view>
	<view wx:else>
		<button class="confirm-button {{isOutStock? 'out-stock': ''}}" bindtap="confirm">{{btnText}}</button>
	</view>
</view>

