<!--pages/userCenter.wxml-->
<view class='page-integral-mall' style="padding-bottom: {{currentTab =='goods' ? '80rpx' : '40rpx'}}">
	<!-- title -->
	<view class='mall-title'>
		<view class='title-num-point'>
			<view class='title-img-point'>
				<view class='img-point'>
					<image class="point-img" src='/assets/imgs/integral_exchange/point.png' mode="widthFix" />
				</view>
				<view class='text-point'>
					{{memberPoint.total}}
				</view>
			</view>
			<view class='integral-vip-rules' wx:if="{{integralCouponList.length}}" bindtap="handleGoMemberRulesRules">会员规则</view>
		</view>
		<view class='title-time-point' wx:if="{{memberPoint.expirePoint > 0}}">
      {{memberPoint.expirePoint}} 积分将于 {{memberPoint.expireDate}} 清零
    </view>
    <view class='title-time-point' wx:if="{{memberPoint.expirePoint == 0}}">
      暂无将过期积分
    </view>
	</view>

	<!-- tab -->
	<view class='mall-tab' wx:if="{{integralGoodsList.length > 0}}">
		<view class="tab-coupon {{currentTab=='coupon' ? 'tab-active':''}}" data-tab="coupon" bindtap="handelTab">优惠券</view>
		<view class="tab-coupon-goods {{currentTab=='goods' ? 'tab-active':''}}" data-tab="goods" bindtap="handelTab">限量精品</view>
	</view>

	<!-- 优惠券列表-->
	<view wx:if="{{currentTab == 'coupon'}}">
		<view class='coupon-wrap' wx:if="{{integralCouponList.length}}">
			<view
			 class='coupon-list'
			 wx:for="{{integralCouponList}}"
			 wx:for-item="item"
			 wx:for-index="k"
			 wx:key="{{k}}"
			 data-id="{{item.id}}"
			 bindtap="goCouponDetail"
			>
				<view class="coupon-item">
					<view class='coupon-img-title'>
						<view class='coupon-img'>
							<image wx:if="{{item.thumbnail}}" src='{{item.thumbnail}}' />
							<image wx:else src='/assets/imgs/qr-code.png' />
						</view>
						<view class='coupon-info'>
							<view class='coupon-name fs-28'>{{item.title}}</view>
							<view class='coupon-desc text-align-left fs-24'>查看详情</view>
						</view>
					</view>
					<view class='coupon-btn'>
						<view class='coupon-btn-click' 
							data-id="{{item.id}}"
							data-point="{{item.point}}"
							catchtap='exchange'>立即兑换</view>
						<view class='coupon-btn-num'>{{item.point}}积分</view>
					</view>
				</view>
			</view>
		</view>
		<view class='empty-wrap' wx:if="{{!integralCouponList.length}}">
			<view class='empty-info'>
				<image class='empty-img' src='/assets/imgs/empty-coupon.png' />
				<view class='empty-text'>没有任何卡劵</view>
			</view>
		</view>
	</view>
	<!-- goods -->
	<view wx:if="{{currentTab =='goods'}}">
		<view class='coupon-wrap' wx:if="{{integralGoodsList.length}}">
			<view
			 class='coupon-list'
			 wx:for="{{integralGoodsList}}"
			 wx:for-item="item"
			 wx:for-index="k"
			 wx:key="{{k}}"
			 data-id="{{item.id}}"
			 bindtap="goIntegrateGoodsExchangeDetail"
			>
				<view class="coupon-item">
					<view class='coupon-img-title'>
						<view class='coupon-img'>
							<image wx:if="{{item.thumbnail}}" src='{{item.thumbnail}}' />
							<image wx:else src='/assets/imgs/qr-code.png' />
						</view>
						<view class='coupon-info'>
							<view class='coupon-name fs-28'>{{item.title}}</view>
							<view class='coupon-desc text-align-left fs-24'>查看详情</view>
						</view>
					</view>
					<view class='coupon-btn'>
						<view class='coupon-btn-click' 
							data-id="{{item.id}}"
							data-point="{{item.point}}"
              data-canexchange="{{item.canExchange}}"
							catchtap='exchangeGoods'>立即兑换</view>
						<view class='coupon-btn-num'>{{item.point}}积分</view>
					</view>
				</view>
			</view>
		</view>
		<view class='empty-wrap' wx:if="{{!integralGoodsList.length}}">
			<view class='empty-info'>
				<image class='empty-img' src='/assets/imgs/empty-coupon.png' />
				<view class='empty-text'>没有任何物品</view>
			</view>
		</view>
	</view>
  <!-- 悬浮兑换记录 -->
  <view class='point-exchange-goods-records' wx:if="{{currentTab =='goods'}}" bindtap='onTapToExchangeRecords'>
    查看兑换记录 >>
  </view>

	<exchange-coupon-modal exchangeId="{{exchangeId}}" exchangePoint="{{exchangePoint}}" isExchange='{{isExchange}}' />
	<!--<no-more wx:if="{{noMore}}"/>-->
	<!--goHome-->
	<go-home/>
</view>
<!-- 库存没了 -->
<dialog-stock-empty show="{{dialogStockEmpty}}"/>
<dialog-user-limit show="{{dialogUserLimit}}"/>




