useCoupon.wxml 3.53 KB

<view class='container'>
<view class='header'>
  <view class="space"/>
  <view class='headerTopView'>
    <view class="inputView">
      <input class="input" type="text" placeholder="请输入优惠码" placeholder-style="color: #BDBDBD;font-family: PingFang SC;font-size: 30rpx;" bindinput="listenerPhoneInput" />
    </view>
    <block wx:if="{{duihuanButtonEnable}}">
      <view class='button' style="background-color: black;"bindtap="duihuanTapped"> 
        <text class="buttonText" >兑换</text>
      </view>
    </block>
    <block wx:else>
      <view class='button' style="background-color: #BDBDBD;"bindtap="duihuanTapped"> 
        <text class="buttonText">兑换</text>
      </view>
    </block>
  </view>
  <view class='headerBottomView'> 
     <text class="detailText">{{detailText}}</text>
  </view>
</view>


<scroll-view scroll-y="{{hasCoupon}}" style="height: {{listH}}px;background-color: #e0e0e0;" bindscrolltolower="loadMore"> 
  <block wx:if="{{hasCoupon}}">
    <view class="useCouponCellView">
      <block wx:for="{{list}}" wx:key="unique">
        <view class='couponView' style="height: {{cellHeight}}px;width: {{cellWidth}}px;">
          <block wx:if="{{item.coupon_type == '5'}}">
            <image style="height: {{cellHeight}}px;width: {{cellWidth}}px;" src="{{couponBackImage_b}}">
            </image> 
          </block>
          <block wx:else>
            <image style="height: {{cellHeight}}px;width: {{cellWidth}}px;" src="{{couponBackImage_r}}">
            </image>  
          </block>
            <view class='couponHeader' style="top: {{-cellHeight-5}}px;width: {{cellWidth}}px;height: {{cellHeaderHeight}}px;">
              <text class="couponCellTitle">{{item.coupon_name}}</text>
            </view>
            <view class='couponBottom' style="bottom: {{cellHeight+10}}px;width: {{cellWidth}}px;height: {{cellBottomHeight}}px;">
              <view class='left' style="width: {{cellBottomleftW}}px;height: {{cellBottomHeight}}px;"> 
                  <text class="price"style="margin-top:{{priceTop}}px">{{item.coupon_value}}</text>
              </view>
              <view class='middle' style="width: {{cellBottomMiddleW}}px;height: {{cellBottomHeight-20}}px;">
                <text class="timeDetail">{{item.coupon_validity}}(即将到期)</text>
              </view>
              <view class='right' style="width: {{cellBottomRightW}}px;height: {{cellBottomHeight}}px;"> 
              <block wx:if="{{item.hasSelect}}">
                    <image class="selectIcon" src="{{address_Checked}}" bindtap="selectCouponAction" data-name="{{index}}"></image> 
                </block>
                <block wx:else>
                    <image class="selectIcon" src="{{address_Check}}" bindtap="selectCouponAction" data-name="{{index}}"></image>  
                </block>
              </view>
            </view>
        </view>
      </block>  
      <view style="height: 10px;background-color: #e0e0e0;"></view> 
    </view> 

    </block>
    <block wx:else>
      <view class='emptyClass' style='width:100%;height:100%;'>
          <image src="images/empty@3x.png" style="width:215rpx;height:124rpx;margin-top:280rpx"></image>
          <view style="font-size:30rpx;text-align:center;margin-top:30rpx;color:#444444;">没有可用的优惠券</view>
      </view>
    </block>

  </scroll-view> 

<view class='bottom'>
  <view class="button1" bindtap="useTapped">
    <text class="buttonText1">使用</text>
  </view> 
  <view class="button2"  bindtap="notuUseTapped">
      <text class="buttonText2">不使用</text>
  </view> 
</view>
  
</view>