<!--pages/scan/entrance.wxml-->
<view style="text-align: center;">
  <view style="margin-top: 10vh;">
    <image wx:if="{{ !finishOpen }}" src="../../image/icon/gate-background.svg" style="height: 40vh;"></image>
    <image wx:else src="../../image/icon/{{isForbidden?'error':'done'}}.svg" style="height: 32vh; margin: 20px;"></image>
  </view>

  <view style="margin-top: 2vh;">
    <text wx:if="{{ !finishOpen }}">您将要进入社区</text>
  </view>

  <view style="margin-top: 10px;">
    <text style="font-size: 1.5em; font-weight: bold; color: {{ open ? '#0ee919' : 'red' }};">{{ gateName }}</text>
  </view>

  <view style="margin-top: 2vh;">
    <view wx:if="{{ !open }}">当前大门暂不允许通行</view>
    <view>当前时间：{{ currentTime }}</view>
    <text wx:if="{{ finishOpen && !isForbidden }}">大门已为您开启，欢迎回家！</text>
    <text wx:if="{{ finishOpen && isForbidden }}" style="font-weight: bold;color: red;">
      {{ forbiddenMsg }}
      您无权进入该大门，请联系管理员
    </text>
  </view>

  <!--按钮-->
  <view class="btnView" wx:if="{{ !finishOpen }}">
    <button disabled="{{ !open }}" class="btn" type="primary" bindtap="enterGate">确认进入</button>
    <button class="btn" type="warn" bindtap="navigateBack">不进入</button>
  </view>
  <view class="btnView" wx:else>
    <button class="btn" type="primary" bindtap="navigateBack">完成</button>
  </view>

</view>

<view style="font-size: 0.6em; color: #c5c5c5; position: absolute; bottom: 16px; width: 100%; text-align: center;">
  大门id: {{ gateId }}
</view>