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

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