<!--packageE/coupons/coupons.wxml-->

<view class="coupon" style="background:{{datas.preview_color}}">

	<block>
    <view style="text-align: center;font-size: 16px;height: 50px;line-height: 50px" wx:if="{{coupons_list.length<=0}}">
      暂无设置优惠券
    </view>
        <!-- 样式一，一张购物卷 -->
    <view class="coupon_one" style="background:{{datas.preview_color}}"
          wx:if="{{coupons_list.length === 1 && datas.coupons_style == '1'}}">
      <view class="couponBox"
            style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
            bindtap="selectedcoupon" data-item="{{coupons_list[0]}}" data-index="0">
        <view class="couponLeft">
          <text style="font-size: 26px;font-weight: bold;">{{coupons_list[0].coupon_method == 1 ?
            "￥"+coupons_list[0].deduct : coupons_list[0].discount+"折"}}
          </text>
          <view class="couponName" style="flex:1;padding-right:20rpx;">
            <text style="font-size: 16px;">{{coupons_list[0].name}}</text>
            <text>{{coupons_list[0].enough == 0 ? '无门槛' : "满"+coupons_list[0].enough+"立减"}}</text>
          </view>
        </view>
        <view class="coouponRight">
          <view class="line" style="border: dotted {{datas.coupons_border_color}} 2px;">
            <view class="crl"></view>
            <view class="crl"></view>
          </view>
          <text style="font-size: 36rpx" wx:if="{{coupons_list[0].api_availability === 3}}">已抢光</text>
          <text style="font-size: 36rpx" wx:if="{{coupons_list[0].api_availability === 2}}">已领取</text>
          <text style="font-size: 36rpx;width:92rpx;padding-left:20rpx;"
                wx:if="{{coupons_list[0].api_availability !== 2 && coupons_list[0].api_availability !== 3}}">立即领取
          </text>
          <view class="cir_top" style="background:{{datas.preview_color}}"></view>
          <view class="cir_bottom" style="background:{{datas.preview_color}}"></view>
        </view>
      </view>
    </view>

    <view class="coupon_two" style="background:{{datas.preview_color}}"
          wx:if="{{coupons_list.length === 1 && datas.coupons_style == '2'}}">
      <view class="cir_top" style="background:{{datas.preview_color}}"></view>
      <view class="cir_bottom" style="background:{{datas.preview_color}}"></view>
      <view class="cir_topLeft" style="background:{{datas.preview_color}}"></view>
      <view class="cir_bottomRight" style="background:{{datas.preview_color}}"></view>
      <view class="couponBox"
            style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
            bindtap="selectedcoupon" data-item="{{coupons_list[0]}}" data-index="0">
        <view class="linebox" style=" border: solid 1px {{datas.coupons_border_color}}">
          <view class="couponLeft">
            <text style="font-size: 24px;font-weight: bold;">{{coupons_list[0].coupon_method == 1 ?
              "￥"+coupons_list[0].deduct : coupons_list[0].discount+"折"}}
            </text>
            <view class="couponName">
              <text style="font-size: 16px;">{{coupons_list[0].name}}</text>
              <text>{{coupons_list[0].enough == 0 ? '无门槛' : "满"+coupons_list[0].enough+"立减"}}</text>
            </view>
          </view>
          <view class="coouponRight">
            <view class="line" style="border: dotted {{datas.coupons_border_color}} 2px;"></view>
            <text style="font-size: 36rpx" wx:if="{{coupons_list[0].api_availability === 3}}">已抢光</text>
            <text style="font-size: 36rpx" wx:if="{{coupons_list[0].api_availability === 2}}">已领取</text>
            <text style="font-size: 36rpx"
                  wx:if="{{coupons_list[0].api_availability !== 2 && coupons_list[0].api_availability !== 3}}">立即领取
            </text>
          </view>
        </view>
      </view>
    </view>

    <view class="coupon_thr" style="background:{{datas.preview_color}}"
          wx:if="{{coupons_list.length === 1 && datas.coupons_style == '3'}}">
      <view class="couponBox"
            style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
            bindtap="selectedcoupon" data-item="{{coupons_list[0]}}" data-index="0">
        <view class="couponLeft">
          <text style="font-size: 24px;font-weight: bold;">{{coupons_list[0].coupon_method == 1 ?
            "￥"+coupons_list[0].deduct : coupons_list[0].discount+"折"}}
          </text>
          <view class="couponName">
            <text style="font-size: 16px;">{{coupons_list[0].name}}</text>
            <text>{{coupons_list[0].enough == 0 ? '无门槛' : "满"+coupons_list[0].enough+"立减"}}</text>
          </view>
        </view>
        <view class="coouponRight" style="background-color: {{datas.coupons_border_color}}">
          <text wx:if="{{coupons_list[0].api_availability === 3}}">已抢光</text>
          <text wx:if="{{coupons_list[0].api_availability === 2}}">已领取</text>
          <text wx:if="{{coupons_list[0].api_availability !== 2 && coupons_list[0].api_availability !== 3}}">立即领取</text>
        </view>
      </view>
    </view>
	</block>


	<block wx:if="{{coupons_list.length > 1}}">
        <!-- 样式一，两张购物卷 -->
    <scroll-view scroll-x="true" style="width: 100%" bindscrolltolower="getMoreData" class="content-wrap">
      <view class="one_coupon_one ofset" style="background:{{datas.preview_color}}"
            wx:if="{{datas.coupons_style == '1'}}">
        <view class="couponBox"
              style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
              wx:for="{{coupons_list}}" wx:key="index" bindtap="selectedcoupon" data-item="{{item}}"
              data-index="{{index}}">
          <view class="couponLeft">
            <text style="font-size: 28px;margin-bottom: 8px;line-height: 28px">{{item.coupon_method == 1 ? "￥"+item.deduct
              : item.discount+"折"}}
            </text>
            <view class="couponName" style="border-top: 1px solid {{datas.coupons_border_color}}">
              <text>{{item.enough == 0 ? '无门槛' : "满"+item.enough+"立减"}}</text>
            </view>
          </view>
          <view class="coouponRight">
            <view class="line" style="border: dotted {{datas.coupons_border_color}} 2px;">
              <view class="crl"></view>
              <view class="crl"></view>
            </view>
            <view class="rigbox">
              <view style="width: 14px">
                <text wx:if="{{item.api_availability === 3}}">已抢光</text>
                <text wx:if="{{item.api_availability === 2}}">已领取</text>
                <text wx:if="{{item.api_availability !== 2 && item.api_availability !== 3}}">立即领取</text>
              </view>
            </view>
            <view class="cir_top" style="background:{{datas.preview_color}}"></view>
            <view class="cir_bottom" style="background:{{datas.preview_color}}"></view>
          </view>
        </view>
      </view>
      <!-- 样式二，两张购物卷 -->
      <view class="two_coupon_two ofset" style="background:{{datas.preview_color}}"
            wx:if="{{datas.coupons_style == '2'}}">
        <view class="couponBox"
              style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
              wx:for="{{coupons_list}}" wx:key="index" bindtap="selectedcoupon" data-item="{{item}}"
              data-index="{{index}}">
          <view class="cir_top" style="background:{{datas.preview_color}}"></view>
          <view class="cir_bottom" style="background:{{datas.preview_color}}"></view>
          <view class="cir_topLeft" style="background:{{datas.preview_color}}"></view>
          <view class="cir_bottomRight" style="background:{{datas.preview_color}}"></view>
          <view class="linebox" style=" border: solid 1px {{datas.coupons_border_color}}">
            <view class="couponLeft">
              <text style="font-size: 28px;margin-bottom: 8px;line-height: 28px">{{item.coupon_method == 1 ?
                "￥"+item.deduct : item.discount+"折"}}
              </text>
              <view class="couponName" style="border-top: 1px solid {{datas.coupons_border_color}}">
                <text>{{item.enough == 0 ? '无门槛' : "满"+item.enough+"立减"}}</text>
              </view>
            </view>
            <view class="coouponRight">
              <view class="line" style="border: dotted {{datas.coupons_border_color}} 2px;"></view>
              <view class="rigbox">
                <view style="width: 14px">
                  <text wx:if="{{item.api_availability === 3}}">已抢光</text>
                  <text wx:if="{{item.api_availability === 2}}">已领取</text>
                  <text wx:if="{{item.api_availability !== 2 && item.api_availability !== 3}}">立即领取</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
      <!-- 样式三，两张购物卷 -->
      <view class="thr_coupon_thr ofset" style="background:{{datas.preview_color}}"
            wx:if="{{datas.coupons_style == '3'}}">
        <view class="couponBox"
              style="background-color:{{datas.coupons_color.color}};background-image:url({{datas.coupons_color.isColor == 2? datas.coupons_color.image || emptyImage: ''}});color:{{datas.coupons_font_color}}"
              wx:for="{{coupons_list}}" wx:key="index" bindtap="selectedcoupon" data-item="{{item}}"
              data-index="{{index}}">
          <view class="couponLeft">
            <text style="font-size: 28px;margin-bottom: 8px;line-height: 28px">{{item.coupon_method == 1 ? "￥"+item.deduct
              : item.discount+"折"}}
            </text>
            <view class="couponName" style="border-top: 1px dotted {{datas.coupons_border_color}}">
              <text>{{item.enough == 0 ? '无门槛' : "满"+item.enough+"立减"}}</text>
            </view>
          </view>
          <view class="coouponRight" style="background-color: {{datas.coupons_border_color}}">
            <text wx:if="{{item.api_availability === 3}}">光</text>
            <text wx:if="{{item.api_availability === 2}}">已</text>
            <text wx:if="{{item.api_availability !== 2 && item.api_availability !== 3}}">领</text>
          </view>
        </view>
      </view>
    </scroll-view>

	</block>


</view>




