<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>

<view class="tab-hd" bindtap="clickTab">
	<view class="tab-hd-item {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
</view>

<view class="tab-bd">
	<view class="list">
		<view class="list-item" wx:for="{{list.pageData}}">
		<!-- <view class="list-item" wx:for="{{list.pageData}}"> -->
			<view class="pd20" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&team_status={{item.team_status}}&group_id={{item.aid}}">
				<!-- <view class="fs28">{{item.act_name}} (第{{item.team_sn}}期) </view> -->
				<view class="pdr40 arrow" wx:if="{{item.team_status == 0}}">参团中，还差<text class="c-red">{{filters.difference(item.num, item.group_num)}}</text>人</view>
				<view class="pdr40 arrow" wx:elif="{{item.team_status == 2}}">已团中，{{item.shipping_status == 0 ? '待发货':'已发货'}}</view>
				<view class="pdr40 arrow" wx:elif="{{item.team_status == 1}}">未团中，已退款</view>
			</view>
			<view class="flex pd20">
				<view class="img-container">
					<image class="img-block" src="{{imghost + item.original_img}}" data-val="{{item.original_img}}"
			    data-errorimg="list.pageData[{{index}}].original_img" binderror="bind_bnerr" lazy-load="true"></image>
					</view>
				<view>
					<view class="title ellipsis-2">{{item.goods_name}}</view>
					<view class="flex ai-center">
						<text class="rmb fs40 c-red">{{filters.price(item.group_price)}}</text>
<!--						<view class="fs24 del pdl10 c-c7">零售价<text class="rmb">{{item.market_price}}</text></view>-->
					</view>
					<view class="c-red fs24" wx:if="{{item.team_status != 2}}">未团中可获得帮团奖励</view>
				</view>
			</view>
			<view class="flex ai-center pd20 bdt fs24 jc_sb">
				<view>共1件，实付金额：<text class="rmb">{{filters.toFix(item.order_amount+item.user_money,2)}}</text></view>
				<view class="flex">
					<view class="btn gray" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&team_status={{item.team_status}}&group_id={{item.aid}}">查看订单</view>
					<view class="btn c-red mgl20" wx:if="{{item.team_status == 0}}" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{item.aid}}&goods_id={{item.goods_id}}&goods_name={{item.goods_name}}&team_id={{item.team_id}}&&from=1">邀请好友</view>
					<view class="btn c-red mgl20" wx:if="{{item.team_status == 1}}" bindtap="showReward" data-index="{{index}}" data-aid="{{item.aid}}">查看奖励</view>
				</view>
			</view>
		</view>
	</view>
</view>


<view class="popup-container" wx:if="{{showReward}}">
	<view class="popup">
		<view class="pd20 flex jc_sb">
			<text class="c-red">帮团奖励</text>
			<text class="iconfont icon-close fs32 c-7b" bindtap="closeReward"></text>
		</view>
		<view class="popup-list">
			<block wx:for="{{prizesArr}}">
				<!-- 优惠券奖励 -->
				<block wx:if="{{item.type == 3}}">
					<view class="popup-list-item" wx:for="{{item.couponList}}" wx:for-item="i">
						<view class="img-container"><image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/yhq.png'}}"></image></view>
						<view class="f1">
							<view class="ellipsis-2 popup-title">优惠券-{{i.name}}</view>
							<view class="fs24 t-r pdt16 c-7b">数量：<text class="c-red">{{i.num}}</text></view>
						</view>
					</view>
				</block>
				<!-- 服务项目奖励 -->
				<block wx:elif="{{item.type == 4}}">
					<view class="popup-list-item" wx:for="{{item.serviceList}}" wx:for-item="i">
						<view class="img-container"><image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/fw.png'}}"></image></view>
						<view class="f1">
							<view class="ellipsis-2 popup-title">服务项目-{{i.name}}</view>
							<view class="fs24 t-r pdt16 c-7b">数量：<text class="c-red">{{i.num}}</text></view>
						</view>
					</view>
				</block>
				<!-- 预存金额 -->
				<block wx:elif="{{item.type == 5}}">
					<view class="popup-list-item">
						<view class="img-container"><image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/jf.png'}}"></image></view>
						<view class="f1">
							<view class="ellipsis-2 popup-title">{{list.pageData[currentItemIndex][item.name]}}</view>
							<view class="fs24 t-r pdt16 c-7b">金额：<text class="c-red">{{filters.div100((list.pageData[currentItemIndex][item.num]))}}</text></view>
						</view>
					</view>
				</block>
				<!-- 其他奖励 -->
				<block wx:else>
					<view class="popup-list-item">
						<view class="img-container">
							<image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/lb.png'}}" wx:if="{{item.type == 1}}"></image>
							<image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/czz.png'}}" wx:elif="{{item.type == 2}}"></image>
						</view>
						<view class="f1">
							<view class="ellipsis-2 popup-title">{{item.name}}</view>
							<view class="fs24 t-r pdt16 c-7b">数量：<text class="c-red">{{list.pageData[currentItemIndex][item.num]}}</text></view>
						</view>
					</view>
				</block>
			</block>	
					
		</view>
	</view>
</view>

	<!-- <view class="fs24 t-r pdt16 c-7b">数量：<text class="c-red">{{list.pageData[currentItemIndex][typeArr[item-1]['key']]}}</text></view> -->



<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底啦 ——</view>
<nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>