<view class='page'>
	<include src='/components/common/common'></include>
	<include src='/components/header/header'></include>
	<view class='body after-navber'>
		<block wx:if='{{ (!(list) || list.length == 0) }}'>
			<view class='no-content'>暂无记录</view>
		</block>
		<block wx:else>
			<view style='padding:24rpx 24rpx 0 24rpx;'>
				<view class='flex-col flex-y-center detail-head'>
					<view style='color:#666666;'>{{list.name}}</view>
					<view style='color:#666666;'>{{list.coupon.name}}</view>
					<view style='color:#353535;font-weight:bold;font-size:25pt;padding:10rpx 0'>￥{{list.sub_price}}</view>
					<view style='color:#353535;fs-b'>{{list.min_price_desc}}</view>
					<block wx:if='{{list.is_receive == 0}}'>
						<view bindtap='receive' class='flex-x-center detail-bu' data-index='{{list.id}}' style='background:#ff4544;color:#ffffff;'>立即领取</view>
					</block>
					<block wx:if='{{list.is_receive == 1}}'>
						<view class='flex-x-center detail-bu' style='border:1rpx solid #ff4544;background:#ffffff;color:#ff4544;'>已领取</view>
					</block>
					<block wx:if='{{list.status == 0}}'>
						<view class='flex-x-center detail-bu'>未使用</view>
					</block>
					<block wx:if='{{list.status == 1}}'>
						<view class='flex-x-center detail-bu'>已使用</view>
					</block>
					<block wx:if='{{list.status == 2}}'>
						<view class='flex-x-center detail-bu'>已过期</view>
					</block>
				</view>
				<image src='/images/coupon-details.png' style='display:block;height:48rpx;width:100%;'></image>
				<view class='detail-prize'>
					<view class='detail-name'>有效期</view>
					<view class='detail-manual'>
						<block wx:if='{{list.expire_type == 2}}'><text>{{list.begin_time}} ~ {{list.end_time}}</text></block>
						<block wx:if='{{list.expire_type == 1}}'><text>领取{{list.expire_day}}天内有效</text></block>
					</view>
					<view class='detail-name'>使用规则</view>
					<view class='detail-manual'>
						<block wx:if='{{ (list.appoint_type == 1 &&  (list.cat.length == 0 || list.goods == NULL) ) }}'><text class='user_coupon_font'>全场通用</text></block>
						<block wx:if='{{ (list.appoint_type == 2 &&  (list.goods.length == 0 || list.goods == NULL) ) }}'><text class='user_coupon_font'>全场通用</text></block>
						<block wx:if='{{list.appoint_type == NULL}}'><text class='user_coupon_font'>全场通用</text></block>
						<block wx:if='{{ (list.appoint_type == 1 && list.cat.length > 0) }}'>
							<view class='user_coupon_font' style='overflow: hidden; white-space: nowrap; text-overflow: ellipsis;width:87%;'>
								仅限<block wx:for='{{list.cat}}' wx:for-item='cat' wx:for-index='index' wx:key='id'><text>{{cat.name}}、</text></block>产品使用
							</view>
						</block>
						<block wx:if='{{ (list.appoint_type == 2 && list.goods.length > 0) }}'>
							<view bindtap='goodsList' class='user_coupon_font' data-goods_id='{{list.goods}}' data-id='{{list.id}}' style='height:50rpx;'>指定商品使用
								<text class="coupon_font_color">点进去查看指定商品</text></view>
						</block>
					</view>
					<block wx:if='{{list.rule}}'>
						<view class='detail-name'>使用说明</view>
						<view class='detail-manual'>{{list.rule}}</view>
					</block>
				</view>
			</view>
		</block>
	</view>
	<include src='/components/get-coupon/get-coupon.wxml'></include>
	<include src='/components/footer/footer'></include>
</view>
