修改生活缴费功能
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"name" : "花开物业",
|
"name" : "花开物业",
|
||||||
"appid" : "__UNI__29C3D60",
|
"appid" : "__UNI__29C3D60",
|
||||||
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
||||||
"versionName" : "1.0.7",
|
"versionName" : "1.0.9",
|
||||||
"versionCode" : 120,
|
"versionCode" : 122,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"uniCloud" : {
|
"uniCloud" : {
|
||||||
"provider" : "aliyun",
|
"provider" : "aliyun",
|
||||||
|
|||||||
@@ -147,12 +147,16 @@ export const getTopUpSelectByResident = (data) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Zy -------------
|
|
||||||
// 账单明细列表
|
// 账单明细列表
|
||||||
export const getTopUpDetails = (data) => {
|
export const getTopUpDetails = (data) => {
|
||||||
return post(`/api/topUp/billDetails/list`, data)
|
return post(`/api/topUp/billDetails/list`, data)
|
||||||
}
|
}
|
||||||
// Zy --------------
|
// 账单按月汇总
|
||||||
|
export const getTopUpDetailsByMonth = (data) => {
|
||||||
|
return post(`/api/topUp/billDetails/listByMonth`, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,10 +73,12 @@
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const detail = ref(null)
|
const detail = ref(null)
|
||||||
let recordId = ''
|
let recordId = ''
|
||||||
|
let queryDate = ''
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
recordId = options.id
|
recordId = options.id
|
||||||
|
queryDate = options.date || ''
|
||||||
fetchDetail()
|
fetchDetail()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -86,7 +88,7 @@
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
detail.value = null
|
detail.value = null
|
||||||
try {
|
try {
|
||||||
const res = await inspectionDetails({ id: recordId })
|
const res = await inspectionDetails({ id: recordId, date: queryDate })
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
detail.value = res.data
|
detail.value = res.data
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
// ---------- 跳转详情 ----------
|
// ---------- 跳转详情 ----------
|
||||||
const goToInspectionDetail = (item) => {
|
const goToInspectionDetail = (item) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageSubPack/inspection-revenue/inspection-details?id=${item.id}`
|
url: `/pageSubPack/inspection-revenue/inspection-details?id=${item.id}&date=${datetime.value}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -290,9 +290,11 @@
|
|||||||
uni.showLoading({ title: '退出中...', mask: true })
|
uni.showLoading({ title: '退出中...', mask: true })
|
||||||
|
|
||||||
const clearAndGo = () => {
|
const clearAndGo = () => {
|
||||||
|
const uid = uni.getStorageSync('userId') || ''
|
||||||
uni.removeStorageSync('token')
|
uni.removeStorageSync('token')
|
||||||
uni.removeStorageSync('userId')
|
uni.removeStorageSync('userId')
|
||||||
uni.removeStorageSync('currentVillageId')
|
uni.removeStorageSync('currentVillageId')
|
||||||
|
uni.removeStorageSync('home_cache_' + uid)
|
||||||
uni.removeStorageSync('home_cache')
|
uni.removeStorageSync('home_cache')
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.hideToast()
|
uni.hideToast()
|
||||||
|
|||||||
447
property-uniapp-project/pageSubPack/payment-list/billPayment.vue
Normal file
447
property-uniapp-project/pageSubPack/payment-list/billPayment.vue
Normal file
@@ -0,0 +1,447 @@
|
|||||||
|
<template>
|
||||||
|
<view class="wrap">
|
||||||
|
<scroll-view class="page" scroll-y @scrolltolower="onLoadMore">
|
||||||
|
<view class="empty-state" v-if="!loading && billList.length === 0">
|
||||||
|
<text class="empty-text">暂无账单数据</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<up-collapse v-if="billList.length" :border="false">
|
||||||
|
<up-collapse-item
|
||||||
|
v-for="(item, index) in billList"
|
||||||
|
:key="index"
|
||||||
|
:name="String(index)"
|
||||||
|
>
|
||||||
|
<!-- 标题:勾选框 + 月份 -->
|
||||||
|
<template #title>
|
||||||
|
<view class="collapse-header">
|
||||||
|
<view class="check-circle" :class="{ checked: item.selected }" @click.stop="toggleSelect(index)">
|
||||||
|
<text v-if="item.selected" class="check-icon">✓</text>
|
||||||
|
</view>
|
||||||
|
<text class="month-text">{{ item.month }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<!-- 右侧金额 -->
|
||||||
|
<template #value>
|
||||||
|
<text class="price-text">¥{{ item.totalAmount }}</text>
|
||||||
|
</template>
|
||||||
|
<!-- 展开内容:每条明细 -->
|
||||||
|
<view class="collapse-body">
|
||||||
|
<view class="detail-row fee-row" v-for="(detail, di) in item.details" :key="di">
|
||||||
|
<text class="detail-label">{{ detail.name }}</text>
|
||||||
|
<text class="detail-value">¥{{ detail.amount }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="detail-row meta-row" v-if="item.unitNo || item.date">
|
||||||
|
<text class="detail-label">{{ item.unitNo }}</text>
|
||||||
|
<text class="detail-value">{{ item.date }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="detail-row meta-row">
|
||||||
|
<text class="detail-label">原金额:¥{{ item.totalAmount }}</text>
|
||||||
|
<text class="detail-value">优惠:¥{{ formatNum(item.discount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-collapse-item>
|
||||||
|
</up-collapse>
|
||||||
|
|
||||||
|
<!-- 加载状态 -->
|
||||||
|
<view class="load-more-status" v-if="loadingMore">
|
||||||
|
<text class="loading-text">加载中...</text>
|
||||||
|
</view>
|
||||||
|
<view class="load-more-status" v-else-if="!hasMore && billList.length >= pageSize">
|
||||||
|
<text class="no-more-text">— 没有更多了 —</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 底部操作栏 -->
|
||||||
|
<view class="bottom-bar" v-if="billList.length">
|
||||||
|
<view class="select-all" @click="toggleSelectAll">
|
||||||
|
<view class="check-circle" :class="{ checked: isAllSelected }">
|
||||||
|
<text v-if="isAllSelected" class="check-icon">✓</text>
|
||||||
|
</view>
|
||||||
|
<text class="select-all-text">全选</text>
|
||||||
|
</view>
|
||||||
|
<view class="total-box">
|
||||||
|
<text class="total-label">合计:</text>
|
||||||
|
<text class="total-price">¥{{ selectedTotal.toFixed(2) }}</text>
|
||||||
|
</view>
|
||||||
|
<button class="pay-btn" :disabled="!canPay" @click="handleBatchPay">立即缴费</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { getTopUpDetailsByMonth } from '/pageSubPack/api/apiSub.js'
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const billList = ref([])
|
||||||
|
const pageNum = ref(1)
|
||||||
|
const pageSize = ref(10)
|
||||||
|
const total = ref(0)
|
||||||
|
const hasMore = ref(true)
|
||||||
|
const loadingMore = ref(false)
|
||||||
|
|
||||||
|
// 从 paymentIndex 传来的数据中取 billResidentId
|
||||||
|
const cacheItem = uni.getStorageSync('arrearsPayment') || {}
|
||||||
|
const billResidentId = ref(cacheItem.billResidentId || cacheItem.id || '')
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
fetchBills()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 拉取按月汇总账单
|
||||||
|
const fetchBills = async (isLoadMore = false) => {
|
||||||
|
if (!billResidentId.value) return
|
||||||
|
if (isLoadMore) {
|
||||||
|
if (!hasMore.value || loadingMore.value) return
|
||||||
|
pageNum.value++
|
||||||
|
loadingMore.value = true
|
||||||
|
} else {
|
||||||
|
pageNum.value = 1
|
||||||
|
hasMore.value = true
|
||||||
|
loading.value = true
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getTopUpDetailsByMonth({
|
||||||
|
billResidentId: billResidentId.value,
|
||||||
|
villageId: uni.getStorageSync('currentVillageId') || '',
|
||||||
|
pageNum: pageNum.value,
|
||||||
|
pageSize: pageSize.value
|
||||||
|
})
|
||||||
|
const rows = res.rows || []
|
||||||
|
const typeNameMap = { '0': '物业管理服务费', '1': '车位管理费', '2': '生活垃圾处理费' }
|
||||||
|
const mapped = rows.map(r => {
|
||||||
|
const firstDetail = (r.details && r.details.length) ? r.details[0] : {}
|
||||||
|
const restDetails = (r.details || []).slice(1)
|
||||||
|
return {
|
||||||
|
month: r.month || '',
|
||||||
|
totalAmount: formatNum(r.totalAmount),
|
||||||
|
discount: 0,
|
||||||
|
selected: false,
|
||||||
|
periodDisplay: firstDetail.periodDisplay || '',
|
||||||
|
unitNo: cacheItem.unitNo || cacheItem.fullAddress || '',
|
||||||
|
date: r.month || '',
|
||||||
|
details: restDetails.map(d => ({
|
||||||
|
name: typeNameMap[d.type] || d.name || '缴费费用',
|
||||||
|
amount: formatNum(d.amount),
|
||||||
|
id: d.id,
|
||||||
|
payStatus: d.payStatus || '0'
|
||||||
|
})),
|
||||||
|
billIds: (r.details || []).map(d => d.id).filter(Boolean)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (isLoadMore) {
|
||||||
|
billList.value = [...billList.value, ...mapped]
|
||||||
|
} else {
|
||||||
|
billList.value = mapped
|
||||||
|
}
|
||||||
|
total.value = res.total || 0
|
||||||
|
hasMore.value = billList.value.length < total.value
|
||||||
|
} catch (e) {
|
||||||
|
if (isLoadMore) pageNum.value--
|
||||||
|
console.error('获取账单失败', e)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
loadingMore.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onLoadMore = () => {
|
||||||
|
fetchBills(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatNum = (val) => {
|
||||||
|
return (Number(val || 0)).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
const toggleSelect = (index) => {
|
||||||
|
const current = billList.value[index]
|
||||||
|
if (!current.selected) {
|
||||||
|
// 选中:检查前面所有项是否都已选中,不允许跳过
|
||||||
|
for (let i = 0; i < index; i++) {
|
||||||
|
if (!billList.value[i].selected) {
|
||||||
|
uni.showToast({ title: '请按顺序从第一个月开始选择', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
billList.value[index].selected = true
|
||||||
|
} else {
|
||||||
|
// 取消选中:同时取消该项及后面所有已选中的
|
||||||
|
for (let i = index; i < billList.value.length; i++) {
|
||||||
|
billList.value[i].selected = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const isAllSelected = computed(() =>
|
||||||
|
billList.value.length > 0 && billList.value.every(m => m.selected)
|
||||||
|
)
|
||||||
|
|
||||||
|
const toggleSelectAll = () => {
|
||||||
|
const val = !isAllSelected.value
|
||||||
|
billList.value.forEach(m => { m.selected = val })
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedTotal = computed(() =>
|
||||||
|
billList.value.filter(m => m.selected).reduce((sum, m) => sum + Number(m.totalAmount || 0), 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
const canPay = computed(() => {
|
||||||
|
const selected = billList.value.filter(m => m.selected)
|
||||||
|
if (!selected.length) return false
|
||||||
|
// 必须从第一个开始且连续
|
||||||
|
return billList.value[0].selected && selected.length > 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 批量缴费
|
||||||
|
const handleBatchPay = () => {
|
||||||
|
const selected = billList.value.filter(m => m.selected)
|
||||||
|
if (!selected.length) return
|
||||||
|
|
||||||
|
const allIds = selected.flatMap(m => m.billIds)
|
||||||
|
const token = uni.getStorageSync('token') || ''
|
||||||
|
const userId = uni.getStorageSync('userId') || ''
|
||||||
|
|
||||||
|
const query = [
|
||||||
|
['acct', userId],
|
||||||
|
['orderType', '10'],
|
||||||
|
['billId', allIds.join(',')],
|
||||||
|
['deviceType', '3'],
|
||||||
|
['residentUserId', userId],
|
||||||
|
['token', token]
|
||||||
|
].map(([k, v]) => encodeURIComponent(k) + '=' + encodeURIComponent(v)).join('&')
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
uni.showLoading({ title: '加载中...' })
|
||||||
|
plus.share.getServices((services) => {
|
||||||
|
const wx = services.find(s => s.id === 'weixin')
|
||||||
|
uni.hideLoading()
|
||||||
|
if (!wx) return uni.showToast({ title: '未检测到微信客户端', icon: 'none' })
|
||||||
|
if (!wx.launchMiniProgram) return uni.showToast({ title: '当前微信版本太低,不支持拉起小程序', icon: 'none' })
|
||||||
|
wx.launchMiniProgram({
|
||||||
|
id: 'gh_a765aef0172c',
|
||||||
|
type: 1,
|
||||||
|
path: 'pages/arrearsPayment/arrearsPayment?' + query,
|
||||||
|
}, (res) => {
|
||||||
|
console.log('小程序回调:', JSON.stringify(res))
|
||||||
|
}, (err) => {
|
||||||
|
console.error('拉起失败:', JSON.stringify(err))
|
||||||
|
uni.showToast({ title: '拉起支付小程序失败', icon: 'none' })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 140rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 200rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- 折叠面板 ---- */
|
||||||
|
::v-deep .u-collapse-item {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-collapse-item__content {
|
||||||
|
background: #F5FAFF;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-cell {
|
||||||
|
padding: 20rpx 18rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题区 */
|
||||||
|
.collapse-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-circle {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 3rpx solid #ddd;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-circle.checked {
|
||||||
|
background-color: #1677ff;
|
||||||
|
border-color: #1677ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-icon {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.month-text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 金额 */
|
||||||
|
.price-text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #FF8F40;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 展开内容 */
|
||||||
|
.collapse-body {
|
||||||
|
padding: 20rpx 24rpx 30rpx;
|
||||||
|
margin: 0 24rpx;
|
||||||
|
background: #F5FAFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 明细费用名 - 深色 */
|
||||||
|
.fee-row .detail-label,
|
||||||
|
.fee-row .detail-value {
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 日期/原金额/优惠 - 浅色 */
|
||||||
|
.meta-row .detail-label,
|
||||||
|
.meta-row .detail-value {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- 底部操作栏 ---- */
|
||||||
|
.bottom-bar {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 -2rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-all {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-all-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-box {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-label {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-price {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #FF8F40;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 180rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
line-height: 72rpx;
|
||||||
|
background-color: #1677ff;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-btn[disabled] {
|
||||||
|
background-color: #ccc;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,11 +3,19 @@
|
|||||||
<view class="topbox">
|
<view class="topbox">
|
||||||
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
|
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
|
||||||
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
|
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
|
||||||
|
<!-- 小区选择 -->
|
||||||
|
<view class="community-bar" @click="navigateToSelectHome">
|
||||||
|
<image src="https://wuyeadmin.bugtc.com/images/home/adress.png" class="location-icon"></image>
|
||||||
|
<text class="community-name">{{ currentCommunity }}</text>
|
||||||
|
<u-icon name="arrow-down-fill" size="14" color="#222222"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y="true">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 已缴费/欠费列表 -->
|
<!-- 水/电费列表 -->
|
||||||
<view class="bill-list" v-if="paymentList.length != 0">
|
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onPayLoadMore">
|
||||||
|
<view class="bill-list">
|
||||||
|
<template v-if="paymentList.length != 0">
|
||||||
<view class="bill-item" @click="goToBill(item)" v-for="item,index in paymentList" :key="index">
|
<view class="bill-item" @click="goToBill(item)" v-for="item,index in paymentList" :key="index">
|
||||||
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/water.png"
|
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/water.png"
|
||||||
v-if="item.type=='水费'"></image>
|
v-if="item.type=='水费'"></image>
|
||||||
@@ -23,23 +31,33 @@
|
|||||||
|
|
||||||
<view class="arrow"></view>
|
<view class="arrow"></view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 滚动加载状态 -->
|
||||||
|
<view class="load-more-status" v-if="payLoadingMore">
|
||||||
|
<text class="loading-text">加载中...</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="load-more-status" v-else-if="!payHasMore && paymentList.length >= payPageSize">
|
||||||
<!-- 物业费/车位费/垃圾处理费列表 -->
|
<text class="no-more-text">— 没有更多了 —</text>
|
||||||
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onLoadMore" v-if="detailslist.length != 0">
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="empty-state" v-else>
|
||||||
|
<text class="empty-text">暂无数据</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<!-- 物业费/垃圾处理费列表 -->
|
||||||
|
<!-- 物业费/垃圾处理费列表 -->
|
||||||
|
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onLoadMore">
|
||||||
<view class="bill-list">
|
<view class="bill-list">
|
||||||
<view class="bill-item" @click="goToBill(item)" v-for="item,index in detailslist" :key="index">
|
<template v-if="detailslist.length != 0">
|
||||||
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/property.png"
|
<view class="bill-item" :class="{ 'bill-paid': !item.amount }" @click="!item.amount ? null : goToBill(item)" v-for="item,index in detailslist" :key="index">
|
||||||
v-if="item.type=='0'"></image>
|
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/property.png"></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-info">
|
||||||
<view class="bill-title">{{switchStatus(item.type)}}
|
<view class="bill-title">{{ item.name }}
|
||||||
<view class="bill-status debt" v-if="item.payStatus === '0'">未缴纳</view>
|
<view class="bill-status debt" v-if="item.amount">未缴纳</view>
|
||||||
|
<view class="bill-status done" v-if="!item.amount">已完成</view>
|
||||||
|
<!-- <view class="bill-amount">({{item.amount}})</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="bill-desc">{{item.name}}</view>
|
<view class="bill-desc">{{ item.unitNo}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="arrow"></view>
|
<view class="arrow"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -50,9 +68,12 @@
|
|||||||
<view class="load-more-status" v-else-if="!hasMore && detailslist.length >= pageSize">
|
<view class="load-more-status" v-else-if="!hasMore && detailslist.length >= pageSize">
|
||||||
<text class="no-more-text">— 没有更多了 —</text>
|
<text class="no-more-text">— 没有更多了 —</text>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="empty-state" v-else>
|
||||||
|
<text class="empty-text">暂无数据</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 新增缴费区域 -->
|
<!-- 新增缴费区域 -->
|
||||||
<view class="add-section">
|
<view class="add-section">
|
||||||
<view class="section-header">
|
<view class="section-header">
|
||||||
@@ -72,15 +93,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 开启通知按钮 -->
|
|
||||||
<!-- v-if="subscribeAuth !== 'accepted'" -->
|
|
||||||
<!-- <view class="subscribe-btn" @click="requestSubscribeMessageClick">
|
|
||||||
<text class="subscribe-btn-text">开启缴费通知</text>
|
|
||||||
|
|
||||||
</view> -->
|
|
||||||
<!-- <button class="subscribe-btn" @tap="handleWaterElecSubscribe" open-type="subscribeMessage">
|
|
||||||
开启订单状态通知
|
|
||||||
</button> -->
|
|
||||||
<view style="width: 100%;height: 30rpx;"></view>
|
<view style="width: 100%;height: 30rpx;"></view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -89,34 +101,26 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onShow, onLoad, onBackPress } from '@dcloudio/uni-app'
|
import { onShow, onLoad, onBackPress, onUnload } from '@dcloudio/uni-app'
|
||||||
|
import { getTopUpDetails, getTopUpSelectByResident } from '/pageSubPack/api/apiSub.js'
|
||||||
|
import { getCurrentVillage } from '/pageSubPack/api/api.js'
|
||||||
|
|
||||||
import {
|
|
||||||
getTopUpSelectByResident,
|
|
||||||
getTopUpDetails,
|
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const detailslist = ref([])
|
const detailslist = ref([])
|
||||||
const pageNum = ref(1)
|
const pageNum = ref(1)
|
||||||
const pageSize = ref(3)
|
const pageSize = ref(5)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const hasMore = ref(true)
|
const hasMore = ref(true)
|
||||||
const loadingMore = ref(false)
|
const loadingMore = ref(false)
|
||||||
|
const payPageNum = ref(1)
|
||||||
|
const payPageSize = ref(5)
|
||||||
|
const payTotal = ref(0)
|
||||||
|
const payHasMore = ref(true)
|
||||||
|
const payLoadingMore = ref(false)
|
||||||
|
// 小区选择
|
||||||
|
const currentCommunity = ref('请绑定房屋')
|
||||||
const paymentList = ref([
|
const paymentList = ref([
|
||||||
// {
|
|
||||||
// id: 1,
|
|
||||||
// name: '物业费',
|
|
||||||
// status: '已欠费',
|
|
||||||
// address: '桂花园(别墅)2号楼2层',
|
|
||||||
// icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/property.png",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 2,
|
|
||||||
// name: '暖气费',
|
|
||||||
// status: '',
|
|
||||||
// address: '山东省日照市东港区桂花园(别墅)2号楼2层',
|
|
||||||
// icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/heating.png",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: '电费',
|
name: '电费',
|
||||||
@@ -127,12 +131,7 @@
|
|||||||
])
|
])
|
||||||
|
|
||||||
const addList = ref([
|
const addList = ref([
|
||||||
// {
|
|
||||||
// name: "燃气",
|
|
||||||
// type: "gas",
|
|
||||||
// icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/gas.png",
|
|
||||||
// iconClass: "gas"
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: "水表",
|
name: "水表",
|
||||||
type: "water",
|
type: "water",
|
||||||
@@ -145,36 +144,55 @@
|
|||||||
icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/electric.png",
|
icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/electric.png",
|
||||||
iconClass: "electric"
|
iconClass: "electric"
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: "物业费",
|
|
||||||
// type: "property",
|
|
||||||
// icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/property.png",
|
|
||||||
// iconClass: "property"
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "车位费",
|
|
||||||
// type: "parking",
|
|
||||||
// icon: "https://wuyeadmin.bugtc.com/images/propertyImgs/parkingIcon.png",
|
|
||||||
// iconClass: "parking"
|
|
||||||
// }
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// 获取当前小区
|
||||||
|
const getCurrentCommunityData = () => {
|
||||||
|
getCurrentVillage().then(res => {
|
||||||
|
if (res.code === 200 && res.data && res.data.villageId) {
|
||||||
|
currentCommunity.value = res.data.villageName || '未命名小区'
|
||||||
|
} else {
|
||||||
|
currentCommunity.value = '请绑定房屋'
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接收小区切换事件
|
||||||
|
const slelctHomeData = (data) => {
|
||||||
|
if (data.name) currentCommunity.value = data.name
|
||||||
|
if (data.villageId) {
|
||||||
|
uni.setStorageSync('currentVillageId', data.villageId)
|
||||||
|
}
|
||||||
|
getBillDetails()
|
||||||
|
getPayList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转小区选择
|
||||||
|
const navigateToSelectHome = () => {
|
||||||
|
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
||||||
|
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
||||||
|
uni.navigateTo({ url: '/pageSubPack/my/myHouseIndex' })
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({ url: `/pageSubPack/notice-list/selectHome?villageId=${cachedVillageId}` })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
getCurrentCommunityData()
|
||||||
// Zy --------------
|
|
||||||
getBillDetails()
|
getBillDetails()
|
||||||
// Zy --------------
|
|
||||||
|
|
||||||
// 不再自动请求订阅消息,改为用户点击触发
|
|
||||||
})
|
})
|
||||||
// 生命周期
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
uni.hideTabBar({ animation: false });
|
uni.hideTabBar({ animation: false });
|
||||||
|
uni.$on('confirm', slelctHomeData)
|
||||||
getPayList()
|
getPayList()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnload(() => {
|
||||||
|
uni.$off('confirm', slelctHomeData)
|
||||||
|
})
|
||||||
|
|
||||||
// 页面返回拦截
|
// 页面返回拦截
|
||||||
onBackPress(() => {
|
onBackPress(() => {
|
||||||
const pages = getCurrentPages()
|
const pages = getCurrentPages()
|
||||||
@@ -184,50 +202,29 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 跳转账单
|
||||||
const getPayList = async () => {
|
|
||||||
// 防重复请求
|
|
||||||
try {
|
|
||||||
const res = await getTopUpSelectByResident({
|
|
||||||
residentUserId: uni.getStorageSync('userId')
|
|
||||||
})
|
|
||||||
const data = res.data
|
|
||||||
paymentList.value = data
|
|
||||||
} catch (err) {
|
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
// console.error('列表接口报错:', err)
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 方法
|
|
||||||
const goToBill = (item) => {
|
const goToBill = (item) => {
|
||||||
uni.setStorageSync('arrearsPayment', item)
|
uni.setStorageSync('arrearsPayment', item)
|
||||||
|
// 水费、电费走欠费缴纳页
|
||||||
const type = String(item.type || '')
|
if (item.type === '水费' || item.type === '电费') {
|
||||||
// 物业费、车位费、垃圾处理费走物业费缴纳页;水费、电费走欠费缴纳页
|
|
||||||
const isProperty = ['物业费', '车位费', '垃圾处理费', '垃圾费', '0', '1', '2'].includes(type)
|
|
||||||
if (isProperty) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pageSubPack/payment-list/propertyFeePayment?amount=${item.amount || ''}`
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageSubPack/payment-list/arrearsPayment'
|
url: '/pageSubPack/payment-list/arrearsPayment'
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pageSubPack/payment-list/billPayment'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 跳转缴费记录
|
||||||
const goToRecord = () => {
|
const goToRecord = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageSubPack/payment-list/paymentRecord'
|
url: '/pageSubPack/payment-list/paymentRecord'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增缴费
|
||||||
const goToAdd = (type) => {
|
const goToAdd = (type) => {
|
||||||
uni.setStorageSync('addPaymentType', type.name)
|
uni.setStorageSync('addPaymentType', type.name)
|
||||||
if (type.name == '燃气' || type.name == '暖气') {
|
if (type.name == '燃气' || type.name == '暖气') {
|
||||||
@@ -241,7 +238,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取缴费列表
|
// 获取物业费/车位费缴费列表
|
||||||
const getBillDetails = (isLoadMore = false) => {
|
const getBillDetails = (isLoadMore = false) => {
|
||||||
if (isLoadMore) {
|
if (isLoadMore) {
|
||||||
if (!hasMore.value || loadingMore.value) return
|
if (!hasMore.value || loadingMore.value) return
|
||||||
@@ -275,15 +272,48 @@
|
|||||||
const onLoadMore = () => {
|
const onLoadMore = () => {
|
||||||
getBillDetails(true)
|
getBillDetails(true)
|
||||||
}
|
}
|
||||||
const switchStatus = (type) => {
|
|
||||||
const typeMap = {
|
// 水电费列表
|
||||||
'0': '物业费',
|
const getPayList = async (isLoadMore = false) => {
|
||||||
'1': '车位费',
|
if (isLoadMore) {
|
||||||
'2': '垃圾处理费'
|
if (!payHasMore.value || payLoadingMore.value) return
|
||||||
|
payPageNum.value++
|
||||||
|
payLoadingMore.value = true
|
||||||
|
} else {
|
||||||
|
payPageNum.value = 1
|
||||||
|
payHasMore.value = true
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getTopUpSelectByResident({
|
||||||
|
residentUserId: uni.getStorageSync('userId'),
|
||||||
|
pageNum: payPageNum.value,
|
||||||
|
pageSize: payPageSize.value,
|
||||||
|
villageId:uni.getStorageSync('currentVillageId')
|
||||||
|
})
|
||||||
|
const data = res.rows || res.data
|
||||||
|
if (isLoadMore) {
|
||||||
|
paymentList.value = [...paymentList.value, ...(data || [])]
|
||||||
|
payLoadingMore.value = false
|
||||||
|
} else {
|
||||||
|
paymentList.value = data || []
|
||||||
|
}
|
||||||
|
payTotal.value = res.total || 0
|
||||||
|
payHasMore.value = paymentList.value.length < payTotal.value
|
||||||
|
} catch (err) {
|
||||||
|
if (isLoadMore) {
|
||||||
|
payPageNum.value--
|
||||||
|
payLoadingMore.value = false
|
||||||
|
}
|
||||||
|
uni.showToast({
|
||||||
|
title: err.msg || '网络异常',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return typeMap[type] || type
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onPayLoadMore = () => {
|
||||||
|
getPayList(true)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -309,7 +339,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.topbox {
|
.topbox {
|
||||||
height: 150rpx;
|
height: 180rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@@ -319,7 +349,7 @@
|
|||||||
height: 74rpx;
|
height: 74rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 40rpx;
|
left: 40rpx;
|
||||||
bottom: 20rpx;
|
bottom: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.payImg {
|
.payImg {
|
||||||
@@ -330,6 +360,33 @@
|
|||||||
bottom: -140rpx;
|
bottom: -140rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 小区选择栏 */
|
||||||
|
.community-bar {
|
||||||
|
position: absolute;
|
||||||
|
left: 40rpx;
|
||||||
|
bottom: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.location-icon {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.community-name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #222;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 260rpx;
|
||||||
|
margin-right: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.container {}
|
.container {}
|
||||||
|
|
||||||
.bill-list {
|
.bill-list {
|
||||||
@@ -339,22 +396,6 @@
|
|||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-state {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 100rpx 0;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-text {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bill-item {
|
.bill-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -368,6 +409,10 @@
|
|||||||
margin-bottom: 0rpx;
|
margin-bottom: 0rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bill-item.bill-paid {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
.bill-info {
|
.bill-info {
|
||||||
width: calc(90% - 100rpx);
|
width: calc(90% - 100rpx);
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -380,7 +425,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bill-title {
|
.bill-title {
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
@@ -389,7 +434,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bill-desc {
|
.bill-desc {
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #999;
|
color: #999;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -401,23 +446,21 @@
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 2rpx 16rpx;
|
padding: 2rpx 10rpx;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
font-size: 24rpx;
|
font-size: 14rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #E34D59;
|
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.balance-normal {
|
|
||||||
font-size: 28rpx;
|
.bill-status.debt {
|
||||||
color: #333;
|
background-color: #E34D59;
|
||||||
}
|
}
|
||||||
|
|
||||||
.balance-debt {
|
.bill-status.done {
|
||||||
font-size: 28rpx;
|
background-color: #999;
|
||||||
color: #E34D59;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.arrow {
|
||||||
@@ -428,6 +471,39 @@
|
|||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.details-scroll {
|
||||||
|
max-height: 500rpx;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-normal {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-debt {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #E34D59;
|
||||||
|
}
|
||||||
|
|
||||||
.add-section {
|
.add-section {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
@@ -456,7 +532,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
/* gap: 26rpx; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-item {
|
.grid-item {
|
||||||
@@ -470,7 +545,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
/* 每行第 1 个 item 清除左边距,保证对齐 */
|
|
||||||
.grid-item:nth-child(4n+1) {
|
.grid-item:nth-child(4n+1) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
@@ -496,40 +571,16 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subscribe-btn {
|
.empty-state {
|
||||||
margin-top: 20rpx;
|
|
||||||
background-color: #1677ff;
|
|
||||||
padding: 24rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subscribe-btn-text {
|
|
||||||
color: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details-scroll {
|
|
||||||
max-height: 500rpx;
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.load-more-status {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20rpx 0;
|
justify-content: center;
|
||||||
|
padding: 80rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-text {
|
.empty-text {
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-more-text {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -437,6 +437,12 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "billPayment",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "缴费账单"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -186,10 +186,10 @@
|
|||||||
const dataLoaded = ref(false)
|
const dataLoaded = ref(false)
|
||||||
const pageReady = ref(false)
|
const pageReady = ref(false)
|
||||||
// ======= 首页数据缓存(冷启动秒开) =======
|
// ======= 首页数据缓存(冷启动秒开) =======
|
||||||
const HOME_CACHE_KEY = 'home_cache'
|
const getHomeCacheKey = () => 'home_cache_' + (uni.getStorageSync('userId') || '')
|
||||||
function loadHomeCache() {
|
function loadHomeCache() {
|
||||||
try {
|
try {
|
||||||
const raw = uni.getStorageSync(HOME_CACHE_KEY)
|
const raw = uni.getStorageSync(getHomeCacheKey())
|
||||||
if (!raw) return false
|
if (!raw) return false
|
||||||
const c = JSON.parse(raw)
|
const c = JSON.parse(raw)
|
||||||
if (c.community && c.community !== '请绑定房屋') currentCommunity.value = c.community
|
if (c.community && c.community !== '请绑定房屋') currentCommunity.value = c.community
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
}
|
}
|
||||||
function saveHomeCache() {
|
function saveHomeCache() {
|
||||||
try {
|
try {
|
||||||
uni.setStorageSync(HOME_CACHE_KEY, JSON.stringify({
|
uni.setStorageSync(getHomeCacheKey(), JSON.stringify({
|
||||||
community: currentCommunity.value,
|
community: currentCommunity.value,
|
||||||
villageId: currentVillageId.value,
|
villageId: currentVillageId.value,
|
||||||
bannerList: bannerList.value,
|
bannerList: bannerList.value,
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getCurrentCommunityData = () => {
|
const getCurrentCommunityData = () => {
|
||||||
getCurrentVillage().then(res => {
|
return getCurrentVillage().then(res => {
|
||||||
if (res.code === 200 && res.data && res.data.villageId) {
|
if (res.code === 200 && res.data && res.data.villageId) {
|
||||||
currentCommunity.value = res.data.villageName || '未命名小区'
|
currentCommunity.value = res.data.villageName || '未命名小区'
|
||||||
saveHomeCache()
|
saveHomeCache()
|
||||||
@@ -329,7 +329,8 @@
|
|||||||
console.error('重新加载用户信息失败', err)
|
console.error('重新加载用户信息失败', err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getCurrentCommunityData()
|
// 先获取小区信息,确保 villageId 已更新,再请求依赖 villageId 的接口
|
||||||
|
await getCurrentCommunityData()
|
||||||
getNoticeData()
|
getNoticeData()
|
||||||
getNewActivityList()
|
getNewActivityList()
|
||||||
getbannarData()
|
getbannarData()
|
||||||
@@ -348,12 +349,13 @@
|
|||||||
const resetPageData = () => {
|
const resetPageData = () => {
|
||||||
currentCommunity.value = '请绑定房屋'
|
currentCommunity.value = '请绑定房屋'
|
||||||
currentVillageId.value = ''
|
currentVillageId.value = ''
|
||||||
|
uni.removeStorageSync('currentVillageId')
|
||||||
activityList.value = []
|
activityList.value = []
|
||||||
bannerList.value = []
|
bannerList.value = []
|
||||||
bannerRawData.value = []
|
bannerRawData.value = []
|
||||||
noticeText.value = '暂无公告'
|
noticeText.value = '暂无公告'
|
||||||
noticeId.value = ''
|
noticeId.value = ''
|
||||||
uni.removeStorageSync(HOME_CACHE_KEY)
|
uni.removeStorageSync(getHomeCacheKey())
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@@ -395,7 +397,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const navigateToPage = () => {
|
const navigateToPage = () => {
|
||||||
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
||||||
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user