From c740126617ae1336958463ec17fcd3d7fc66fd1c Mon Sep 17 00:00:00 2001 From: wangyuxin <2695255229@qq.com> Date: Mon, 1 Jun 2026 11:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E8=B4=B9=E7=BC=B4=E8=B4=B9=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pageSubPack/api/apiSub.js | 37 ++ .../pageSubPack/my/addParkingSpace.vue | 24 +- .../pageSubPack/my/myCarIndex.vue | 32 +- .../pageSubPack/my/myHouseIndex.vue | 35 +- .../pageSubPack/my/myParkingSpaceIndex.vue | 33 +- .../pageSubPack/my/selectParingLot.vue | 4 +- .../payment-list/addHydropower.vue | 89 ++-- .../pageSubPack/payment-list/addPayment.vue | 6 +- .../payment-list/addPaymentSuccess.vue | 4 +- .../payment-list/arrearsPayment.vue | 397 ++++++++++-------- .../payment-list/noArrearsPayment.vue | 99 +++-- .../pageSubPack/payment-list/paymentIndex.vue | 263 ++++++++---- .../payment-list/paymentRecord.vue | 245 +++++------ .../payment-list/selectPaymentEntity.vue | 4 +- 14 files changed, 717 insertions(+), 555 deletions(-) diff --git a/property-uniapp-project/pageSubPack/api/apiSub.js b/property-uniapp-project/pageSubPack/api/apiSub.js index c8fdad2..382909a 100644 --- a/property-uniapp-project/pageSubPack/api/apiSub.js +++ b/property-uniapp-project/pageSubPack/api/apiSub.js @@ -128,6 +128,43 @@ export const getManagePhoneData = (data) => { export const uploadFileUploadImage = (data) => { return post(`/api/resident/file/uploadImage`, data) } + +// 水电表 +export const getTopUpSelectByResident = (data) => { + console.log(data); + return get(`/api/topUp/selectByResident/${data.residentUserId}`, data) +} +// 绑定设备 +export const getTopUpBindDevice = (data) => { + return post(`/api/topUp/bindDevice/${data.deviceCode}/${data.residentUserId}/${data.openid}/${data.deviceType}`, + data) +} +// 充值调用 +// /${data.rechargeAmount}/${data.type}/${data.deviceCode} +export const getTopUp = (data) => { + return post(`/api/topUp`, data) +} +export const getopenIdByCode = (data) => { + return get(`/api/topUp/getOpenIdByCode?code=${data.code}`, data) +} + +// 微信支付调用 +export const getToWxPay = (data) => { + return post(`/api/topUp/wxPay/${data.orderId}/${data.openid}`, data) +} +// 缴费记录查询 +export const getTopupRecordWithStat = (data) => { + return get( + `/api/topUp/topupRecordWithStat?residentUserId=${data.residentUserId}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`, + data) +} +export const postInsertOpenId = (data) => { + return post(`/api/resident/auth/insertOpenId`, data) +} +export const postSubscribeAuth = (data) => { + return post(`/api/wx/subscribeAuth/auth`, data) +} + // 添加车辆 export const postCar = (data) => { return post(`/api/resident/car`, data) diff --git a/property-uniapp-project/pageSubPack/my/addParkingSpace.vue b/property-uniapp-project/pageSubPack/my/addParkingSpace.vue index 2dd8425..ebea526 100644 --- a/property-uniapp-project/pageSubPack/my/addParkingSpace.vue +++ b/property-uniapp-project/pageSubPack/my/addParkingSpace.vue @@ -181,6 +181,7 @@ residentId: uni.getStorageSync('userId') }).then(res => { uni.hideLoading() + console.log(res); if (res.code === 200) { uni.showToast({ title: '提交成功', @@ -195,10 +196,17 @@ icon: 'none' }) } + }).catch(err => { + uni.hideLoading() + uni.showToast({ + title: err.msg || '网络异常', + icon: 'none' + }) }) } } }) + } const loadParkingSpaceDetail = async () => { // 防重复请求 @@ -225,14 +233,14 @@ formData.value.parkingStatus = data.parkingStatus, uni.setStorageSync('parkingStatus', data.parkingStatus) - - formData.value.bindCar = data.carNum - uni.setStorageSync('bindCarName', data.carNum) - - - formData.value.bindCarId = data.carId - uni.setStorageSync('bindCarId', data.carId) - + + formData.value.bindCar = data.carNum + uni.setStorageSync('bindCarName', data.carNum) + + + formData.value.bindCarId = data.carId + uni.setStorageSync('bindCarId', data.carId) + } catch (err) { diff --git a/property-uniapp-project/pageSubPack/my/myCarIndex.vue b/property-uniapp-project/pageSubPack/my/myCarIndex.vue index f4f2c4e..ef8bb59 100644 --- a/property-uniapp-project/pageSubPack/my/myCarIndex.vue +++ b/property-uniapp-project/pageSubPack/my/myCarIndex.vue @@ -4,7 +4,7 @@ - + 暂无数据 @@ -40,36 +40,25 @@ import { getMyCarList } from '@/pageSubPack/api/apiSub.js' - import { - onReachBottom, - onPullDownRefresh - } from '@dcloudio/uni-app' const statusBarHeight = ref(20) const defaultCarImg = "http://47.104.199.163:9090/images/propertyImgs/defaultCarImg.png" const carList = ref([]) const loadingMore = ref(false) const noMoreData = ref(false) + const isRefreshing = ref(false) const pageNum = ref(1) const pageSize = ref(10) - // ==================== 上拉加载更多(页面生命周期) ==================== - onReachBottom(() => { - getList() - }) // ==================== 下拉刷新 ==================== - const refresh = () => { - // 重置所有状态 - pageNum = 1 - pageSize = 10 - noMoreData = false - houseList = [] - loadingMore = false + const onRefresh = () => { + isRefreshing.value = true + pageNum.value = 1 + noMoreData.value = false + carList.value = [] + loadingMore.value = false getList() } - onPullDownRefresh(() => { - refresh() - }) // 页面加载时请求第一页 onMounted(() => { @@ -110,7 +99,10 @@ console.error('列表接口报错:', err) } finally { loadingMore.value = false - uni.stopPullDownRefresh() // 关闭下拉刷新 + // 关闭 refresher 下拉刷新状态 + if (isRefreshing.value) { + isRefreshing.value = false + } } } diff --git a/property-uniapp-project/pageSubPack/my/myHouseIndex.vue b/property-uniapp-project/pageSubPack/my/myHouseIndex.vue index be92da6..fde07e2 100644 --- a/property-uniapp-project/pageSubPack/my/myHouseIndex.vue +++ b/property-uniapp-project/pageSubPack/my/myHouseIndex.vue @@ -5,7 +5,7 @@ - + @@ -48,8 +48,6 @@ - @@ -70,10 +68,6 @@ onMounted, } from 'vue' - import { - onReachBottom, - onPullDownRefresh - } from '@dcloudio/uni-app' import { getMyHouseList, setMyHouseDefault @@ -83,6 +77,7 @@ const houseList = ref([]) const loadingMore = ref(false) const noMoreData = ref(false) + const isRefreshing = ref(false) const pageNum = ref(1) const pageSize = ref(10) @@ -123,28 +118,22 @@ console.error('列表接口报错:', err) } finally { loadingMore.value = false - uni.stopPullDownRefresh() // 关闭下拉刷新 + // 关闭 refresher 下拉刷新状态 + if (isRefreshing.value) { + isRefreshing.value = false + } } } - // ==================== 上拉加载更多(页面生命周期) ==================== - onReachBottom(() => { - getList() - }) - // ==================== 下拉刷新 ==================== - const refresh = () => { - // 重置所有状态 - pageNum = 1 - pageSize = 10 - noMoreData = false - houseList = [] - loadingMore = false + const onRefresh = () => { + isRefreshing.value = true + pageNum.value = 1 + noMoreData.value = false + houseList.value = [] + loadingMore.value = false getList() } - onPullDownRefresh(() => { - refresh() - }) // 页面加载时请求第一页 onMounted(() => { diff --git a/property-uniapp-project/pageSubPack/my/myParkingSpaceIndex.vue b/property-uniapp-project/pageSubPack/my/myParkingSpaceIndex.vue index e37935f..dd4698a 100644 --- a/property-uniapp-project/pageSubPack/my/myParkingSpaceIndex.vue +++ b/property-uniapp-project/pageSubPack/my/myParkingSpaceIndex.vue @@ -3,7 +3,7 @@ - + 暂无数据 @@ -69,32 +69,19 @@ import { getCarList } from '@/pageSubPack/api/apiSub.js' - import { - onReachBottom, - onPullDownRefresh - } from '@dcloudio/uni-app' const statusBarHeight = ref(20) const parkingSpaceList = ref([]) - // ==================== 上拉加载更多(页面生命周期) ==================== - onReachBottom(() => { - getList() - }) - // ==================== 下拉刷新 ==================== - const refresh = () => { - // 重置所有状态 - pageNum = 1 - pageSize = 10 - noMoreData = false - parkingSpaceList = [] - loadingMore = false + const onRefresh = () => { + isRefreshing.value = true + pageNum.value = 1 + noMoreData.value = false + parkingSpaceList.value = [] + loadingMore.value = false getList() } - onPullDownRefresh(() => { - refresh() - }) // 页面加载时请求第一页 onMounted(() => { @@ -103,6 +90,7 @@ const loadingMore = ref(false) const noMoreData = ref(false) + const isRefreshing = ref(false) const pageNum = ref(1) const pageSize = ref(10) @@ -142,7 +130,10 @@ console.error('列表接口报错:', err) } finally { loadingMore.value = false - uni.stopPullDownRefresh() // 关闭下拉刷新 + // 关闭 refresher 下拉刷新状态 + if (isRefreshing.value) { + isRefreshing.value = false + } } } diff --git a/property-uniapp-project/pageSubPack/my/selectParingLot.vue b/property-uniapp-project/pageSubPack/my/selectParingLot.vue index a585ae3..33b3017 100644 --- a/property-uniapp-project/pageSubPack/my/selectParingLot.vue +++ b/property-uniapp-project/pageSubPack/my/selectParingLot.vue @@ -72,7 +72,8 @@ let parkingLotId = uni.getStorageSync('parkingLotId') if (!parkingLotId) return getResidentCarAreaManageParkingListByAreaId({ - areaId: parkingLotId + areaId: parkingLotId, + }).then(res => { if (res.code === 200) { dataList.value = (res.rows || []).map(item => { @@ -92,6 +93,7 @@ } const selectedParking = (item) => { + console.log(item); if (checkType.value == '停车场') { selectedParkingLot.value = item.id } else if (checkType.value == '车位编号') { diff --git a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue index 6400321..e5456ef 100644 --- a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue +++ b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue @@ -7,18 +7,18 @@ - + + :src="paymentType=='物业费A'?'https://wuyeadmin.bugtc.com/images/propertyImgs/water.png':'https://wuyeadmin.bugtc.com/images/propertyImgs/electric.png'"> - {{paymentType+'费'}} + {{paymentType}} 缴费单位 - XXXXXXXX燃气有限公司 + 花开物业 @@ -31,7 +31,7 @@ v-model="deviceNo" /> + src="https://wuyeadmin.bugtc.com/images/propertyImgs/scanTheCodeIcon.png" @click="scanCode"> @@ -89,20 +89,18 @@ onPullDownRefresh } from '@dcloudio/uni-app' + import { + getTopUpBindDevice, + getopenIdByCode + } from '/pageSubPack/api/apiSub.js' + // 响应式数据 const paymentType = ref(uni.getStorageSync('addPaymentType')) const deviceNo = ref('') const isAgree = ref(false) - const scanResult = ref('') - // 生命周期 onMounted(() => {}) - // 协议勾选 - const handleAgreeChange = (e) => { - isAgree.value = e.detail.value.length > 0 - } - // 扫码 const scanCode = async () => { try { @@ -118,7 +116,6 @@ // 扫码成功,赋值 deviceNo.value = res.result - scanResult.value = res.result uni.hideLoading() uni.showToast({ title: '扫码成功', @@ -135,7 +132,7 @@ } // 提交缴费 - const goPay = () => { + const goPay = async () => { if (!deviceNo.value) { uni.showToast({ title: '请输入设备号', @@ -143,42 +140,70 @@ }) return } - // if (!isAgree.value) { - // uni.showToast({ - // title: '请同意协议', - // icon: 'none' - // }) - // return - // } uni.showModal({ title: '确认提交', content: '确认要提交吗?', - success: (res) => { + success: async (res) => { if (res.confirm) { uni.showLoading({ title: '提交中...', mask: true }) - setTimeout(() => { + try { + // // 获取 openid + // const loginRes = await wx.login() + // if (!loginRes.code) { + // uni.hideLoading() + // uni.showToast({ + // title: '登录失败', + // icon: 'none' + // }) + // return + // } + // // 用 code 换 openid + // const openIdRes = await getopenIdByCode({ + // code: loginRes.code + // }) + // if (openIdRes.code !== 200 || !openIdRes.data) { + // uni.hideLoading() + // uni.showToast({ + // title: '获取openid失败', + // icon: 'none' + // }) + // return + // } + const openid = uni.getStorageSync('openid') + await getTopUpBindDevice({ + deviceType: paymentType.value=='物业费A'?'2':'1', + deviceCode: deviceNo.value, + openid: openid, + residentUserId: uni.getStorageSync('userId') + }) + uni.hideLoading() uni.showToast({ title: '提交成功', icon: 'success' }) - }, 1000) - - setTimeout(() => { + setTimeout(() => { + goNext() + }, 1500) + } catch (err) { uni.hideLoading() - goNext() - }, 2500) + uni.showToast({ + title: `${err}`, + icon: 'none' + }) + console.error('绑定设备失败:', err) + } } } }) } - const handleProtocol = () => { - } + + // 跳转成功页 const goNext = () => { uni.redirectTo({ @@ -223,7 +248,7 @@ padding: 32rpx; } - /* 头部水费标题 */ + /* 头部物业费A标题 */ .card-header { display: flex; align-items: center; @@ -350,7 +375,7 @@ padding: 32rpx; } - /* 头部水费标题 */ + /* 头部物业费A标题 */ .card-header { display: flex; align-items: center; diff --git a/property-uniapp-project/pageSubPack/payment-list/addPayment.vue b/property-uniapp-project/pageSubPack/payment-list/addPayment.vue index 97553fc..9d85cf7 100644 --- a/property-uniapp-project/pageSubPack/payment-list/addPayment.vue +++ b/property-uniapp-project/pageSubPack/payment-list/addPayment.vue @@ -13,7 +13,7 @@ + :src="paymentType=='燃气'?'https://wuyeadmin.bugtc.com/images/propertyImgs/gas.png':'https://wuyeadmin.bugtc.com/images/propertyImgs/heating.png'"> > {{paymentType+'费'}} @@ -187,9 +187,7 @@ // 返回 const goBack = () => { - uni.redirectTo({ - url: '/pageSubPack/payment-list/paymentIndex' - }) + uni.redirectTo({ url: '/pageSubPack/payment-list/paymentIndex' }); }