<wxs module="filters" src="../../../utils/filter.wxs"></wxs>

<view class="main">
	<view class="bg-white pdh20 bdr12">
		<view class="flex pdv20" wx:for="{{details}}">
			<view class="pic-box shrink0">
				<text class="iconfont icon-shangpin fs60 white"></text>
			</view>
			<view class="pdl20 f1">
				<view class="flex jc_sb ai_c">
					<view class="title ellipsis-2 pdr40">{{item.WareName}}</view>
					<text class="c-6">x{{item.Qty}}</text>
				</view>
				<view class="flex ai_c c-9 fs26">
					<text class="rmb c-red">{{filters.show_default(item.VipPrice, '0')}}</text>
					<view class="fs22 del pdl10 c-c7">零售价<text class="rmb">{{filters.show_default(item.PosPrice, '0')}}</text></view>
				</view>
			</view>
		</view>
	</view>
	
	<!-- 底部按钮栏 -->
	<view class="btn-bar bg-white pd20 t-c">
			<!-- 已核销 -->
			<text class="btn bg-gray white" wx:if="{{options.usestate == 1}}">已核销</text>
			<!-- 待核销 -->
			<block wx:else>
				<text class="btn bg-gray white" wx:if="{{filters.isExpired(options.date)}}">已过期</text>
				<text class="btn bg-red white" bindtap="showQr" wx:else>立即兑换</text>
			</block>
	</view>
</view>


<!-- 遮罩层 -->
<view class="mask" hidden="{{!showQr}}" catchtouchmove="touchMove"></view>
<!-- 码 -->
<view class="popup-container" hidden="{{!showQr}}" catchtouchmove="touchMove">
	<view class="t-r pdb10"><text class="iconfont icon-close fs40" bindtap="closeQr"></text></view>
	<view class="popup">
		<!-- 条形码 -->
		<view class="bar-container">
			<canvas class="barcode" canvas-id="barcode"/>
		</view>
		<!-- 二维码 -->
		<view class="qr-container">
		  <canvas class="qrcode" canvas-id="qrcode"/>
		</view>
		<view class="pdv20 c-7b fs26 bdt">
			<text>核销码: {{writeOffCode}}</text>
		</view>
	</view>
</view>
