修改生活缴费页面、扫码功能、车位参数

This commit is contained in:
zhouyanli
2026-06-16 17:18:12 +08:00
parent bea0077272
commit c363c90f95
6 changed files with 92 additions and 34 deletions

View File

@@ -27,26 +27,33 @@
</view>
</view>
<!-- 已缴/费列表 -->
<view class="bill-list" v-if="detailslist.length != 0">
<view class="bill-item" @click="goToBill(item)" v-for="item,index in detailslist" :key="index">
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/property.png"
v-if="item.type=='0'"></image>
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/parkingIcon.png"
v-if="item.type=='1'"></image>
<!-- 物业费/车位/垃圾处理费列表 -->
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onLoadMore" v-if="detailslist.length != 0">
<view class="bill-list">
<view class="bill-item" @click="goToBill(item)" v-for="item,index in detailslist" :key="index">
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/property.png"
v-if="item.type=='0'"></image>
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/parkingIcon.png"
v-if="item.type=='1'"></image>
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/垃圾处理2x.png"
v-if="item.type=='2'"></image>
<view class="bill-info">
<view class="bill-title">{{switchStatus(item.type)}}
<view class="bill-status debt" v-if="item.balance<0">已欠费</view>
<view class="bill-info">
<view class="bill-title">{{switchStatus(item.type)}}
<view class="bill-status debt" v-if="item.payStatus === '0'">未缴纳</view>
</view>
<view class="bill-desc">{{item.name}}</view>
</view>
<!-- <view class="bill-desc">{{item.villageName+item.buildingName+item.fullAddress}}</view> -->
<view class="bill-desc">{{item.name}}</view>
<view class="arrow"></view>
</view>
<!-- 滚动加载状态 -->
<view class="load-more-status" v-if="loadingMore">
<text class="loading-text">加载中...</text>
</view>
<view class="load-more-status" v-else-if="!hasMore && detailslist.length >= pageSize">
<text class="no-more-text"> 没有更多了 </text>
</view>
<view class="arrow"></view>
</view>
</view>
</scroll-view>
<!-- 新增缴费区域 -->
<view class="add-section">
@@ -106,8 +113,12 @@
} from '/pageSubPack/api/apiSub.js'
// 响应式数据
const statusBarHeight = ref(20)
// const subscribeAuth = ref(uni.getStorageSync('subscribeAuth') || '')
const detailslist = ref([])
const pageNum = ref(1)
const pageSize = ref(3)
const total = ref(0)
const hasMore = ref(true)
const loadingMore = ref(false)
const paymentList = ref([
// {
// id: 1,
@@ -164,6 +175,8 @@
// iconClass: "parking"
// }
])
const postOpenId = async () => {
// App 端直接从本地存储获取 openid
@@ -279,18 +292,40 @@
}
const detailslist = ref([])
const getBillDetails = ()=>{
// 获取缴费列表
const getBillDetails = (isLoadMore = false) => {
if (isLoadMore) {
if (!hasMore.value || loadingMore.value) return
pageNum.value++
loadingMore.value = true
} else {
pageNum.value = 1
hasMore.value = true
}
getTopUpDetails({
userId:uni.getStorageSync('userId'),
villageId:uni.getStorageSync('currentVillageId'),
}).then(res=>{
// console.log(res)
detailslist.value = res.data;
userId: uni.getStorageSync('userId'),
villageId: uni.getStorageSync('currentVillageId'),
pageNum: pageNum.value,
pageSize: pageSize.value,
}).then(res => {
if (isLoadMore) {
detailslist.value = [...detailslist.value, ...(res.rows || [])]
loadingMore.value = false
} else {
detailslist.value = res.rows || []
}
total.value = res.total || 0
hasMore.value = detailslist.value.length < total.value
}).catch(() => {
if (isLoadMore) {
pageNum.value--
loadingMore.value = false
}
})
}
const onLoadMore = () => {
getBillDetails(true)
}
const switchStatus = (type) => {
const typeMap = {
'0': '物业费',
@@ -515,4 +550,26 @@
width: 100vw;
height: 46px;
}
.details-scroll {
max-height: 500rpx;
margin-bottom: 40rpx;
}
.load-more-status {
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx 0;
}
.loading-text {
font-size: 26rpx;
color: #999;
}
.no-more-text {
font-size: 26rpx;
color: #ccc;
}
</style>