Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
23ffa71f
Commit
23ffa71f
authored
Jul 28, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feeding
parent
b83d595c
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
352 additions
and
302 deletions
+352
-302
feedingAnalysis.vue
pages/feedingAnalysis/feedingAnalysis.vue
+333
-272
feedingRecord.vue
pages/feedingRecord/feedingRecord.vue
+19
-30
No files found.
pages/feedingAnalysis/feedingAnalysis.vue
View file @
23ffa71f
This diff is collapsed.
Click to expand it.
pages/feedingRecord/feedingRecord.vue
View file @
23ffa71f
...
...
@@ -148,32 +148,6 @@
<image
:src=
"feedingRecordRes.add_btn"
class=
"add-btn-img"
/>
</view>
<!-- 添加记录弹窗 -->
<view
class=
"popup-mask"
v-if=
"showPopup"
@
click=
"closePopup"
>
<view
class=
"popup-content"
@
click
.
stop
>
<view
class=
"popup-title"
>
添加喂养记录
</view>
<view
class=
"form-item"
>
<text
class=
"label"
>
时间:
</text>
<picker
mode=
"time"
:value=
"newRecord.time"
@
change=
"onTimeChange"
>
<view
class=
"picker"
>
{{ newRecord.time || '请选择时间' }}
</view>
</picker>
</view>
<view
class=
"form-item"
>
<text
class=
"label"
>
类型:
</text>
<picker
:range=
"feedingTypes"
@
change=
"onTypeChange"
>
<view
class=
"picker"
>
{{ newRecord.type || '请选择类型' }}
</view>
</picker>
</view>
<view
class=
"form-item"
>
<text
class=
"label"
>
内容:
</text>
<input
class=
"input"
v-model=
"newRecord.content"
placeholder=
"请输入具体内容"
maxlength=
"50"
/>
</view>
<view
class=
"popup-buttons"
>
<button
class=
"cancel-btn"
@
click=
"closePopup"
>
取消
</button>
<button
class=
"confirm-btn"
@
click=
"saveRecord"
>
保存
</button>
</view>
</view>
</view>
<!-- 编辑弹窗 -->
<view
class=
"popup-mask"
v-if=
"showEditPopup"
@
click=
"closeEditPopup"
>
...
...
@@ -198,7 +172,7 @@
</view>
<view
class=
"popup-buttons"
>
<button
class=
"cancel-btn"
@
click=
"closeEditPopup"
>
取消
</button>
<button
class=
"confirm-btn"
@
click=
"saveEditRecord"
>
保存
</button>
<button
class=
"confirm-btn"
@
click=
"saveEditRecord"
>
保存
修改
</button>
</view>
</view>
</view>
...
...
@@ -392,6 +366,10 @@ const calendarDates = computed(() => {
return
dates
})
function
goToFeedingIndex
()
{
uni
.
navigateBack
()
}
// 方法
function
createDateObject
(
date
)
{
const
today
=
new
Date
()
...
...
@@ -622,7 +600,7 @@ function editRecord(index) {
const
record
=
todayRecords
.
value
[
index
]
if
(
!
record
)
return
editForm
.
value
=
{
time
:
record
.
time
||
''
,
time
:
getCurrentTime
(),
// 使用当前时间作为最新时间
type
:
record
.
type
||
''
,
content
:
record
.
foodDetails
||
record
.
content
||
''
// 优先使用foodDetails
}
...
...
@@ -1149,7 +1127,18 @@ function formatDateTimeString(dateString, timeString) {
const
[
hours
,
minutes
]
=
timeString
.
split
(
':'
);
date
.
setHours
(
parseInt
(
hours
,
10
));
date
.
setMinutes
(
parseInt
(
minutes
,
10
));
return
date
.
toISOString
();
// 使用ISO格式的时间戳
date
.
setSeconds
(
0
);
date
.
setMilliseconds
(
0
);
// 使用本地时间而不是UTC时间,避免时区问题
const
year
=
date
.
getFullYear
();
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
);
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
'0'
);
const
hour
=
String
(
date
.
getHours
()).
padStart
(
2
,
'0'
);
const
minute
=
String
(
date
.
getMinutes
()).
padStart
(
2
,
'0'
);
const
second
=
String
(
date
.
getSeconds
()).
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
T
${
hour
}
:
${
minute
}
:
${
second
}
`
;
}
function
loadBabyFeedingRecords
(
baby
)
{
...
...
@@ -1966,7 +1955,7 @@ function testApiIntegration() {
button
{
flex
:
1
;
height
:
88rpx
;
border-radius
:
12
rpx
;
border-radius
:
50
rpx
;
font-size
:
32rpx
;
border
:
none
;
font-weight
:
600
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment