parkroadgate.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!-- 道闸 -->
  2. <template>
  3. <view class="gate" id="page">
  4. <view class="gate-icon">
  5. <template v-if="status === 'opening'">
  6. <u-image width="100%" height="100%" src="/static/img/open-gate-icon.svg" />
  7. </template>
  8. <template v-else>
  9. <u-image width="100%" height="100%" src="/static/img/opened-gate-icon.svg" />
  10. </template>
  11. </view>
  12. <template v-if="status === 'opening'">
  13. <view class="gate-text">开闸中,请稍等!</view>
  14. </template>
  15. <template v-else>
  16. <view class="gate-text-opened">已开闸,请入场!</view>
  17. </template>
  18. <view class="gate-number">
  19. <u-message-input :maxlength="6" :value="code" :disabled-keyboard="true" inactive-color="#008CFF" />
  20. </view>
  21. <view class="gate-tips"> 提示:车辆出场时需要使用同一微信/支付宝扫码出场, 若不是, <text>请保存上面6位数字,用于出场时使用。</text></view>
  22. <view class="gate-cancel" v-if="status === 'opened'">
  23. <u-button type="primary" shape="circle" @click="handleCancel">返回</u-button>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. code: '',
  32. status: 'opening' // opening:开启中 opened:开启成功
  33. };
  34. },
  35. methods: {
  36. /**
  37. * @description: 返回
  38. * @return {*}
  39. */
  40. handleCancel() {
  41. uni.switchTab({
  42. url: '/pages/index/index'
  43. });
  44. }
  45. }
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. @import './parkroadgate.scss';
  50. </style>