<view class="result-wrap">
  <mp-dialog wx:if="{{visible && type === 'result' && data}}" show="{{visible && type === 'result' && data}}" mask="{{true}}" mask-closable="{{true}}" ext-class="lottery-result-dialog{{IsUseDarkTheme ? ' lottery-result-dialog-dark' : ''}}{{data.AwardThemeUrl === 'lotteryBox' ? ' lottery-result-dialog-box' : ''}}{{data.AwardThemeUrl === 'slotMachine' ? ' lottery-result-dialog-machine' : ''}}" bindclose="closeModal">
    <image wx:if="{{!showAwardList}}" class="lottery-header-image" src="{{data.ifAward ? 'https://mediaservice-fe.volccdn.com/obj/vcloud-fe/livesaas-client/static/media/winning.26296204.svg' : 'https://mediaservice-fe.volccdn.com/obj/vcloud-fe/livesaas-client/static/media/no_winning.fe4c430e.svg'}}" />
    <view class="lottery-result-content-wrap">
      <image wx:if="{{!IsUseDarkTheme && data.AwardThemeUrl !== 'lotteryBox' && data.AwardThemeUrl !== 'slotMachine'}}" class="lottery-result-dialog-bg" src="../assets/questionaireImage.png" />
      <view class="lottery-header {{!data.ifAward ? 'lottery-header-not-win' : ''}}">
        <mp-icon wx:if="{{showAwardList}}" icon="back" size="{{12}}" class="lottery-header-icon-left" bindtap="closeLotteryList" />
        <mp-icon icon="close" size="{{20}}" class="lottery-header-icon-close" bindtap="closeModal" />
      </view>
      <view class="lottery-result">
        <view wx:if="{{showAwardList}}" style="margin-top: -6px">
          <award-list data="{{data}}" IsUseDarkTheme="{{IsUseDarkTheme}}" sdkInstance="{{sdkInstance}}" />
        </view>
        <view wx:elif="{{data.ifAward}}">
          <view class="lottery-winning-result">恭喜你，中奖啦</view>
          <view wx:if="{{!data.showSubmit && !data.isTicket}}" class="lottery-bottom-detail">
            请联系主办方领取奖品
          </view>
          <award-card type="result" status="{{0}}" IsUseDarkTheme="{{IsUseDarkTheme}}" data="{{data}}" />
          <view wx:if="{{data.showSubmit}}" class="lottery-result-collect {{data.fulfilled && data.showSubmit && !isFormEdit ? 'lottery-result-collect-full' : ''}}">
            <view wx:if="{{data.fulfilled && data.showSubmit && !isFormEdit}}">
              <view class="lottery-result-collect-full-title">
                <view>收货信息</view>
                <view bindtap="editClick">
                  <image style="width: 14px; height: 14px; position: relative; top: 2px;" src="{{(data.AwardThemeUrl !== 'lotteryBox' && data.AwardThemeUrl !== 'slotMachine' && IsUseDarkTheme) ? '../../../../assets/edit_dark.svg' : '../../../../assets/edit.svg'}}" />
                  修改
                </view>
              </view>
              <view wx:if="{{data.ReceiverName || data.AwardTel}}">
                {{data.ReceiverName}}
                <view wx:if="{{data.ReceiverName && data.AwardTel}}" class="lottery-result-collect-full-cut">
                  |
                </view>
                {{data.AwardTel}}
              </view>
              <view>{{data.AwardAddress}}</view>
            </view>
            <mp-form wx:else models="{{formData}}" class="address-form">
              <view wx:if="{{data.showReceiverName}}" class="form-item">
                <view class="form-item-label">
                  <strong>*</strong>
                  收件人
                </view>
                <input class="form-input" value="{{formData.receiverName}}" bindinput="formReceiverNameChange" placeholder="请输入收件人" />
                <view wx:if="{{receiverNameError}}" class="form-item-error-message">请输入收件人</view>
              </view>
              <view wx:if="{{data.showMobile}}" class="form-item">
                <view class="form-item-label">
                  <strong>*</strong>
                  手机号
                </view>
                <view class="form-tel-wrap">
                  <picker bindchange="formRegionChange" value="{{formData.region}}" range="{{regionArray}}">
                    <view class="form-picker">{{regionArray[formData.region]}}</view>
                  </picker>
                  <input class="form-tel" value="{{formData.tel}}" bindinput="formTelChange" placeholder="请输入手机号码" />
                </view>
                <view wx:if="{{telError || telEmptyError}}" class="form-item-error-message">
                  {{telError ? '请输入正确的手机号' : '请输入手机号'}}
                </view>
              </view>
              <view wx:if="{{data.showEmail}}" class="form-item">
                <view class="form-item-label">
                  <strong>*</strong>
                  邮箱
                </view>
                <input class="form-input" value="{{formData.email}}" bindinput="formEmailChange" placeholder="请输入邮箱" />
                <view wx:if="{{emailError}}" class="form-item-error-message">请输入邮箱</view>
              </view>
              <view wx:if="{{data.showAddress}}" class="form-item">
                <view class="form-item-label">
                  <strong>*</strong>
                  收货地址
                </view>
                <textarea class="form-address" value="{{formData.address}}" bindinput="formAddressChange" placeholder="请输入收货地址" />
                <view wx:if="{{addressError}}" class="form-item-error-message">请输入收货地址</view>
              </view>
            </mp-form>
          </view>
          <button wx:if="{{data.isTicket}}" type="primary" bindtap="onTicketGo" class="lottery-result-button lottery-result-button-primary">
            前往领取奖品
          </button>
          <button wx:if="{{(data.showSubmit && !data.fulfilled) || isFormEdit}}" disabled="{{isSubmitDisabled}}" type="primary" bindtap="onPersonalInfoOk" class="lottery-result-button lottery-result-button-primary {{isSubmitDisabled ? 'lottery-result-button-primary-disabled' : ''}}">
            提交中奖信息
          </button>
          <button wx:else type="default" bindtap="checkLotteryList" class="lottery-result-button lottery-result-button-default">
            查看中奖名单
          </button>
        </view>
        <view wx:else>
          <view class="lottery-lose-result">很遗憾，你没有中奖</view>
          <award-card type="result" status="{{0}}" IsUseDarkTheme="{{IsUseDarkTheme}}" data="{{data}}" />
          <button type="default" bindtap="checkLotteryList" class="lottery-result-button lottery-result-button-default">
            查看中奖名单
          </button>
        </view>
      </view>
    </view>
  </mp-dialog>
</view>
