hookehuyr

feat(qrCodeSearch): 添加id_type参数支持不同二维码类型查询

在qrCodeSearch组件中新增id_type参数,用于区分不同类型的二维码查询
修改watch监听逻辑以同时响应id和id_type的变化
......@@ -46,6 +46,10 @@ const props = defineProps({
type: String,
default: ''
},
id_type: {
type: Number,
default: 1
}
});
const userinfo = ref({});
......@@ -143,7 +147,9 @@ const load_qr_code_info = async (id_number) => {
}
is_loading.value = true
const res = await queryQrCodeAPI({ id_number: id })
const params = { id_number: id }
if (props.id_type) params.id_type = props.id_type
const res = await queryQrCodeAPI(params)
if (is_destroyed) return
is_loading.value = false
......@@ -172,8 +178,8 @@ onMounted(() => {
})
watch(
() => props.id,
(val) => {
() => [props.id, props.id_type],
([val]) => {
if (is_loading.value) return
load_qr_code_info(val)
}
......
<!--
* @Date: 2024-01-26 13:08:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-15 09:27:42
* @FilePath: /xyxBooking-weapp/src/pages/search/index.vue
* @LastEditTime: 2026-01-22 11:45:46
* @FilePath: /git/xyxBooking-weapp/src/pages/search/index.vue
* @Description: 搜索页
-->
<template>
......@@ -36,7 +36,7 @@
</view>
</view>
<view v-else>
<qrCodeSearch :id="id_number" />
<qrCodeSearch :id="id_number" :id_type="id_type" />
</view>
</view>
<view class="logo"></view>
......