<!--pages/coupon/coupon_store.wxml-->
<view class="coupon_store">
	<view class="banner" wx:if="{{slide_shows.length>0}}">
		<!-- <image style="width: 100%;" mode="widthFix" src="https://www.yunzmall.com/addons/yun_shop/static/app/img/cupon.9936f3e.png" ></image> -->
		<swiper>
			<block wx:for="{{slide_shows}}" wx:key='index'>
				<swiper-item>
					<image src="{{item.pic_url}}" data-link="{{item.slide_link}}" mode="aspectFit" catchtap="tapurl"></image>
				</swiper-item>
			</block>
		</swiper>
	</view>
	<scroll-view scroll-x="true" style="background:#ffffff" wx:if="{{types.length > 0}}">
		<view class="types">
			<view class="type_item" wx:for="{{types}}" wx:key="index">
				<text class="text {{index==typesIndex ? 'active' : ''}}" bindtap="setTypesIndex" data-index="{{index}}">{{item}}</text>
			</view>
		</view>
	</scroll-view>
	<view class="coupon-list">
		<view wx:for="{{coupon_list}}" wx:key="index"  data-index="{{index}}">
			<coupon-item 
				datainfo="{{item}}" ind="{{index}}" 
				bindclaim="claim" bindshowIntegralPopup="showIntegralPopup"
				integralname="{{integralPluginName}}"
			></coupon-item>
			<!-- <block wx:if="{{item.api_availability==1}}">
				<view class="coupon_box">
					<view class="coupon_left">
						<block wx:if="{{item.coupon_method==1}}">
							<view class="left_a">{{language['money']}}{{item.deduct}}</view>
							<view class="left_b">满{{item.enough}}立减</view>
						</block>
						<block wx:else>
							<view class="left_a">{{item.discount}}折</view>
							<view class="left_b">满{{item.enough}}立享</view>
						</block>
					</view>
					<view class="coupon_right">
						<view class="right_a">{{item.name}}</view>
						<view class="right_b">已领人数：{{item.has_many_member_coupon_count}}</view>
						<view class="right_c">
							<block wx:if="{{item.api_remaining !=-1}}">
								可领张数：{{item.api_remaining}}张
							</block>
							<block wx:if="{{item.api_remaining ==-1}}">
								可领张数：多张
							</block>
						</view>
					</view>
					<button size="mini" class="receivein" data-item="{{item}}" catchtap="selectedcoupon" data-index="{{index}}">领取</button>
				</view>
			</block>
			<block wx:if="{{item.api_availability==2}}">
				<view class="coupon_box" data-item="{{item}}" catchtap="selectedcoupon" data-index="{{index}}">
					<view class="coupon_left">
						<block wx:if="{{item.coupon_method==1}}">
							<view class="left_a">{{language['money']}}{{item.deduct}}</view>
							<view class="left_b">满{{item.enough}}立减</view>
						</block>
						<block wx:else>
							<view class="left_a">{{item.discount}}折</view>
							<view class="left_b">满{{item.enough}}立享</view>
						</block>
					</view>
					<view class="coupon_right">
						<view class="right_a">{{item.name}}</view>
						<view class="right_b">已领人数：{{item.has_many_member_coupon_count}}</view>
						<view class="right_c">
							<block wx:if="{{item.api_remaining !=-1}}">
								可领张数：{{item.api_remaining}}张
							</block>
							<block wx:if="{{item.api_remaining ==-1}}">
								可领张数：多张
							</block>
						</view>
					</view>
					<view  class="receive nocou"></view>
				</view>
			</block>
			<block wx:if="{{item.api_availability==3}}">
				<view class="coupon_box" data-item="{{item}}" catchtap="selectedcoupon" data-index="{{index}}">
					<view class="coupon_left" style="color:#666">
						<block wx:if="{{item.coupon_method==1}}">
							<view class="left_a">{{language['money']}}{{item.deduct}}</view>
							<view class="left_b">满{{item.enough}}立减</view>
						</block>
						<block wx:else>
							<view class="left_a">{{item.discount}}折</view>
							<view class="left_b">满{{item.enough}}立享</view>
						</block>
					</view>
					<view class="coupon_right">
						<view class="right_a">{{item.name}}</view>
						<view class="right_b">已领人数：{{item.has_many_member_coupon_count}}</view>
						<view class="right_c">
							<block wx:if="{{item.api_remaining !=-1}}">
								可领张数：{{item.api_remaining}}张
							</block>
							<block wx:if="{{item.api_remaining ==-1}}">
								可领张数：多张
							</block>
						</view>
					</view>
					<view class="receive nocous"></view>
				</view>
			</block> -->
		</view>
	</view>
</view>
<view class="coupon-shop" catchtap="gocouponStore">
	<image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/coupons_mycouponsbg@2x.png" mode="aspectFit"></image>
	<view class="text">我的优惠券</view>
</view>

<!-- 积分兑换弹框 -->
<van-popup show="{{ visibleIntegralPopup }}" round bind:close="onClose"  custom-class="integral-exchange-Popup">
	<view>{{integralPluginName}}兑换优惠券</view>
	<view class="counter">
		<view>兑换张数</view>
		<van-stepper 
			value="{{ exchangeForm.couponTotal }}" 
			theme="round"
			integer="false"
			button-size="20px"
			bind:change="changeTotal" 
		></van-stepper>
	</view>
	<view class="tips">
		需要<text class="red-text">{{exchangeForm.couponTotal * exchangeForm.exIntegral}}{{integralPluginName}}</text>
	</view>
	<view class="bottom-btns">
		<view class="cancel-btn" bindtap="cancelExchange">取消</view>
		<view class="exchange-btn" bindtap="exchangeCoupon">兑换</view>
	</view>
</van-popup>

<kFoot exshow="{{true}}" wx:if="{{kFootshow}}"></kFoot>
<shopfoot bindtabrshow="tabrshowbtn"></shopfoot>