| | |
| | | <template> |
| | | <view class="page-container" @touchstart="resetInactivityTimer" @click="resetInactivityTimer"> |
| | | <view class="page-container" :class="{ landscape: isLandscapeLayout }" @touchstart="resetInactivityTimer" @click="resetInactivityTimer"> |
| | | <!-- 左侧柔光氛围 --> |
| | | <view class="bg-glow"></view> |
| | | |
| | |
| | | |
| | | <!-- 手动录入信息 UI --> |
| | | <template v-else> |
| | | <view class="main-card manual-card" @click="dismissNameInput"> |
| | | <view class="manual-layout-wrapper" :class="{ landscape: isLandscapeLayout }"> |
| | | <view class="main-card manual-card" @click="dismissNameInput"> |
| | | <text class="main-title">手动录入身份证号</text> |
| | | <text class="error-hint" v-if="mode === 'signout' && showMissingEntryHint">未检测到您的进场信息,请检查身份证号码是否正确</text> |
| | | |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 自定义键盘 --> |
| | | <view class="custom-keyboard" v-if="showCustomKeyboard"> |
| | | <view class="keyboard-grid"> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </template> |
| | | |
| | |
| | | |
| | | <script setup> |
| | | import { ref, computed, onMounted, onUnmounted, watch, nextTick, getCurrentInstance } from 'vue'; |
| | | import { onLoad } from '@dcloudio/uni-app'; |
| | | import { onLoad, onShow, onHide } from '@dcloudio/uni-app'; |
| | | import StepProgress from '../../components/StepProgress.vue'; |
| | | import { HardwareAPI } from '../../utils/visitorDevice'; |
| | | import { saveImageToLocal, deleteLocalImage } from '../../utils/fs'; |
| | |
| | | |
| | | const appointmentQrcodePayload = ref(null); |
| | | const appointmentIdCardPayload = ref(null); |
| | | const isLandscapeLayout = ref(false); |
| | | const faceScanLineRef = ref(null); |
| | | const hostScanLineRef = ref(null); |
| | | const facePreviewReady = ref(false); |
| | |
| | | }; |
| | | // ---------------------------------------------------- |
| | | onMounted(async () => { |
| | | resetInactivityTimer(); |
| | | resetInactivityTimer(); |
| | | |
| | | // 必须在页面挂载的第一时间注册扫码和读卡的事件监听, |
| | | // 绝对不能放在 await 数据加载之后,否则会导致进入页面前几十秒内刷卡/扫码无反应! |
| | |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | clearInactivityTimer(); |
| | | clearInactivityTimer(); |
| | | unregisterAppointmentScanHandler(); |
| | | uni.$off('Hardware-PrintOutOfPaper', handlePrinterOutOfPaper); |
| | | dismissNameInput(); |
| | |
| | | }); |
| | | |
| | | onLoad((options) => { |
| | | const windowInfo = uni.getWindowInfo(); |
| | | isLandscapeLayout.value = windowInfo.windowWidth > windowInfo.windowHeight; |
| | | uni.onWindowResize((res) => { |
| | | isLandscapeLayout.value = res.size.windowWidth > res.size.windowHeight; |
| | | }); |
| | | if (options.step) { |
| | | currentStep.value = parseInt(options.step, 10); |
| | | } |
| | |
| | | |
| | | .plate-confirm-btn { flex: 1; } |
| | | |
| | | |
| | | /* ==================== 横屏兼容 ==================== */ |
| | | .page-container.landscape { |
| | | width: 1920px; |
| | | height: 1080px; |
| | | padding-top: 30px; |
| | | padding-right: 48px; |
| | | padding-bottom: 40px; |
| | | padding-left: 48px; |
| | | align-items: center; |
| | | } |
| | | |
| | | .page-container.landscape .header-area { |
| | | width: 1824px; |
| | | } |
| | | .page-container.landscape .left-action { |
| | | width: 1824px; |
| | | } |
| | | .page-container.landscape .steps-card { |
| | | width: 1824px; |
| | | } |
| | | .page-container.landscape .steps-row { |
| | | width: 1824px; |
| | | } |
| | | |
| | | /* 主内容区 & 辅助区缩放 */ |
| | | .page-container.landscape .main-card { |
| | | width: 1824px; |
| | | height: 540px; |
| | | padding-top: 20px; |
| | | padding-right: 80px; |
| | | padding-bottom: 20px; |
| | | padding-left: 80px; |
| | | } |
| | | |
| | | .page-container.landscape .bottom-area { |
| | | width: 1824px; |
| | | height: 140px; |
| | | flex-direction: row; |
| | | justify-content: space-between; |
| | | } |
| | | .page-container.landscape .help-card, |
| | | .page-container.landscape .action-card { |
| | | width: 880px; |
| | | height: 140px; |
| | | } |
| | | .page-container.landscape .device-img { |
| | | width: 420px; |
| | | height: 320px; |
| | | } |
| | | .page-container.landscape .device-area { |
| | | height: 320px; |
| | | } |
| | | |
| | | /* 手动录入 */ |
| | | .manual-layout-wrapper { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .manual-layout-wrapper.landscape { |
| | | flex-direction: row; |
| | | justify-content: space-between; |
| | | width: 1824px; |
| | | } |
| | | .manual-layout-wrapper.landscape .manual-card { |
| | | width: 900px; |
| | | height: 704px; |
| | | } |
| | | .manual-layout-wrapper.landscape .custom-keyboard { |
| | | width: 900px; |
| | | height: 704px; |
| | | } |
| | | .manual-layout-wrapper.landscape .input-form-card { |
| | | width: 800px; |
| | | } |
| | | .manual-layout-wrapper.landscape .manual-input-box { |
| | | width: 800px; |
| | | } |
| | | .manual-layout-wrapper.landscape .real-input { |
| | | width: 800px; |
| | | } |
| | | |
| | | /* 人脸验证 */ |
| | | .page-container.landscape .face-capture-card { |
| | | height: 360px; |
| | | } |
| | | .page-container.landscape .viewfinder-area { |
| | | height: 240px; |
| | | } |
| | | .page-container.landscape .viewfinder-box { |
| | | width: 240px; |
| | | height: 240px; |
| | | } |
| | | .page-container.landscape .face-camera { |
| | | width: 240px; |
| | | height: 240px; |
| | | } |
| | | .page-container.landscape .scan-line { |
| | | width: 240px; |
| | | } |
| | | .page-container.landscape .viewfinder-border-mask { |
| | | width: 240px; |
| | | height: 240px; |
| | | } |
| | | .page-container.landscape .corner-donut { |
| | | width: 240px; |
| | | height: 240px; |
| | | } |
| | | |
| | | /* 完善信息 */ |
| | | .page-container.landscape .form-card { |
| | | width: 1824px; |
| | | height: 704px; |
| | | flex-direction: row; |
| | | flex-wrap: wrap; |
| | | align-content: flex-start; |
| | | padding-top: 40px; |
| | | padding-right: 40px; |
| | | padding-bottom: 40px; |
| | | padding-left: 40px; |
| | | } |
| | | .page-container.landscape .form-row { |
| | | width: 800px; |
| | | margin-right: 40px; |
| | | } |
| | | .page-container.landscape .form-action-row { |
| | | width: 1744px; |
| | | margin-top: auto; |
| | | justify-content: center; |
| | | } |
| | | .page-container.landscape .form-save-btn { |
| | | width: 600px; |
| | | } |
| | | |
| | | /* 打印凭条 */ |
| | | .page-container.landscape .print-ticket-demo { |
| | | width: 240px; |
| | | height: 320px; |
| | | } |
| | | .page-container.landscape .print-display-card { |
| | | height: 360px; |
| | | } |
| | | |
| | | </style> |