调试水电费支付

This commit is contained in:
zhouyanli
2026-09-08 11:39:26 +08:00
parent 4fd383bce4
commit 72c968cb39
5 changed files with 38 additions and 20 deletions

View File

@@ -257,7 +257,6 @@ const getMyActivityListData = async (pageNum = 1) => {
pageSize: pageSize.value,
villageId:uni.getStorageSync('currentVillageId')
}
// status 为空时不传,返回全部
if (myFilter.value !== '') {
params.status = myFilter.value
}
@@ -388,7 +387,6 @@ onShow(() => {
* 页面加载时监听刷新事件(来自详情页)
*/
onLoad(() => {
// 监听详情页报名/取消报名后的刷新通知
uni.$on('refreshActivityList', (data) => {
getActivityListData(1)
})
@@ -434,14 +432,11 @@ watch(() => myFilter.value, () => {
padding: 0;
}
/* 滚动区域 */
.scroll-container {
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
}
/* 顶部图片 */
.top-img {
width: 100%;
height: 280rpx;

View File

@@ -157,6 +157,11 @@ export const getTopUpDetailsByMonth = (data) => {
return post(`/api/topUp/billDetails/listByMonth`, data)
}
// 水电表余额查询
export const getSelectByDeviceCode = (data) => {
return post('/api/topUp/selectByDeviceCode', data)
}

View File

@@ -29,15 +29,15 @@
<view class="info-item">
<text class="info-label">户号</text>
<text class="info-value">{{ paymentItem.deviceCode || '-' }}</text>
<text class="info-value">{{ paymentItem.deviceCode}}</text>
</view>
<view class="info-item">
<text class="info-label">户主</text>
<text class="info-value">{{ paymentItem.name || '-' }}</text>
<text class="info-value">{{ paymentItem.name}}</text>
</view>
<view class="info-item">
<text class="info-label">地址</text>
<text class="info-value">{{ paymentItem.fullAddress || '-' }}</text>
<text class="info-value">{{ paymentItem.fullAddress}}</text>
</view>
<!-- <view style="border-bottom: 2rpx solid #c7c7c7;padding-bottom:20rpx;"></view> -->
<!-- 缴费金额输入 -->
@@ -107,6 +107,7 @@
onShow,
onLoad
} from '@dcloudio/uni-app'
import {getSelectByDeviceCode} from '@/pageSubPack/api/apiSub.js'
// 响应式数据
@@ -122,7 +123,9 @@
initPaymentData()
})
onShow(() => {})
onShow(() => {
getBalance()
})
// 初始化缴费数据
const initPaymentData = () => {
@@ -133,6 +136,25 @@
}
}
// 查询单条余额(水电费通用),从小程序返回后刷新
const getBalance = () => {
if (!paymentItem.deviceCode) return
const deviceTypeMap = { '电费': '1', '水费': '2' }
getSelectByDeviceCode({
deviceCode: paymentItem.deviceCode,
type: deviceTypeMap[paymentItem.type]
}).then(res => {
const data = res.data
if (data && data.balance !== undefined && data.balance !== null) {
arrearsAmount.value = Math.abs(data.balance || 0).toFixed(2)
payAmount.value = Math.abs(data.balance || 0)
outstandingPayment.value = data.balance < 0
}
}).catch(err => {
console.log('查询余额失败', err)
})
}
// 返回
const goBack = () => {
@@ -218,9 +240,7 @@
// 返回缴费列表
const handleBackToList = () => {
uni.redirectTo({
url: '/pageSubPack/payment-list/paymentIndex'
});
uni.navigateBack();
}
// 类型码转中文名展示

View File

@@ -97,7 +97,6 @@ onShow(() => {
isFirstShow.value = false
return
}
// 返回列表时刷新(例如从支付小程序返回后)
fetchBills()
})

View File

@@ -26,7 +26,7 @@
<view class="bill-status debt" v-if="item.balance<0">已欠费</view>
<text :class="item.balance<0 ? 'balance-debt' : 'balance-normal'">(余额:{{item.balance|| 0.00}}元)</text>
</view>
<view class="bill-desc">{{item.villageName+item.buildingName+item.fullAddress}}</view>
<view class="bill-desc">{{item.villageName+'-'+item.buildingName+'-'+item.fullAddress}}</view>
</view>
<view class="arrow"></view>
@@ -197,12 +197,12 @@ const navigateToSelectHome = () => {
onShow(() => {
getCurrentCommunityData()
getBillDetails()
getPayList()
})
onLoad(() => {
uni.hideTabBar({ animation: false });
uni.$on('confirmPayment', slelctHomeData)
getPayList()
})
onUnload(() => {
@@ -414,11 +414,10 @@ page {
.container {}
.bill-list {
margin-bottom: 40rpx;
margin-bottom: 10rpx;
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
min-height: 550rpx;
box-sizing: border-box;
}
@@ -498,12 +497,12 @@ page {
}
.details-scroll {
height: 550rpx;
max-height: 550rpx;
padding: 0 0 20rpx 0;
}
.details-scroll-bill{
height: 550rpx;
padding: 0 0 40rpx 0;
max-height: 550rpx;
padding: 0 0 20rpx 0;
}
.load-more-status {