<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;">
	<block wx:if="{{ad_data}}">
		<view class="top_img rel">
			<image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
			<lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear>
		</view>
	</block>
	<block wx:else>
		<view class="top_img rel">
			 <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=202403'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
             <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear>
		</view>
	</block>


	<view class="top_title">
		<view class="top_title_box">
			<text class="top_title_redtext">礼包列表</text>
		</view>
		<view class="top_title_box_S"></view>
		<view class="top_title_box">
			<a class="top_title_blacktext" bindtap="redirectTo" data-url="/packageF/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
		</view>
	</view>
	<!--<block wx:for="{{wareCard}}" wx:if="{{now > filter.gettimestamp(items.starTime)  || (items.is_show && now > items.show_time)}}" wx:for-item="items" wx:for-index="index" wx:key="index">-->
	<block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
		<view class="content_box">
			<view class="content_box_ware" bindtap="navigateTo" data-url="/packageF/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&cover_img={{items.cover_img}}&orderSn=''">
				<view class="content_box_img">
					<image mode="aspectFit" src="{{iurl+items.cover_img}}" lazy-load="true" binderror="bind_bnerr2" wx:if="{{items.cover_img}}" data-errorimg="wareCard[{{index}}].cover_img"></image>
					<image mode="aspectFit" src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" wx:else data-errorimg="wareCard[{{index}}].lbUrl"></image>
				</view>
				<view class="content_box_title">
					<view class="content_ware_title">
						<text>{{items.giftTitle}}</text>
					</view>
					<view class="content_ware_type flex">
						<block wx:if="{{items.payMoney>0}}">
							<text>{{"￥"+items.payMoney}}</text>
						</block>
						<block wx:if="{{items.payMoney>0&&items.payIntegral>0}}">
							<text>/</text>
						</block>
						<block wx:if="{{items.payIntegral>0}}">
							<view class="flex">
								<text class="ellipsis-1">{{items.payIntegral}}</text>
								<view>积分</view>
							</view>
						</block>
					</view>
					<view class="content_ware_price no_line_c">
						<text class="ellipsis-1">{{"零售价：￥"+items.giftPosPrice}}</text>
					</view>
					<view wx:if="{{items.is_show && now < items.starTime1 }}" class="content_ware_time">
						<text class="ellipsis-1">{{"活动开始时间："+items.starTime}}</text>
					</view>
					<view wx:else class="content_ware_time">
						<text class="ellipsis-1">{{"活动结束时间："+items.endTime}}</text>
					</view>
				</view>
			</view>
			<view class="content_box_button">
				<view class="box_button_remark">
					<text>{{"已售:"+items.giftQty+"件"}}</text>
				</view>
				<block wx:if="{{now > items.starTime1}}">
					<view class="flex-vertical">
						<block wx:if="{{items.payMoney>0 && items.payIntegral>0}}">
							<block wx:if="{{items.payMoney>0}}">
								<view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
									<button class="box_button_dui">立即购买</button>
								</view>
							</block>
							<block wx:if="{{items.payIntegral>0}}">
								<view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
									<button class="box_button_dui box_button_buy">立即兑换</button>
								</view>
							</block>
						</block>
						<block wx:else>
							<block wx:if="{{items.payMoney>0}}">
								<view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
									<button class="box_button_dui box_button_buy">立即购买</button>
								</view>
							</block>
							<block wx:if="{{items.payIntegral>0}}">
								<view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
									<button class="box_button_dui box_button_buy">立即兑换</button>
								</view>
							</block>
						</block>
						<block wx:if="{{!items.payMoney && !items.payIntegral}}">
							<view class="flex" bindtap="GetFree" data-index="{{index}}">
								<button class="box_button_dui box_button_buy">免费领取</button>
							</view>
						</block>
					</view>
				</block>
				<block wx:else>
					<view class="flex-vertical" style="color: #666;">
						<button class="box_button_dui box_button_buy" style="background-color: #666;">活动还未开始</button>
					</view>
				</block>
			</view>
		</view>
	</block>
	<block wx:if="{{is_read && wareCard.length<1 && is_get}}">
		<view class="foot_empty">
			<view>
				<image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
			</view>
			<view>
				<text>当前暂无礼包</text>
			</view>
			<view class="foot_empty_button">
				<text bindtap="goto" data-url="/pages/index/index/index">回到首页</text>
			</view>
		</view>
	</block>
	<!-- 加载完毕并且数据大于=页大小 -->
	<view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}">
		<view class="Line"></view>
		<view class="end fs26">到底了</view>
		<view class="Line"></view>
	</view>
</view>
<!-- 引入提示组件 -->
<warn id="warn"></warn>
<my_confirm id="my_confirm"></my_confirm>

<include src="../../../../pages/giftpack/public/buy_com.wxml"></include>