<!--pages/luckDraw/detail.wxml-->
<view class="page" wx:if="{{showPage}}" style="background-color: {{bgColor}};">
    <view class="head-bg">
       <image src="{{themePic}}" mode="widthFix"/>
    </view>
    <!-- 抽奖视图 -->
    <view class="luck-draw-box">

       <view class="luck-draw-body">
            <view class="luck-draw-tip">
                <image class="_niyou" src="/images/luck-draw/niyou.png" />
                <image wx:for="{{remainNumSplits}}" wx:key="key" class="_num _{{item}}" src="/images/luck-draw/{{item}}.png" />
                <image class="_ci" src="/images/luck-draw/ci.png" />
                <image class="_cjjh" src="/images/luck-draw/cjjh.png" />
            </view>
            <view class="luck-draw-record-btn" catchtap="toLuckDrawPage">抽奖记录</view>

            <!-- 奖品转盘 -->
            <view class="luck-draw-gifts">
                <view wx:for="{{giftList}}" wx:key="idx" wx:for-index="idx" class="_gift _pos_{{idx}}">
                    <view class="_ico">
                        <image wx:if="item.iconPath" src="{{item.iconUrl}}"/>
                    </view>
                    <view class="_text">
                    <text></text>
                    </view>
                    <image class="_bg" src="{{item.active ? '/images/luck-draw/gift-booth-active.png': '/images/luck-draw/gift-booth.png'}}" />
                </view>

                <!-- 抽奖按钮 -->
                <block wx:if="{{forbidTurn}}">
                    <view class="_gift _turn_btn">
                        <image class="_bg" src="/images/luck-draw/gift-booth-center-disable.png" />
                    </view>
                </block>
                <block wx:else>
                    <view class="_gift _turn_btn" catchtap="turnPrize">
                        <button wx:if="{{!isLogin}}" class="phone-button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" />
                        <image class="_bg" src="/images/luck-draw/gift-booth-center.png" />
                        <view wx:if="{{isLogin}}" class="_nums">
                            <text>{{remainNum}}/{{allNum}}</text>
                        </view>
                    </view>    
                </block>

            </view>

        </view>

        <!-- 背景 -->
        <view class="luck-draw-bg">
            <image src="{{boxBgPic}}" />
        </view>

    </view>

    <!-- 活动规则 -->
    <view class="block-item-title">
        <view/>
        <text>活动规则</text>
        <view/>
    </view>
    <view class="rule-des">
        <text>{{ruleDesc}}</text>
    </view>

    <!-- 中奖名单 -->
    <view class="block-item-title">
        <view/>
        <text>中奖名单</text>
        <view/>
    </view>
    <view class="hit-record-list">
        <view class="_item" wx:for="{{hitRecordList}}" wx:key="key">
            <view>{{item.mobile}}</view>
            <viwe>{{item.goodsName}}</viwe>
        </view>
    </view>

    <!-- 中奖对话框 -->
    <view class="dlg" wx:if="{{showHitPrizeDlg}}">
        <view class="prize-body">
            <view class="prize-title">
                恭喜您中奖了!
            </view>
            <view class="prize-subtitle">{{hitResult.goodsName}}</view>
            <view class="prize-figure">
            <!-- 图片封面 -->
            <image wx:if="{{hitResult.goodsBigImage}}" src="{{hitResult.goodsBigImage}}" mode="aspectFit" />
            <image src="/images/luck-draw/gift.png" mode="aspectFit" wx:else />
            </view>
            <view class="prize-tip">{{hitResult.hitDesc || ""}}</view>
            <view class="btns">
                <view class="_btn _confirm" catchtap="closeDlg">确定</view>
                <jumpmallapp wx:if="{{hitResult.goodsType == 1}}" class="_btn _exchange">去使用</jumpmallapp>
                <view wx:if="{{hitResult.goodsType == 3}}" catchtap="toLookHitPhoto" class="_btn _exchange">去使用</view>
            </view>
            <image class="_bg" src="{{popBgPic}}" />
        </view>
        <view class="_layer" catchtap="closeDlg" />
    </view>

    <!-- 未中奖对话框 -->
    <view class="dlg" wx:if="{{showNoHitPrizeDlg}}">
        <view class="prize-body">
            <view class="prize-title">
                再接再厉!
            </view>
            <view class="prize-subtitle">离奖品只差一个手势~</view>
            <view class="prize-figure">
               <image wx:if="{{noHitResult.goodsBigImage}}" src="{{noHitResult.goodsBigImage}}" mode="aspectFit" />
               <image src="/images/luck-draw/nogift.png" mode="aspectFit" wx:else />
            </view>
            <view class="prize-tip">点击确认继续抽奖!</view>
            <view class="btns">
                <view class="_btn _share" catchtap="closeDlg">确认</view>
            </view>
            <image class="_bg" src="{{popBgPic}}" />
        </view>
        <view class="_layer" catchtap="closeDlg" />
    </view>


    <!-- 需要分享显示 -->
    <view class="dlg" wx:if="{{showNeedShareDlg}}">
        <view class="prize-body">
            <view class="prize-title">
                再接再厉!
            </view>
            <view class="prize-subtitle">离奖品只差一个手势~</view>
            <view class="prize-figure">
               <image wx:if="{{noHitResult.goodsBigImage}}" src="{{noHitResult.goodsBigImage}}" mode="aspectFit" />
               <image src="/images/luck-draw/nogift.png" mode="aspectFit" wx:else />
            </view>
            <view class="prize-tip">分享可获得更多抽奖机会!</view>
            <view class="btns">
                <button class="_btn _share" open-type="share">分享</button>
            </view>
            <image class="_bg" src="{{popBgPic}}" />
        </view>
        <view class="_layer" catchtap="closeDlg" />
    </view>

    <!-- 状态 -->
    <view wx:if="{{status != 2}}" class="status_tip_layer" catchtap="turnActivityListPage">
        <view class="_text" wx:if="{{errMessage}}">
            <view>{{errMessage}}</view>
        </view>
        <view wx:elif="{{status == 3}}" class="_text">
            <view>此活动已结束</view>
            <view>敬请关注其他活动...</view>
        </view>
        <view class="_text" wx:else>
            <view>距活动开启还剩</view>
            <view>{{countDownTime}}</view>
        </view>
    </view>

</view>

<custom-preview-image wx:if="{{showCustomPreview}}"  src="{{previewImgSrc}}" bind:closeCallback="closePreviewImage"/>