<Drawer id='check-in-drawer' class="check-in-drawer" needCancel="{{false}}" bind:myCancel="myCancel">
  <view wx:if="{{visible && data}}" class="check-in-drawer-wrap {{useDarkTheme ? 'check-in-drawer-wrap-dark' : ''}}">
    <mp-icon bindtap="closeCheckInDrawer" icon="close" color="#939aa3" size="{{20}}" class="close drawer-close-shadow" />
     <view wx:if="{{isSubmitSuccess}}" class="check-in-result">
      <image src="../../../assets/success.svg" />
      <view class="check-in-result-title">签到成功</view>
      <view class="check-in-result-subtitle">感谢你的参与</view>
     </view>
     <view wx:else>
        <!-- 标题 -->
        <view class="check-in-title">{{data.CheckInName}}</view>
        <!-- 倒计时 -->
        <count-down
          type="check-in"
          wx:if="{{data.StartTime}}"
          sendTime="{{data.StartTime}}"
          deadLine="{{data.Deadline}}"
          deadLineSecond="{{data.DeadlineSecond}}"
          forceZero="{{isDeadline}}"
          useDarkTheme="{{useDarkTheme}}"
          bind:onCountDown="onCountDown"
        />
        <!-- 提交 -->
        <view class="check-in-content">
          <view class="check-in-over" style="opacity: {{isDeadline ? 1 : 0}}">
            签到已结束
          </view>
          <view wx:if="{{data.ShowKickoutTip && !isDeadline}}" class="check-in-secondary-tip">
            为避免暂停观看直播，请尽快完成签到
          </view>
          <button
            wx:if="{{data.IsChecked || isDeadline}}"
            disabled="{{true}}"
            class="check-in-footer-button check-in-footer-button-disabled"
            type="primary"
            bindtap="formSubmit"
          >{{data.IsChecked ? '已签到' : '未签到'}}</button>
          <view wx:elif="{{data.NeedPersonInfo}}" class="check-in-footer">
            <input
              class="check-in-footer-input"
              bindinput="valueChange"
              value="{{checkValue}}"
              maxlength="{{20}}"
              placeholder="{{data.CheckInInfo}}"
            />
            <button
              class="check-in-footer-button"
              type="primary"
              bindtap="formSubmit"
            >立即签到</button>
          </view>
          <button
            wx:else
            class="check-in-footer-button"
            type="primary"
            bindtap="formSubmit"
          >点击签到</button>
          <view class="error-msg" style="display: {{!errMsg ? 'none' : 'block'}}">
            {{errMsg === 'empty' ? '输入项不能为空' : errMsg }}
          </view>
        </view>
     </view>
  </view>
</Drawer>
