增加loading
This commit is contained in:
parent
e770311461
commit
dd084fd0cc
|
|
@ -155,8 +155,10 @@ const onCodeSearch = () => {
|
||||||
const getCodeDeviceInfoData = async () => {
|
const getCodeDeviceInfoData = async () => {
|
||||||
console.log(queryCodeParams.value)
|
console.log(queryCodeParams.value)
|
||||||
// const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
// const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
getDeviceListAPI({'maCode': queryCodeParams.value.maCode}).then(response => {
|
getDeviceListAPI({'maCode': queryCodeParams.value.maCode}).then(response => {
|
||||||
console.log("xxxxxxxxxxx",response)
|
console.log("xxxxxxxxxxx",response)
|
||||||
|
uni.hideLoading()
|
||||||
if (response.data && response.data.length !== 0) {
|
if (response.data && response.data.length !== 0) {
|
||||||
optionList.value = response.data.map(option => ({
|
optionList.value = response.data.map(option => ({
|
||||||
value: option.maId,
|
value: option.maId,
|
||||||
|
|
@ -172,6 +174,9 @@ const getCodeDeviceInfoData = async () => {
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("获取设备信息失败", error)
|
||||||
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@ onShow(() => {
|
||||||
// 扫码识别按钮点击事件
|
// 扫码识别按钮点击事件
|
||||||
const scanStart = () => {
|
const scanStart = () => {
|
||||||
qrCodeScan.value = ''
|
qrCodeScan.value = ''
|
||||||
|
codeData.value = {}
|
||||||
if (scanQrCodeRef.value) {
|
if (scanQrCodeRef.value) {
|
||||||
scanQrCodeRef.value.scanQrCode()
|
scanQrCodeRef.value.scanQrCode()
|
||||||
}
|
}
|
||||||
|
|
@ -166,6 +167,8 @@ const handleScanError = (error) => {
|
||||||
|
|
||||||
//查看是否是该规格型号
|
//查看是否是该规格型号
|
||||||
const getMaInfoScan = async () => {
|
const getMaInfoScan = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
let param = {
|
let param = {
|
||||||
qrCode: qrCodeScan.value,
|
qrCode: qrCodeScan.value,
|
||||||
}
|
}
|
||||||
|
|
@ -181,6 +184,11 @@ const getMaInfoScan = async () => {
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res.data.msg, icon: 'none' })
|
uni.showToast({ title: res.data.msg, icon: 'none' })
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getMaInfoScan ~ error:', error)
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue