收支明细界面,card的组件抽离0.9

This commit is contained in:
WindowBird 2025-08-18 14:39:34 +08:00
parent b3ce16a6cb
commit 8ea7ad979f
2 changed files with 29 additions and 24 deletions

View File

@ -7,7 +7,7 @@
<view class="card-in">¥{{ cardData.inflow.toFixed(2) }}</view> <view class="card-in">¥{{ cardData.inflow.toFixed(2) }}</view>
</view> </view>
</view> </view>
<view class="card-item" v-for="(item, index) in cardData.items" :key="index"> <view v-for="(item, index) in cardData.items" :key="index" class="card-item">
<view class="card-item-cash-info"> <view class="card-item-cash-info">
<view class="card-icon"> <view class="card-icon">
<image :src="getIconByTitle(item.title)" mode="aspectFit" /> <image :src="getIconByTitle(item.title)" mode="aspectFit" />
@ -15,7 +15,7 @@
<view class="card-item-detail"> <view class="card-item-detail">
<view class="card-item-title"> <view class="card-item-title">
<view class="left">{{ item.title }}</view> <view class="left">{{ item.title }}</view>
<view class="right" v-if="item.status">{{ item.status }}</view> <view v-if="item.status" class="right">{{ item.status }}</view>
</view> </view>
<view class="card-item-body"> <view class="card-item-body">
<view class="card-time">{{ item.time }}</view> <view class="card-time">{{ item.time }}</view>
@ -24,7 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="number" :class="item.amount >= 0 ? 'positive' : 'negative'"> <view :class="item.amount >= 0 ? 'positive' : 'negative'" class="number">
{{ item.amount >= 0 ? '+' : '' }}¥{{ Math.abs(item.amount).toFixed(2) }} {{ item.amount >= 0 ? '+' : '' }}¥{{ Math.abs(item.amount).toFixed(2) }}
</view> </view>
</view> </view>
@ -39,20 +39,20 @@ export default {
props: { props: {
cardData: { cardData: {
type: Object, type: Object,
required: true required: true,
} },
}, },
methods: { methods: {
getIconByTitle(title) { getIconByTitle(title) {
// //
const iconMap = { const iconMap = {
'提现': commonEnum.WITHDRAW, 提现: commonEnum.WITHDRAW,
'订单': commonEnum.ORDER_NUMBER, 订单: commonEnum.ORDER_NUMBER,
// //
} }
return iconMap[title] || '' return iconMap[title] || ''
} },
} },
} }
</script> </script>
@ -89,7 +89,7 @@ export default {
.card-out { .card-out {
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
&::before { &::before {
content: '出 '; content: '出 ';
color: #666; color: #666;
@ -99,7 +99,7 @@ export default {
.card-in { .card-in {
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
&::before { &::before {
content: '入 '; content: '入 ';
color: #666; color: #666;
@ -113,9 +113,10 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
width: 100%; width: 100%;
margin-top: 20rpx;
padding: 20rpx 0; padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
background: #f7f7f7;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
@ -127,18 +128,19 @@ export default {
flex: 1; flex: 1;
.card-icon { .card-icon {
width: 60rpx; width: 80rpx;
height: 60rpx; height: 80rpx;
border-radius: 50%;
margin-right: 20rpx; margin-right: 20rpx;
border: 2rpx dashed #ccc; //border: 2rpx dashed #ccc;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
image { image {
width: 40rpx; width: 80rpx;
height: 40rpx; height: 80rpx;
border-radius: 50%;
} }
} }
@ -184,7 +186,7 @@ export default {
.order-number { .order-number {
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #f15a04;
} }
} }
} }
@ -195,6 +197,7 @@ export default {
font-weight: bold; font-weight: bold;
color: #333; color: #333;
text-align: right; text-align: right;
padding-right: 20rpx;
&.positive { &.positive {
color: #ff803a; color: #ff803a;
@ -206,4 +209,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -15,7 +15,8 @@
</image> </image>
</view> </view>
<view class="cash-flow"> <view class="cash-flow">
<view class="uni-list-cell"> <view class="date">
<view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker <picker
:end="endDate" :end="endDate"
@ -78,8 +79,8 @@ export default {
return { return {
getNavBarHeight, getNavBarHeight,
expenseType: '全部类型', expenseType: '全部类型',
expenditures: '', expenditures: '1000.00',
Recorded: '', Recorded: '1000.00',
date: currentDate, date: currentDate,
startDate: this.getDate('start'), startDate: this.getDate('start'),
endDate: this.getDate('end'), endDate: this.getDate('end'),
@ -137,7 +138,7 @@ export default {
title: '订单', title: '订单',
time: '15:22', time: '15:22',
orderNumber: '213646848744124758', orderNumber: '213646848744124758',
amount: 200.0, amount: 200000.0,
}, },
], ],
}, },
@ -247,6 +248,7 @@ export default {
.cash-flow-detail { .cash-flow-detail {
margin-left: 22rpx; margin-left: 22rpx;
color: white; color: white;
font-size: 24rpx;
} }
} }
} }