diff --git a/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue b/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue index 79748826..f9fb1561 100644 --- a/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue +++ b/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue @@ -76,12 +76,10 @@ const getListData = async () => { // 发送请求 try { const data = await getListAPIWX(queryParams) - isLoading.value = false + if (data.data!=null){ uni.showToast({ title: data.data, icon: 'none' }) - isScan.value=true; - //等待三秒再次打开扫码窗口 setTimeout(() => { handleScan() }, delay.value * 1000); @@ -159,18 +157,22 @@ const viewClick = async (item) => { } }; const handleScan = async() => { + if (isScan.value) return + isScan.value = true uni.scanCode({ success: async(res) => { isFromScan.value = true searchVal.value = res.result await handleSearch({ inputValue: res.result }) isFromScan.value = false - if (isScan.value){ - handleScan() - } }, fail: () => { uni.showToast({ title: '扫码失败或用户取消扫码', icon: 'none' }) + }, + complete: () => { + setTimeout(() => { + isScan.value = false; + }, 200); // 给一点缓冲 } }) }