部分样式修复/缴费记录/水电费明细样式修改完成
This commit is contained in:
@@ -1,347 +1,317 @@
|
||||
<template>
|
||||
<view class="bill-list-page">
|
||||
<!-- 自定义导航栏 -->
|
||||
<customNavbar
|
||||
title="我的账单"
|
||||
></customNavbar>
|
||||
<view class="bill-list-page">
|
||||
<!-- 自定义导航栏 -->
|
||||
<customNavbar title="我的账单"></customNavbar>
|
||||
|
||||
<!-- 筛选栏 -->
|
||||
<view class="filter-bar">
|
||||
<!-- 年份筛选点击区域 -->
|
||||
<view class="year-filter" @click="toggleYearPicker">
|
||||
<text class="year-text">{{ currentYear }}年</text>
|
||||
<u-icon name="arrow-down" size="24" color="#666"></u-icon>
|
||||
</view>
|
||||
|
||||
<!-- 自定义年份选择器弹窗 -->
|
||||
<u-popup v-model="showYearPicker" mode="bottom" border-radius="20rpx" :closeable="true">
|
||||
<view class="year-picker-popup">
|
||||
<!-- 弹窗标题 -->
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择年份</text>
|
||||
</view>
|
||||
|
||||
<!-- 年份列表 -->
|
||||
<view class="year-list">
|
||||
<view
|
||||
class="year-item"
|
||||
v-for="year in years"
|
||||
:key="year"
|
||||
:class="{ active: currentYear === year }"
|
||||
@click="selectYear(year)"
|
||||
>
|
||||
{{ year }}年
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 支出/收入切换 -->
|
||||
<view class="tab-bar">
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === 'out' }"
|
||||
@click="switchTab('out')"
|
||||
>
|
||||
支出
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === 'in' }"
|
||||
@click="switchTab('in')"
|
||||
>
|
||||
收入
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 筛选栏 -->
|
||||
<view class="filter-bar">
|
||||
<!-- 年份筛选点击区域 -->
|
||||
<view class="year-filter" @click="toggleYearPicker">
|
||||
<text class="year-text">{{ currentYear }}年</text>
|
||||
<u-icon name="arrow-down" size="24" color="#666"></u-icon>
|
||||
</view>
|
||||
|
||||
<!-- 账单列表 -->
|
||||
<scroll-view
|
||||
scroll-y
|
||||
class="scroll-content"
|
||||
:scroll-top="0"
|
||||
:refresher-enabled="true"
|
||||
:refresher-triggered="isRefreshing"
|
||||
@refresherrefresh="refresh"
|
||||
@scrolltolower="loadMore"
|
||||
>
|
||||
<view v-if="bills.length > 0">
|
||||
<view
|
||||
class="bill-item"
|
||||
v-for="item in bills"
|
||||
:key="item.id"
|
||||
@click="goDetail(item)"
|
||||
>
|
||||
<!-- 左侧信息 -->
|
||||
<view class="bill-left">
|
||||
<text class="bill-name">{{ item.feeName }}</text>
|
||||
<text class="bill-date" v-if="item.payTime">支付时间:{{ item.payTime }}</text>
|
||||
<text
|
||||
class="bill-status"
|
||||
v-if="currentTab === 'out'"
|
||||
>{{ item.status }}</text>
|
||||
</view>
|
||||
<!-- 自定义年份选择器弹窗 -->
|
||||
<u-popup v-model="showYearPicker" mode="bottom" border-radius="20rpx" :closeable="true">
|
||||
<view class="year-picker-popup">
|
||||
<!-- 弹窗标题 -->
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择年份</text>
|
||||
</view>
|
||||
|
||||
<!-- 右侧金额 + 箭头 -->
|
||||
<view class="bill-right">
|
||||
<text class="amount">{{ formatMoney(item.amount) }}</text>
|
||||
<u-icon name="arrow-right" size="28" color="#ccc" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 年份列表 -->
|
||||
<view class="year-list">
|
||||
<view class="year-item" v-for="year in years" :key="year"
|
||||
:class="{ active: currentYear === year }" @click="selectYear(year)">
|
||||
{{ year }}年
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<view v-else class="empty">
|
||||
<u-empty mode="list" text="暂无账单" />
|
||||
</view>
|
||||
<!-- 支出/收入切换 -->
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item" :class="{ active: currentTab === 'out' }" @click="switchTab('out')">
|
||||
支出
|
||||
</view>
|
||||
<view class="tab-item" :class="{ active: currentTab === 'in' }" @click="switchTab('in')">
|
||||
收入
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-loadmore :status="loadStatus" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 账单列表 -->
|
||||
<scroll-view scroll-y class="scroll-content" :scroll-top="0" :refresher-enabled="true"
|
||||
:refresher-triggered="isRefreshing" @refresherrefresh="refresh" @scrolltolower="loadMore">
|
||||
<view v-if="bills.length > 0">
|
||||
<view class="bill-item" v-for="item in bills" :key="item.id" @click="goDetail(item)">
|
||||
<!-- 左侧信息 -->
|
||||
<view class="bill-left">
|
||||
<text class="bill-name">{{ item.feeName }}</text>
|
||||
<text class="bill-date" v-if="item.payTime">支付时间:{{ item.payTime }}</text>
|
||||
<text class="bill-status" v-if="currentTab === 'out'">{{ item.status }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 右侧金额 + 箭头 -->
|
||||
<view class="bill-right">
|
||||
<text class="amount">{{ formatMoney(item.amount) }}</text>
|
||||
<u-icon name="arrow-right" size="28" color="#ccc" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="empty">
|
||||
<u-empty mode="list" text="暂无账单" />
|
||||
</view>
|
||||
|
||||
<u-loadmore :status="loadStatus" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentTab: 'out', // in 收 / out 支
|
||||
bills: [],
|
||||
isRefreshing: false,
|
||||
loadStatus: 'more', // u-loadmore 状态
|
||||
// 年份筛选相关
|
||||
currentYear: 2025,
|
||||
years: [2025, 2024, 2023, 2022, 2021],
|
||||
showYearPicker: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// 可以从 options 获取用户ID或合同ID
|
||||
this.loadBills();
|
||||
},
|
||||
methods: {
|
||||
switchTab(tab) {
|
||||
this.currentTab = tab;
|
||||
this.loadBills();
|
||||
},
|
||||
|
||||
// 切换年份选择器显示
|
||||
toggleYearPicker() {
|
||||
this.showYearPicker = !this.showYearPicker;
|
||||
},
|
||||
|
||||
// 选择年份
|
||||
selectYear(year) {
|
||||
this.currentYear = year;
|
||||
this.showYearPicker = false;
|
||||
// 重新加载账单数据
|
||||
this.loadBills();
|
||||
},
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentTab: 'out', // in 收 / out 支
|
||||
bills: [],
|
||||
isRefreshing: false,
|
||||
loadStatus: 'more', // u-loadmore 状态
|
||||
// 年份筛选相关
|
||||
currentYear: 2025,
|
||||
years: [2025, 2024, 2023, 2022, 2021],
|
||||
showYearPicker: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// 可以从 options 获取用户ID或合同ID
|
||||
this.loadBills();
|
||||
},
|
||||
methods: {
|
||||
switchTab(tab) {
|
||||
this.currentTab = tab;
|
||||
this.loadBills();
|
||||
},
|
||||
|
||||
loadBills() {
|
||||
// 模拟数据加载
|
||||
if (this.currentTab === 'in') {
|
||||
this.bills = [
|
||||
{
|
||||
id: 'b101',
|
||||
feeName: '第一期(2024.12.01-2024.12.31)',
|
||||
payTime: '2024-12-05',
|
||||
amount: 3000,
|
||||
status: '已收',
|
||||
},
|
||||
{
|
||||
id: 'b102',
|
||||
feeName: '第二期(2025.01.01-2025.01.31)',
|
||||
payTime: '',
|
||||
amount: 3000,
|
||||
status: '未收',
|
||||
},
|
||||
];
|
||||
} else {
|
||||
this.bills = [
|
||||
{
|
||||
id: 'b201',
|
||||
feeName: '第一期租金(2024.12.01-2024.12.31)',
|
||||
payTime: '2024-12-05',
|
||||
amount: 3000,
|
||||
status: '已支付',
|
||||
},
|
||||
{
|
||||
id: 'b202',
|
||||
feeName: '第二期租金(2025.01.01-2025.01.31)',
|
||||
payTime: '',
|
||||
amount: 3000,
|
||||
status: '待支付',
|
||||
},
|
||||
];
|
||||
}
|
||||
},
|
||||
// 切换年份选择器显示
|
||||
toggleYearPicker() {
|
||||
this.showYearPicker = !this.showYearPicker;
|
||||
},
|
||||
|
||||
refresh() {
|
||||
this.isRefreshing = true;
|
||||
setTimeout(() => {
|
||||
this.loadBills();
|
||||
this.isRefreshing = false;
|
||||
}, 1000);
|
||||
},
|
||||
// 选择年份
|
||||
selectYear(year) {
|
||||
this.currentYear = year;
|
||||
this.showYearPicker = false;
|
||||
// 重新加载账单数据
|
||||
this.loadBills();
|
||||
},
|
||||
|
||||
loadMore() {
|
||||
// 可以调用接口分页加载更多数据
|
||||
this.loadStatus = 'noMore';
|
||||
},
|
||||
loadBills() {
|
||||
// 模拟数据加载
|
||||
if (this.currentTab === 'in') {
|
||||
this.bills = [{
|
||||
id: 'b101',
|
||||
feeName: '第一期(2024.12.01-2024.12.31)',
|
||||
payTime: '2024-12-05',
|
||||
amount: 3000,
|
||||
status: '已收',
|
||||
},
|
||||
{
|
||||
id: 'b102',
|
||||
feeName: '第二期(2025.01.01-2025.01.31)',
|
||||
payTime: '',
|
||||
amount: 3000,
|
||||
status: '未收',
|
||||
},
|
||||
];
|
||||
} else {
|
||||
this.bills = [{
|
||||
id: 'b201',
|
||||
feeName: '第一期租金(2024.12.01-2024.12.31)',
|
||||
payTime: '2024-12-05',
|
||||
amount: 3000,
|
||||
status: '已支付',
|
||||
},
|
||||
{
|
||||
id: 'b202',
|
||||
feeName: '第二期租金(2025.01.01-2025.01.31)',
|
||||
payTime: '',
|
||||
amount: 3000,
|
||||
status: '待支付',
|
||||
},
|
||||
];
|
||||
}
|
||||
},
|
||||
|
||||
formatMoney(val) {
|
||||
if (!val && val !== 0) return '—';
|
||||
return '¥' + Number(val).toFixed(2);
|
||||
},
|
||||
refresh() {
|
||||
this.isRefreshing = true;
|
||||
setTimeout(() => {
|
||||
this.loadBills();
|
||||
this.isRefreshing = false;
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/bill/billDetail?id=${item.id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
loadMore() {
|
||||
// 可以调用接口分页加载更多数据
|
||||
this.loadStatus = 'noMore';
|
||||
},
|
||||
|
||||
formatMoney(val) {
|
||||
if (!val && val !== 0) return '—';
|
||||
return '¥' + Number(val).toFixed(2);
|
||||
},
|
||||
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/bill/billDetail?id=${item.id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bill-list-page {
|
||||
background: #f7f8fa;
|
||||
min-height: 100vh;
|
||||
padding-top: 120rpx; /* 给导航栏留空间 */
|
||||
}
|
||||
.bill-list-page {
|
||||
background: #f7f8fa;
|
||||
min-height: 100vh;
|
||||
padding-top: 120rpx;
|
||||
/* 给导航栏留空间 */
|
||||
}
|
||||
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx 30rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx 30rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 年份筛选 */
|
||||
.year-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* 年份筛选 */
|
||||
.year-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 支出/收入切换 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
/* 支出/收入切换 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 12rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 24rpx;
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: #ff3b30;
|
||||
}
|
||||
}
|
||||
.tab-item {
|
||||
padding: 12rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 24rpx;
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
/* 自定义年份选择器样式 */
|
||||
.year-picker-popup {
|
||||
background: #fff;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: #ff3b30;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
/* 自定义年份选择器样式 */
|
||||
.year-picker-popup {
|
||||
background: #fff;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header {
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.year-list {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.popup-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.year-item {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
padding: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
background: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #ff3b30;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #ff5252;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.year-list {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.scroll-content {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.year-item {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
padding: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
background: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
.bill-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
margin: 0 20rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.bill-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&.active {
|
||||
background: #ff3b30;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bill-name {
|
||||
font-size: 28rpx;
|
||||
color: #2D2B2C;
|
||||
font-weight: 500;
|
||||
}
|
||||
&:hover {
|
||||
background: #ff5252;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.bill-date,
|
||||
.bill-status {
|
||||
font-size: 24rpx;
|
||||
color: #ADADB1;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
}
|
||||
.scroll-content {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.bill-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.bill-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
margin: 0 20rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.amount {
|
||||
font-size: 28rpx;
|
||||
color: #F34038;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.bill-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.empty {
|
||||
margin-top: 200rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
.bill-name {
|
||||
font-size: 28rpx;
|
||||
color: #2D2B2C;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.bill-date,
|
||||
.bill-status {
|
||||
font-size: 24rpx;
|
||||
color: #ADADB1;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bill-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.amount {
|
||||
font-size: 28rpx;
|
||||
color: #F34038;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin-top: 200rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -1,202 +1,305 @@
|
||||
<template>
|
||||
<view class="pay-history-page">
|
||||
<customNavbar title="缴费记录" />
|
||||
<view class="pay-history-page">
|
||||
<customNavbar title="缴费记录" />
|
||||
|
||||
<!-- 顶部tab切换 -->
|
||||
<view class="tab-bar">
|
||||
<view
|
||||
v-for="(tab, index) in tabs"
|
||||
:key="index"
|
||||
:class="['tab-item', activeTab === tab.value ? 'active' : '']"
|
||||
@click="activeTab = tab.value"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 筛选栏 -->
|
||||
<view class="filter-bar">
|
||||
<!-- 年份筛选点击区域 -->
|
||||
<view class="year-filter" @click="toggleYearPicker">
|
||||
<text class="year-text">{{ currentYear }}年</text>
|
||||
<u-icon name="arrow-down" size="24" color="#666"></u-icon>
|
||||
</view>
|
||||
|
||||
<!-- 收支记录列表 -->
|
||||
<scroll-view scroll-y class="scroll-content">
|
||||
<view v-if="filteredRecords.length > 0" class="record-list">
|
||||
<view
|
||||
v-for="(item, index) in filteredRecords"
|
||||
:key="index"
|
||||
class="record-item"
|
||||
@click="goDetail(item)"
|
||||
>
|
||||
<!-- 左侧信息 -->
|
||||
<view class="left">
|
||||
<view class="title">{{ item.feeName }}</view>
|
||||
<view class="sub">{{ item.timeLabel }}:{{ item.time || '—' }}</view>
|
||||
</view>
|
||||
<!-- 自定义年份选择器弹窗 -->
|
||||
<u-popup v-model="showYearPicker" mode="bottom" border-radius="20rpx" :closeable="true">
|
||||
<view class="year-picker-popup">
|
||||
<!-- 弹窗标题 -->
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择年份</text>
|
||||
</view>
|
||||
|
||||
<!-- 右侧金额 + 图标 -->
|
||||
<view class="right">
|
||||
<view
|
||||
class="amount"
|
||||
:class="item.type === 'income' ? 'income' : 'expense'"
|
||||
>
|
||||
{{ item.type === 'income' ? '+' : '-' }}{{ item.amount.toFixed(2) }}
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="32" color="#ccc"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 年份列表 -->
|
||||
<view class="year-list">
|
||||
<view class="year-item" v-for="year in years" :key="year"
|
||||
:class="{ active: currentYear === year }" @click="selectYear(year)">
|
||||
{{ year }}年
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 顶部tab切换 -->
|
||||
<view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index"
|
||||
:class="['tab-item', activeTab === tab.value ? 'active' : '']" @click="activeTab = tab.value">
|
||||
{{ tab.label }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="empty">
|
||||
<u-empty mode="list" text="暂无记录" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 收支记录列表 -->
|
||||
<scroll-view scroll-y class="scroll-content">
|
||||
<view v-if="filteredRecords.length > 0" class="record-list">
|
||||
<view v-for="(item, index) in filteredRecords" :key="index" class="record-item" @click="goDetail(item)">
|
||||
<!-- 左侧信息 -->
|
||||
<view class="left">
|
||||
<view class="title">{{ item.feeName }}</view>
|
||||
<view class="sub">{{ item.timeLabel }}:{{ item.time || '—' }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 右侧金额 + 图标 -->
|
||||
<view class="right">
|
||||
<view class="amount" :class="item.type === 'income' ? 'income' : 'expense'">
|
||||
{{ item.type === 'income' ? '+' : '-' }}{{ item.amount.toFixed(2) }}
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="32" color="#ccc"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="empty">
|
||||
<u-empty mode="list" text="暂无记录" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'income', // 默认显示“收”
|
||||
tabs: [
|
||||
{ label: '收', value: 'income' },
|
||||
{ label: '支', value: 'expense' },
|
||||
],
|
||||
records: [
|
||||
{
|
||||
id: 1,
|
||||
type: 'income', // 收
|
||||
feeName: '第一期租金(2024.01.01 - 2024.03.31)',
|
||||
time: '2024-01-05',
|
||||
timeLabel: '收款时间',
|
||||
amount: 8500,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'expense', // 支
|
||||
feeName: '押金缴纳',
|
||||
time: '2024-01-03',
|
||||
timeLabel: '支付时间',
|
||||
amount: 5000,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: 'expense',
|
||||
feeName: '第二期租金(2024.04.01 - 2024.06.30)',
|
||||
time: '',
|
||||
timeLabel: '支付时间',
|
||||
amount: 8500,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredRecords() {
|
||||
return this.records.filter((r) => r.type === this.activeTab);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
statusText(status) {
|
||||
const map = {
|
||||
paid: '已支付 / 已收款',
|
||||
unpaid: '待支付',
|
||||
pending: '处理中',
|
||||
};
|
||||
return map[status] || '未知状态';
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/bill/detail?id=${item.id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'income', // 默认显示“收”
|
||||
tabs: [{
|
||||
label: '收入',
|
||||
value: 'income'
|
||||
},
|
||||
{
|
||||
label: '支出',
|
||||
value: 'expense'
|
||||
},
|
||||
],
|
||||
records: [{
|
||||
id: 1,
|
||||
type: 'income', // 收
|
||||
feeName: '第一期租金(2024.01.01 - 2024.03.31)',
|
||||
time: '2024-01-05',
|
||||
timeLabel: '收款时间',
|
||||
amount: 8500,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'expense', // 支
|
||||
feeName: '押金缴纳',
|
||||
time: '2024-01-03',
|
||||
timeLabel: '支付时间',
|
||||
amount: 5000,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: 'expense',
|
||||
feeName: '第二期租金(2024.04.01 - 2024.06.30)',
|
||||
time: '',
|
||||
timeLabel: '支付时间',
|
||||
amount: 8500,
|
||||
},
|
||||
],
|
||||
// 年份筛选相关
|
||||
currentYear: 2025,
|
||||
years: [2025, 2024, 2023, 2022, 2021],
|
||||
showYearPicker: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredRecords() {
|
||||
return this.records.filter((r) => r.type === this.activeTab);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 切换年份选择器显示
|
||||
toggleYearPicker() {
|
||||
this.showYearPicker = !this.showYearPicker;
|
||||
},
|
||||
// 选择年份
|
||||
selectYear(year) {
|
||||
this.currentYear = year;
|
||||
this.showYearPicker = false;
|
||||
// 重新加载数据
|
||||
// this.load();
|
||||
},
|
||||
statusText(status) {
|
||||
const map = {
|
||||
paid: '已支付 / 已收款',
|
||||
unpaid: '待支付',
|
||||
pending: '处理中',
|
||||
};
|
||||
return map[status] || '未知状态';
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/bill/detail?id=${item.id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pay-history-page {
|
||||
background: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
padding-top: 175rpx;
|
||||
.pay-history-page {
|
||||
background: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
padding-top: 120rpx;
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx 30rpx;
|
||||
margin: 20rpx;
|
||||
margin-bottom: 0;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 年份筛选 */
|
||||
.year-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 支出/收入切换 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 12rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 24rpx;
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: #ff3b30;
|
||||
}
|
||||
}
|
||||
|
||||
/* 自定义年份选择器样式 */
|
||||
.year-picker-popup {
|
||||
background: #fff;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.year-list {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.year-item {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
padding: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
background: #f5f5f5;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #ff3b30;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #ff5252;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
margin: 0 20rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
|
||||
.record-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 24rpx 0;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
.record-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.03);
|
||||
|
||||
&.active {
|
||||
color: #007aff;
|
||||
font-weight: 700;
|
||||
background: #eaf3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.record-list {
|
||||
padding: 20rpx;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
font-weight:5600;
|
||||
color: #2D2B2C;
|
||||
}
|
||||
|
||||
.record-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.03);
|
||||
.sub {
|
||||
font-size: 24rpx;
|
||||
color: #86868C;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.sub {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
&.paid {
|
||||
color: #4caf50;
|
||||
}
|
||||
&.unpaid {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status {
|
||||
font-size: 28rpx;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.amount {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 10rpx;
|
||||
&.income {
|
||||
color: #4caf50;
|
||||
}
|
||||
&.expense {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.paid {
|
||||
color: #73B936;
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
&.unpaid {
|
||||
color: #F34038;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.amount {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
margin-right: 10rpx;
|
||||
|
||||
&.income {
|
||||
color: #73B936;
|
||||
}
|
||||
|
||||
&.expense {
|
||||
color: #F34038;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +1,8 @@
|
||||
<template>
|
||||
<view class="user-center">
|
||||
<customNavbar
|
||||
title="个人中心"
|
||||
ref="navbar"
|
||||
:is-transparent="navbarStyle.isTransparent"
|
||||
:bg-color="navbarStyle.bgColor"
|
||||
:text-color="navbarStyle.textColor"
|
||||
:opacity="navbarStyle.opacity"
|
||||
:extra-icons="navbarStyle.extraIcons"
|
||||
:show-home="false"
|
||||
:show-back="false"
|
||||
/>
|
||||
<customNavbar title="个人中心" ref="navbar" :is-transparent="navbarStyle.isTransparent"
|
||||
:bg-color="navbarStyle.bgColor" :text-color="navbarStyle.textColor" :opacity="navbarStyle.opacity"
|
||||
:extra-icons="navbarStyle.extraIcons" :show-home="false" :show-back="false" />
|
||||
<!-- 顶部用户信息 -->
|
||||
<view class="user-header">
|
||||
<u-avatar :src="avatar" size="133"></u-avatar>
|
||||
@@ -31,32 +23,32 @@
|
||||
|
||||
<view class="contract-view">
|
||||
<!-- 我的合同和我的预约 -->
|
||||
<view class="contract-appointment">
|
||||
<view class="card" @click="clickNav('pages/center/contract')">
|
||||
<view class="card-title">我的合同</view>
|
||||
<view class="card-main">
|
||||
<view class="card-content">
|
||||
<view class="card-number">5</view>
|
||||
<view class="card-type">份合同</view>
|
||||
<view class="contract-appointment">
|
||||
<view class="card" @click="clickNav('pages/center/contract')">
|
||||
<view class="card-title">我的合同</view>
|
||||
<view class="card-main">
|
||||
<view class="card-content">
|
||||
<view class="card-number">5</view>
|
||||
<view class="card-type">份合同</view>
|
||||
</view>
|
||||
<view class="card-icon">
|
||||
<image src="/static/icon/sign.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-icon">
|
||||
<image src="/static/icon/sign.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="card" @click="clickNav('pages/reserve/reserveRecords')">
|
||||
<view class="card-title">我的预约</view>
|
||||
<view class="card-main">
|
||||
<view class="card-content">
|
||||
<view class="card-number">3</view>
|
||||
<view class="card-type">个预约</view>
|
||||
</view>
|
||||
<view class="card-icon">
|
||||
<image src="/static/icon/sign.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card" @click="clickNav('pages/reserve/reserveRecords')">
|
||||
<view class="card-title">我的预约</view>
|
||||
<view class="card-main">
|
||||
<view class="card-content">
|
||||
<view class="card-number">3</view>
|
||||
<view class="card-type">个预约</view>
|
||||
</view>
|
||||
<view class="card-icon">
|
||||
<image src="/static/icon/sign.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 我的服务 -->
|
||||
<view class="my-service">
|
||||
@@ -134,8 +126,8 @@
|
||||
user, // user 信息放这里即可
|
||||
show: true,
|
||||
showGetProfile: false,
|
||||
userType:'',
|
||||
oaAuth:'',
|
||||
userType: '',
|
||||
oaAuth: '',
|
||||
gridList: [{
|
||||
name: "我的合同",
|
||||
icon: "/static/icon/sign.png",
|
||||
@@ -220,7 +212,7 @@
|
||||
|
||||
onShow() {
|
||||
// this.checkToken();
|
||||
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -262,7 +254,9 @@
|
||||
})
|
||||
}
|
||||
let url = "/login/checkExpiration";
|
||||
this.$u.get(url, {}, {'WT': token}).then(obj => {
|
||||
this.$u.get(url, {}, {
|
||||
'WT': token
|
||||
}).then(obj => {
|
||||
if (obj.data) {
|
||||
uni.reLaunch({
|
||||
url: '../login/login'
|
||||
@@ -319,7 +313,9 @@
|
||||
let life = uni.getStorageSync('lifeData') || {}
|
||||
let token = life.vuex_token
|
||||
let url = "/login/userOtherInfo";
|
||||
this.$u.get(url, {}, {'WT': token}).then(obj => {
|
||||
this.$u.get(url, {}, {
|
||||
'WT': token
|
||||
}).then(obj => {
|
||||
this.userType = obj.data.userType;
|
||||
this.oaAuth = obj.data.oaAuth;
|
||||
});
|
||||
@@ -331,11 +327,11 @@
|
||||
<style lang="scss" scoped>
|
||||
.user-center {
|
||||
padding-top: 120rpx;
|
||||
background-image: url(https://eyidu.ydszw.cn/static/img/test/my-bg.png);
|
||||
background-color: #fff;
|
||||
background-repeat: space;
|
||||
background-size: 750rpx 731rpx;
|
||||
min-height: 100vh;
|
||||
background-image: url("https://eyidu.ydszw.cn/static/img/test/my-bg.png");//只支持网络图片,请自行上传至图片服务器并替换
|
||||
background-color: #fff;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 750rpx 731rpx;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 用户信息头 */
|
||||
@@ -379,11 +375,11 @@
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.contract-view{
|
||||
|
||||
.contract-view {
|
||||
width: 96%;
|
||||
margin: 0 auto;
|
||||
background-image: url("https://eyidu.ydszw.cn/static/img/test/my-bg2.png");//只支持网络图片,请自行上传至图片服务器
|
||||
background-image: url("https://eyidu.ydszw.cn/static/img/test/my-bg2.png"); //只支持网络图片,请自行上传至图片服务器并替换
|
||||
background-repeat: round;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
@@ -436,6 +436,10 @@
|
||||
padding: 40rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
|
||||
&::v-deep .u-btn {
|
||||
background: #ff3b30;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;">
|
||||
<view class="page-box">
|
||||
<view class="tabSwiper" v-for="(item, index) in dataList" :key="item.id" @click="clickContent(item)">
|
||||
<u-icon name="bell" :size="35" color="#2979ff" class="bell-icon"></u-icon>
|
||||
<u-icon name="bell" :size="35" color="#FF2F31" class="bell-icon"></u-icon>
|
||||
<view class="content-wrapper">
|
||||
<view class="top">
|
||||
<view class="title">{{ item.title }}</view>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
:key="index"
|
||||
@click="toDetail(item)"
|
||||
>
|
||||
<view class="record-icon">
|
||||
<image src="/static/icon/水费.png" class="icon-1" v-if="item.feeType=='水费'"></image>
|
||||
<image src="/static/icon/电费.png" class="icon-2" v-else></image>
|
||||
</view>
|
||||
<!-- 左侧信息 -->
|
||||
<view class="record-left">
|
||||
<text class="record-title">{{ item.feeType }}({{ item.period }})</text>
|
||||
@@ -75,7 +79,7 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.water-electric-page {
|
||||
padding: 175rpx 20rpx 20rpx 20rpx;
|
||||
padding: 120rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
.header {
|
||||
background-color: #fff;
|
||||
@@ -103,6 +107,21 @@ export default {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 24rpx 30rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.record-icon{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.icon-1{
|
||||
width: 33rpx;
|
||||
height: 47rpx;
|
||||
}
|
||||
|
||||
.icon-2{
|
||||
width: 35rpx;
|
||||
height: 57rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.record-left {
|
||||
display: flex;
|
||||
@@ -110,14 +129,14 @@ export default {
|
||||
gap: 10rpx;
|
||||
|
||||
.record-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #2D2B2C;
|
||||
}
|
||||
|
||||
.record-time {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
color: #86868C;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,8 +144,8 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
color: #222222;
|
||||
|
||||
.amount {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user