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 7e40e7d2..1116f803 100644 --- a/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue +++ b/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue @@ -12,6 +12,7 @@ const userId = userStore.userInfo.userId const isFinish = ref(false) // 是否继续扫码 const isScan = ref(false) +const isFromScan = ref(false) // 是否触发下拉刷新 const isTriggered = ref(false) // 定义 porps @@ -132,6 +133,10 @@ const handleSearch = async (e) => { saveSearchValue(queryParams.subOrDetailName) await getListData(); }; +const onInputSearch = (e) => { + if (isFromScan.value) return; + handleSearch({ inputValue: e.detail?.value ?? searchVal.value }); +}; const viewClick = async (item) => { const params = { id: item.id @@ -145,8 +150,10 @@ const viewClick = async (item) => { const handleScan = async() => { uni.scanCode({ success: async(res) => { + isFromScan.value = true searchVal.value = res.result - await handleSearch({ inputValue: res.result }) + await handleSearch({ inputValue: res.result }) + isFromScan.value = false if (isScan.value){ handleScan() } @@ -230,7 +237,7 @@ const onRefresherrefresh = async () => { height: 50px; line-height: 50px; " - @input="handleSearch({ inputValue: searchVal })" + @input="onInputSearch" clearable /> import { reactive, ref, toRefs,nextTick,onMounted } from 'vue'; -import { useRoute } from 'vue-router'; +// import { useRoute } from 'vue-router'; import { onLoad, onShow } from '@dcloudio/uni-app' import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue' const title = ref('图片预览'); const src = ref([]); -const route = useRoute(); +// const route = useRoute(); const picture = ref(''); const previewImage = ref(null); diff --git a/mes-ui/mini-app/src/pages/unqualifiedNotificationConfirm/components/showpicture.vue b/mes-ui/mini-app/src/pages/unqualifiedNotificationConfirm/components/showpicture.vue index 5b9dbf98..7d8e658b 100644 --- a/mes-ui/mini-app/src/pages/unqualifiedNotificationConfirm/components/showpicture.vue +++ b/mes-ui/mini-app/src/pages/unqualifiedNotificationConfirm/components/showpicture.vue @@ -7,12 +7,12 @@