nfc提交绑定和设备操作

This commit is contained in:
WindowBird 2025-11-25 14:46:15 +08:00
parent ed8e49f4d6
commit 60529f5d84
2 changed files with 22 additions and 12 deletions

View File

@ -98,12 +98,22 @@
<!-- <text class="label">绑定单元 ID</text>-->
<!-- <text class="unit-value">{{ unitId }}</text>-->
<!-- </view>-->
<view
:class="['primary-btn', { disabled: !canSubmit || binding }]"
@click="handleBind"
>
{{ binding ? "提交中..." : "提交绑定" }}
<view style="display: flex; gap: 10px">
<view
:class="['primary-btn', { disabled: !canSubmit || binding }]"
style="flex: 1"
@click="handleBind"
>
{{ binding ? "提交中..." : "提交绑定" }}
</view>
<view
v-if="cardNo"
:class="['primary-btn']"
style="flex: 1"
@click="reportSwipeCard(cardNo)"
>
设备操作
</view>
</view>
</view>
</view>
@ -642,6 +652,7 @@ export default {
async handleBind() {
if (!this.canSubmit || this.binding) return;
this.binding = true;
uni.showLoading({ title: "提交中...", mask: true });
try {
const payload = {
@ -846,7 +857,7 @@ export default {
// duration: 1500,
// });
console.log("NFC 读取到的卡号:", cardNo);
this.reportSwipeCard(cardNo);
// this.reportSwipeCard(cardNo);
} else {
console.warn("无法从 NFC 标签中提取卡号:", res);
uni.showToast({
@ -896,10 +907,9 @@ export default {
});
},
async reportSwipeCard(cardNo) {
return;
// if (!cardNo || this.reportingSwipe) {
// return;
// }
if (!cardNo || this.reportingSwipe) {
return;
}
this.reportingSwipe = true;
uni.showLoading({
title: "处理中...",

View File

@ -6,7 +6,7 @@ import debounce from "uview-ui/libs/function/debounce";
const ENV_CONFIG = {
release: {
// 正式版
// baseUrl: "http://192.168.1.4:4501",
// baseUrl: "http://192.168.1.2:4501",
baseUrl: "https://tech-ape.top/prod-api",
// baseUrl: "https://tech-ape.top/prod-api",
appId: 1,