This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop-wechat/components/diy/coupon/coupon.wxml
2020-04-25 22:59:04 +08:00

33 lines
1.6 KiB
Plaintext

<!-- 优惠券组 -->
<view class="diy-coupon" wx:if="{{ dataList.length }}" style="background: {{ itemStyle.background }}; padding: {{ itemStyle.paddingTop }}px 0;">
<scroll-view scroll-x="{{ true }}">
<view class="coupon-wrapper" wx:for="{{ dataList }}" wx:key="this" wx:for-item="dataItem">
<view class="coupon-item color__{{ dataItem.state.value ? dataItem.color.text : 'gray' }}">
<i class="before" style="background: {{ itemStyle.background }};"></i>
<view class="left-content dis-flex flex-dir-column flex-x-center flex-y-center">
<view class="content-top">
<block wx:if="{{ dataItem.coupon_type.value == 10 }}">
<text class="f-30">¥</text>
<text class="price">{{ dataItem.reduce_price }}</text>
</block>
<text class="price" wx:if="{{ dataItem.coupon_type.value == 20 }}">{{ dataItem.discount }}折</text>
</view>
<view class="content-bottom">
<text class="f-22">满{{ dataItem.min_price }}元可用</text>
</view>
</view>
<view class="right-receive dis-flex flex-x-center flex-y-center" catchtap="receiveTap" data-index="{{ index }}" data-state="{{ dataItem.state.value }}" data-coupon-id="{{ dataItem.coupon_id }}">
<view wx:if="{{ dataItem.state.value }}" class="dis-flex flex-dir-column">
<text>立即</text>
<text>领取</text>
</view>
<view wx:else class="state">
<text>{{ dataItem.state.text }}</text>
</view>
</view>
</view>
</view>
</scroll-view>
</view>