diff --git a/property-uniapp-project/pageSubPack/activity-list/activityList.vue b/property-uniapp-project/pageSubPack/activity-list/activityList.vue index 7db8f68..a00d642 100644 --- a/property-uniapp-project/pageSubPack/activity-list/activityList.vue +++ b/property-uniapp-project/pageSubPack/activity-list/activityList.vue @@ -130,7 +130,7 @@ import { getActivityList,getMyActivityList} from '../api/api.js' // ===================== 响应式数据 ===================== const activeTab = ref('list') // 'list' 或 'my' -const myFilter = ref('') // 我的活动筛选条件:''审核中, '0'未开始, '1'进行中, '2'已结束 +const myFilter = ref('') // 我的活动筛选条件:''全部, '0'未开始, '1'进行中, '2'已结束 const isLoading = ref(false) const hasMoreData = ref(true) const currentPage = ref(1) @@ -241,7 +241,7 @@ const getActivityListData = async (pageNum = 1) => { if (pageNum === 1) displayedActivities.value = [] } } catch (err) { - uni.showToast({ title: "网络异常", icon: 'none' }) + uni.showToast({ title: err.msg || "网络异常", icon: 'none' }) if (pageNum === 1) displayedActivities.value = [] } finally { isLoading.value = false @@ -285,7 +285,7 @@ const getMyActivityListData = async (pageNum = 1) => { if (pageNum === 1) displayedActivities.value = [] } } catch (err) { - uni.showToast({ title: '网络异常', icon: 'none' }) + uni.showToast({ title: err.msg || '网络异常', icon: 'none' }) if (pageNum === 1) displayedActivities.value = [] } finally { isLoading.value = false diff --git a/property-uniapp-project/pageSubPack/my/addCar.vue b/property-uniapp-project/pageSubPack/my/addCar.vue index ad447fe..1dce18d 100644 --- a/property-uniapp-project/pageSubPack/my/addCar.vue +++ b/property-uniapp-project/pageSubPack/my/addCar.vue @@ -137,7 +137,7 @@ } catch (err) { uni.showToast({ - title: `${err}`, + title: err.msg || '网络异常', icon: 'none' }) console.error('列表接口报错:', err) @@ -237,8 +237,8 @@ carModel: formData.value.carModel, carColor: formData.value.carColor, carImageUrl: imageUrl, - villageId:uni.getStorageSync('currentVillageId') - // residentId: uni.getStorageSync('userId') + // villageId:uni.getStorageSync('currentVillageId') + residentId: uni.getStorageSync('userId') } diff --git a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue index b5f8972..19e0f93 100644 --- a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue +++ b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue @@ -102,33 +102,35 @@ onMounted(() => {}) // 扫码 - const scanCode = async () => { - try { - uni.showLoading({ - title: '扫码中...', - mask: true - }) + const scanCode = () => { + // uni.showLoading({ + // title: '扫码中...', + // mask: true + // }) - const res = await uni.scanCode({ - onlyFromCamera: false, - scanType: ['qrCode', 'barCode'] - }) - - // 扫码成功,赋值 - deviceNo.value = res.result - uni.hideLoading() - uni.showToast({ - title: '扫码成功', - icon: 'success' - }) - } catch (err) { - uni.hideLoading() - console.log('扫码失败', err) - uni.showToast({ - title: '扫码取消/失败', - icon: 'none' - }) - } + uni.scanCode({ + onlyFromCamera: false, + scanType: ['qrCode', 'barCode'], + success: (res) => { + // uni.hideLoading() + console.log('扫码成功', res) + // 过滤模拟器/调试模式返回的 mock 数据 + if (!res.result || res.result.toUpperCase() === 'TEST') { + uni.showToast({ title: '扫码识别失败,请手动输入设备号', icon: 'none' }) + return + } + deviceNo.value = res.result + uni.showToast({ title: '扫码成功', icon: 'success' }) + }, + fail: (err) => { + // uni.hideLoading() + console.log('扫码失败', err) + uni.showToast({ title: '扫码取消/失败', icon: 'none' }) + }, + complete: () => { + // uni.hideLoading() + } + }) } // 提交缴费 diff --git a/property-uniapp-project/pageSubPack/payment-list/arrearsPayment.vue b/property-uniapp-project/pageSubPack/payment-list/arrearsPayment.vue index e2e1cf7..1db9aa2 100644 --- a/property-uniapp-project/pageSubPack/payment-list/arrearsPayment.vue +++ b/property-uniapp-project/pageSubPack/payment-list/arrearsPayment.vue @@ -1,7 +1,7 @@