修复收支明细日期只能选择到月

This commit is contained in:
WindowBird 2025-08-26 15:56:47 +08:00
parent 6054e64192
commit 3e2bdb482e
3 changed files with 121 additions and 22 deletions

View File

@ -15,7 +15,6 @@
<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 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>

View File

@ -0,0 +1,92 @@
<template>
<view class="layout">
<view class="navbar">
<view :style="{ height: getStatusBarHeight() + 'px' }" class="statusBar"></view>
<view
:style="{ height: getTitleBarHeight() + 'px', marginLeft: getLeftIconLeft() + 'px' }"
class="titleBar"
>
<view class="search">
<image :src="commonEnum.BACK" class="left-icon" @click="goBack"></image>
</view>
<view class="title">{{ title }}</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import {
getStatusBarHeight,
getTitleBarHeight,
getNavBarHeight,
getLeftIconLeft,
} from '@/utils/system.js'
import commonEnum from '../../enum/commonEnum'
import { navigateBack } from '../../utils/router'
defineProps({
title: {
type: String,
default: '壁纸',
},
})
function goBack() {
navigateBack(1)
console.log('666')
}
</script>
<style lang="scss" scoped>
.layout {
.navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 10;
background-color: #ff803a;
.statusBar {
}
.titleBar {
display: flex;
align-items: center;
justify-content: center;
padding: 0 30rpx;
.title {
font-size: 36rpx;
font-weight: 400;
color: #ffffff;
}
.search {
position: absolute;
left: 0;
width: 220rpx;
height: 50rpx;
margin-left: 10rpx;
color: #3d3d3d;
font-size: 28rpx;
display: flex;
align-items: center;
//background: black;
.left-icon {
margin-left: 60rpx;
width: 18rpx;
height: 32rpx;
}
}
}
}
.fill {
}
}
</style>

View File

@ -6,10 +6,17 @@
class="page" class="page"
> >
<!-- 头部区域 --> <!-- 头部区域 -->
<custom-nav-bar3 title="收支明细"></custom-nav-bar3> <custom-nav-bar4
:style="{ background: '#ff803a !important' }"
title="收支明细"
></custom-nav-bar4>
<view :style="{ height: getNavBarHeight() + 'px' }" class="fill"></view> <view :style="{ height: getNavBarHeight() + 'px' }" class="fill"></view>
<view <view
:style="{ height: getNavBarHeight() + 'px', top: getNavBarHeight() + 'px' }" :style="{
height: getNavBarHeight() + 'px',
top: getNavBarHeight() + 'px',
background: '#ff803a',
}"
class="header" class="header"
> >
<view class="all-type"> <view class="all-type">
@ -23,8 +30,8 @@
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker <picker
:end="endDate" :end="endDate"
:start="startDate"
:value="date" :value="date"
fields="month"
mode="date" mode="date"
@change="bindDateChange" @change="bindDateChange"
> >
@ -81,17 +88,18 @@ import { getNavBarHeight } from '../../utils/system'
import uniPopup from '../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue' import uniPopup from '../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
import CashFlowCard from '../../components/cashFlowCard/cashFlowCard.vue' import CashFlowCard from '../../components/cashFlowCard/cashFlowCard.vue'
import { getBalanceLogList } from '../../api/balanceLog' import { getBalanceLogList } from '../../api/balanceLog'
import CustomNavBar4 from '../../components/custom-nav-bar4/custom-nav-bar4.vue'
export default { export default {
name: 'CashFlowPage', name: 'CashFlowPage',
components: { uniPopup, CashFlowCard }, components: { CustomNavBar4, uniPopup, CashFlowCard },
data() { data() {
const currentDate = this.getDate() const currentDate = this.getDate()
return { return {
getNavBarHeight, getNavBarHeight,
expenseType: '全部类型', expenseType: '全部类型',
expenditures: '1000.00', expenditures: '',
Recorded: '1000.00', Recorded: '',
date: currentDate, date: currentDate,
startDate: this.getDate('start'), startDate: this.getDate('start'),
endDate: this.getDate('end'), endDate: this.getDate('end'),
@ -118,7 +126,6 @@ export default {
const date = new Date() const date = new Date()
let year = date.getFullYear() let year = date.getFullYear()
let month = date.getMonth() + 1 let month = date.getMonth() + 1
let day = date.getDate()
if (type === 'start') { if (type === 'start') {
year = year - 10 year = year - 10
@ -127,8 +134,7 @@ export default {
return new Date().toISOString().split('T')[0] return new Date().toISOString().split('T')[0]
} }
month = month > 9 ? month : '0' + month month = month > 9 ? month : '0' + month
day = day > 9 ? day : '0' + day return `${year}-${month}`
return `${year}-${month}-${day}`
}, },
// //
openPopup() { openPopup() {
@ -157,8 +163,8 @@ export default {
const endTime = now.toISOString().slice(0, 19).replace('T', ' ') const endTime = now.toISOString().slice(0, 19).replace('T', ' ')
const params = { const params = {
beginCreateTime: this.date + ' 00:00:01', beginCreateTime: this.date + '-01 00:00:01',
endCreateTime: endTime, endCreateTime: this.date + '-31 00:00:01',
} }
console.log('查询参数:', { console.log('查询参数:', {
@ -220,7 +226,7 @@ export default {
title: this.getTitleByBstType(log.bstType), title: this.getTitleByBstType(log.bstType),
status: this.getStatusByBstType(log.bstType), status: this.getStatusByBstType(log.bstType),
time: time, time: time,
orderNumber: log.id, orderNumber: log.bstId,
amount: log.amount, amount: log.amount,
bstType: log.bstType, // bstType: log.bstType, //
} }
@ -253,7 +259,7 @@ export default {
// //
getStatusByBstType(bstType) { getStatusByBstType(bstType) {
const statusMap = { const statusMap = {
WITHDRAW: '审核中', WITHDRAW: '',
ORDER: '', ORDER: '',
} }
return statusMap[bstType] || '' return statusMap[bstType] || ''
@ -291,9 +297,11 @@ export default {
} }
.header { .header {
z-index: 999;
//background: #13c622; //background: #13c622;
position: fixed; position: fixed;
top: 0; top: 0;
width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-left: 40rpx; padding-left: 40rpx;
@ -301,12 +309,12 @@ export default {
.all-type { .all-type {
position: relative; position: relative;
display: flex; display: flex;
width: 138px; width: 276rpx;
height: 40px; height: 65rpx;
&-img { &-img {
width: 100%; width: 276rpx;
height: 100%; height: 65rpx;
display: flex; display: flex;
text { text {
@ -314,9 +322,9 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 40px; height: 65rpx;
color: #ffffff; color: #ffffff;
line-height: 40px; line-height: 65rpx;
//border: red 1px solid; //border: red 1px solid;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -326,9 +334,9 @@ export default {
} }
.cash-flow { .cash-flow {
height: 84rpx;
display: flex; display: flex;
align-items: center; align-items: center;
//border: red 1px solid;
.date { .date {
display: flex; display: flex;
@ -337,7 +345,7 @@ export default {
image { image {
width: 19px; width: 19px;
height: 11px; height: 25rpx;
} }
} }