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

<com_top_nav title="{{l_title}}" need_cover="1"></com_top_nav>

<view class="luck-container {{!template&&custom ? 'on':''}}" style="{{luckStyle}}">
<!-- <view class="luck-container {{!template&&custom ? 'on':''}}" style="background: {{template&&template.colorCode ? template.colorCode:(custom ? '#f0f0f0':'#da104b')}} url({{bannerUrl ? bannerUrl:''}}) no-repeat;"> -->
	<!-- 中奖人员 -->
	<view class="swiper-container" wx:if="{{nameList && nameList.length != 0}}">
		<swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
			<swiper-item class="swiper-item" wx:for="{{nameList}}">
				<view class="item">
					<view class="avatar-container">
						<image src="{{item.head_pic}}" class="img-block"></image>
					</view>
					<view class="flex ai_c pdr10">
						<view class="nickname ellipsis-1x">{{item.nickname}}</view>
						<view style="flex-shrink: 0;">获得了"{{item.luck_goods_name}}"</view>
					</view>
				</view>
			</swiper-item>
		</swiper>
	</view>
  <!-- 大转盘 -->
	<view class="weel-container">
		<view>
			<lucky-wheel
				class="myLucky"
			  id="myLucky"
			  width="700rpx"
			  height="700rpx"
			  blocks="{{blocks}}"
			  prizes="{{prizes}}"
			  buttons="{{buttons}}"
				defaultConfig="{{defaultConfig}}"
			  defaultStyle="{{defaultStyle}}"
			  bindstart="start"
			  bindend="end"
				hiddenCanvas="{{hiddenCanvas}}"
			/>
		</view>
		<view class="weel-txt fs28 white t-c pdt10" wx:if="{{luckInfo.vip_act_num == 0}}">今天你有 <text class="fs50 c-yellow cs">不限次</text> 抽奖机会</view>
		<view class="weel-txt fs28 white t-c pdt10" wx:else>今天你还有 <text class="fs50 c-yellow cs">{{filter.show_default(luckInfo.user_LuckNumDay < 0 ? 0:luckInfo.user_LuckNumDay, '0')}}</text> 次抽奖机会</view>
		<view class="tip-to-down expand-transition">
			<text></text>
			<text></text>
		</view>
	</view>
	<!-- 奖品展示 -->
	<view wx:if="{{award && award.length != 0}}">
		<view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge prizes" lazy-load></image></view>
		<view class="panel list br12 bg-white">
			<view class="list-item" wx:for="{{award}}">
				<view class="img-container">
					<image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image>
					<image src="{{imghost + tool.showDefaultImg(item.lbtype)}}" class="img  {{item.lbtype==7?'small_set':''}} " mode="aspectFit" wx:else></image>
				</view>
				<view class="item-r">
					<view class="fs28">{{item.luck_goods_name}}</view>
					<view class="flex jc_sb fs26 c9">
						<view>价值：<text class="rmb">{{item.luck_goods_price}}</text></view>
						<view>数量：{{item.num}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	<!-- 活动展示 -->
	<view>
		<view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge activity" lazy-load></image></view>
		<view class="panel bg-white br12 pd20 fs28">
			<!-- {{luckInfo.remark}} -->
			<import src="../../../../utils/wxParse/wxParse.wxml"/>
			<!-- <template is="wxParse" data="{{wxParseData:content.nodes}}"/> -->
			<!-- 时间 -->
			<view class="brdt">
				<!-- <view class=""> -->
					<view class="txt-red">活动时间：</view>
					<view class="fs28 pdv20">{{filter.format_time(luckInfo.begindate, 1) + ' 至 ' + filter.format_time(luckInfo.enddate, 1)}}</view>
				<!-- </view> -->
			</view>
			<!-- 规则 -->
			<view class="brdt" wx:if="{{luckInfo.remark}}">
				<view class="txt-red pdt20">活动说明：</view>
				<view class="fs28 pdv20"><template is="wxParse" data="{{wxParseData:content.nodes}}"/></view>
			</view>
			<!-- 电话 -->
			<!-- <view class="bdb">
				<view class="txt-red pdt20">联系电话：</view>
				<view class="fs28 pdv20">-</view>
			</view> -->
			<!-- 地址 -->
			<!-- <view>
				<view class="txt-red pdv20">门店兑换地址：</view>
				<view class="pdv20">
					<view class="fs28">化妆门店2（芊婕化妆品）</view>
					<view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
					<view class="tel pdt10">
						<text class="iconfont icon-tel"></text>
						<text class="text-underline">1380000000</text>
					</view>
				</view>
				<view class="pdv20">
					<view class="fs28">化妆门店2（芊婕化妆品）</view>
					<view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
					<view class="tel pdt10">
						<text class="iconfont icon-tel"></text>
						<text class="text-underline">1380000000</text>
					</view>
				</view>
			</view> -->
		</view>
	</view>
	<!-- 二维码 -->
	<!-- <view class="qrcode-container">
		<image src="../../../images/luckDraw/badge.png" class="qrcode"></image>
		<view class="pdt20 fs24 c-7b">
			<view>长按二维码关注我们订阅更多优惠</view>
			<view>信息更多优惠等你来拿哦</view>
		</view>
	</view> -->
	<!-- 技术支持 -->
	<view class="logo-container t-c">
		<!-- <view class="pdt20 fs26 text-underline">帮美店免费开通这个玩法</view> -->
		<view class="flex ai_c fs24 jc-center pdv20 white"><image src="{{imghost + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>提供技术支持</view>
	</view>
</view>

<!-- 分享按钮 -->
<view class="circle-container zhuanfa" bindtap="showPoster" wx:if="{{!luckInfo.is_share}}"><text class="iconfont icon-zhuanfa1"></text></view>

<!-- 悬浮按钮 -->
<view class="circle-container gift {{((record && record.length != 0) || isActive) ? 'active':''}}" bindtap="showPopup"><text class="iconfont icon-liwu"></text></view>

<!-- 弹窗 -->
<view class="popup-container" wx:if="{{showPopup}}" catchtouchmove="true">
	<scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore">
		<view class="popup-item" wx:for="{{list.pageData}}">
				<view class="img-container">
					<image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image>
					<image wx:else src="{{imghost + tool.showDefaultImg(item.luck_type)}}" class="img {{item.luck_type==7?'small_set':''}}  " mode="aspectFit"></image>
				</view>
				<view class="flex fdc f1">	
					<view class="ellipsis-2 fs28">{{item.luck_name}}</view>
					<view class="pdt20">
						<view class="fs26 xc-black3">价值：<text class="rmb">{{item.luck_goods_price}}</text></view>
						<view class="flex ai_c {{item.luck_type == 5 ? 'jc_sb':'jc_fe'}} fs26 xc-black3 ">
							<!-- <view style="visibility: {{item.luck_type == 5 ? 'visible':'hidden'}};">兑换状态：{{item.state == 0 ? '未兑换':'已兑换'}}</view> -->
							<!-- <view style="">兑换状态：{{item.state == 0 ? '未兑换':'已兑换'}}</view> --> 
							<view class="fs24 c-a" wx:if="{{item.luck_type == 5}}">兑换截止时间：{{filter.show_default(item.changeDate, '不限')}}</view>
							<view class="btn" bindtap="{{item.luck_type == 5 ? (item.state == 0 ? 'select_product2':'select_product2'):'goto'}}" data-verify_pickup_id="{{item.verify_pickup_id}}" data-type="{{item.luck_type}}" data-id="{{item.id}}" data-ordersn="{{item.order_sn}}" data-buyreceiveid="{{item.buyreceive_id}}">{{item.luck_type == 5 ? (item.state == 1 ? '已兑换':'兑换'):'查看'}}</view>
						</view>
					</view>
				</view>
		</view>
		<nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
		<view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
	</scroll-view>
	<view class="close-container" bindtap="closePopup"><text class="iconfont icon-close"></text></view>
</view>


<view class="popup-container2" wx:if="{{showResult}}">
	<view class="t-r"><text class="iconfont icon-close white" bindtap="closeResult"></text></view>
	<view class="popup">
		<view class="t-c">
			<block wx:if="{{resultTitle == '谢谢参与'}}">
				<view class="bold c-tb fs40">{{luckInfo.no_luck_name}}</view>
				<view class="pdt10">{{luckInfo.no_luck_remark}}</view>
				<view class="img-container2"><image src="{{imghost + (luckInfo.no_luck_img ? luckInfo.no_luck_img:'/miniapp/images/luckDraw/nolockimg.png')}}" class="img" mode="aspectFit" lazy-load></image></view>
				<view class="pdt40 fs26 c9 t-c" wx:if="{{(luckInfo.no_luck_urltype == 1) && luckInfo.no_luck_weappurl}}">{{num}}s后自动跳转...</view>
			</block>
			<block wx:else>
				<view class="bold c-tb fs40">恭喜你获得</view>
				<view class="pdt10">{{resultTitle}} </view>
				<view class="img-container2">
					<!-- <image src="{{imghost + 'miniapp/images/luckDraw/gift.png'}}" class="img" mode="aspectFit"></image> -->
					<image wx:if="{{wow.luck_goods_img}}" src="{{imghost + wow.luck_goods_img}}" class="img" mode="aspectFit" lazy-load></image>
					<image src="{{imghost + tool.showDefaultImg(wow.lbtype)}}" class="img" mode="aspectFit" lazy-load wx:else></image>
				</view>
			</block>
		</view>
		
		<view class="pdt40" wx:if="{{currentLbtype == 5}}">
			<view class="btn btn2" bindtap="select_product">立即兑换</view>
		</view>
		
		
		<!-- <view class="note">注：未领取就关闭弹窗视为主动放弃奖品。</view> -->
	</view>
</view>

<!-- 海报 -->
	<view class="poster-container" wx:if="{{showPoster}}">
		<view class="t-r pdb20 white2"><text class="iconfont icon-close fs40" bindtap="closePoster"></text></view>
		<image src="{{myimg}}" class="poster" show-menu-by-longpress></image>
		<view class="pdt10 fs26 white2"><text class="iconfont icon-zhiwen"></text> 长按图片保存至相册</view>
	</view>


<!-- 遮罩层 -->
<view class="mask" wx:if="{{showMask}}"></view>


<qrcode id="qrcode" bind:close="closeQr"></qrcode>

<!-- 门店选择弹窗 --> 
<store_popup store="{{store}}" bind:closeback="closeback" bind:callback="callback" ></store_popup>

<painter style="position: absolute;left: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/>