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
004a166e
Commit
004a166e
authored
Jul 31, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
abdc6cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
36 deletions
+52
-36
feedingIndex.vue
pages/feedingIndex/feedingIndex.vue
+52
-36
No files found.
pages/feedingIndex/feedingIndex.vue
View file @
004a166e
...
@@ -439,7 +439,7 @@ const $baseUrl = proxy.$baseUrl;
...
@@ -439,7 +439,7 @@ const $baseUrl = proxy.$baseUrl;
const
version
=
'v1'
const
version
=
'v1'
// 计时器上限时间(秒)
// 计时器上限时间(秒)
const
TIMER_MAX_DURATION
=
300
const
TIMER_MAX_DURATION
=
3
6
00
const
feedingIndexRes
=
{
const
feedingIndexRes
=
{
// 轮播图
// 轮播图
...
@@ -562,6 +562,15 @@ const homeData = ref({
...
@@ -562,6 +562,15 @@ const homeData = ref({
const
currentRecordId
=
ref
(
null
)
// 当前记录ID,用于区分新增和修改
const
currentRecordId
=
ref
(
null
)
// 当前记录ID,用于区分新增和修改
const
isSubmitting
=
ref
(
false
)
// 提交状态
const
isSubmitting
=
ref
(
false
)
// 提交状态
const
bannerHandler
=
(
item
)
=>
{
const
bannerHandler
=
(
item
)
=>
{
// 检查是否正在录音
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
uni
.
showToast
({
title
:
'录音进行中,不可切换页面'
,
icon
:
'none'
})
return
}
console
.
log
(
item
);
console
.
log
(
item
);
jump
({
type
:
item
.
jumpType
,
url
:
item
.
url
,
extra
:
item
.
extra
})
jump
({
type
:
item
.
jumpType
,
url
:
item
.
url
,
extra
:
item
.
extra
})
}
}
...
@@ -783,13 +792,13 @@ onShow(() => {
...
@@ -783,13 +792,13 @@ onShow(() => {
// 页面隐藏时同步计时器状态
// 页面隐藏时同步计时器状态
onHide
(()
=>
{
onHide
(()
=>
{
console
.
log
(
'页面隐藏,处理录音状态...'
)
console
.
log
(
'页面隐藏,处理录音状态...'
)
// 如果正在录音,停止录音并重置状态
// 如果正在录音,停止录音并重置状态
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
console
.
log
(
'页面隐藏时检测到正在录音,停止录音'
)
console
.
log
(
'页面隐藏时检测到正在录音,停止录音'
)
forceResetRecorderManager
()
forceResetRecorderManager
()
}
}
// 如果页面隐藏时有计时器在运行,需要同步到后端
// 如果页面隐藏时有计时器在运行,需要同步到后端
if
(
isLeftTimerRunning
.
value
&&
leftTimerInterval
)
{
if
(
isLeftTimerRunning
.
value
&&
leftTimerInterval
)
{
console
.
log
(
'页面隐藏时同步左侧计时器状态'
)
console
.
log
(
'页面隐藏时同步左侧计时器状态'
)
...
@@ -1066,6 +1075,15 @@ function resetTimerStatus() {
...
@@ -1066,6 +1075,15 @@ function resetTimerStatus() {
// 方法
// 方法
function
selectType
(
type
)
{
function
selectType
(
type
)
{
// 检查是否正在录音
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
uni
.
showToast
({
title
:
'录音进行中,不可切换类型'
,
icon
:
'none'
})
return
}
// 检查是否有正在进行的计时器(只有在真正有计时器在运行时才阻止)
// 检查是否有正在进行的计时器(只有在真正有计时器在运行时才阻止)
if
((
isLeftTimerRunning
.
value
&&
leftTimerInterval
)
||
(
isRightTimerRunning
.
value
&&
rightTimerInterval
))
{
if
((
isLeftTimerRunning
.
value
&&
leftTimerInterval
)
||
(
isRightTimerRunning
.
value
&&
rightTimerInterval
))
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -1845,6 +1863,15 @@ function goBack() {
...
@@ -1845,6 +1863,15 @@ function goBack() {
}
}
function
goToFeedingRecord
()
{
function
goToFeedingRecord
()
{
// 检查是否正在录音
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
uni
.
showToast
({
title
:
'录音进行中,不可切换页面'
,
icon
:
'none'
})
return
}
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/feedingRecord/feedingRecord'
url
:
'/pages/feedingRecord/feedingRecord'
})
})
...
@@ -2598,7 +2625,7 @@ function forceResetRecorderManager() {
...
@@ -2598,7 +2625,7 @@ function forceResetRecorderManager() {
recordingState
.
value
.
isRecording
=
false
recordingState
.
value
.
isRecording
=
false
voiceRecognitionState
.
value
.
isRecording
=
false
voiceRecognitionState
.
value
.
isRecording
=
false
voiceRecognitionState
.
value
.
recognitionStatus
=
'idle'
voiceRecognitionState
.
value
.
recognitionStatus
=
'idle'
// 检查重置后的状态
// 检查重置后的状态
checkRecorderStatus
()
checkRecorderStatus
()
},
300
)
},
300
)
...
@@ -3211,6 +3238,14 @@ async function completeVoiceRecord() {
...
@@ -3211,6 +3238,14 @@ async function completeVoiceRecord() {
// 记录成功弹窗相关方法
// 记录成功弹窗相关方法
async
function
onSuccessJump
()
{
async
function
onSuccessJump
()
{
// 检查是否正在录音
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
uni
.
showToast
({
title
:
'录音进行中,不可切换页面'
,
icon
:
'none'
})
return
}
const
res
=
await
getHealthField
();
const
res
=
await
getHealthField
();
...
@@ -3279,6 +3314,15 @@ function restoreUnfinishedEdit() {
...
@@ -3279,6 +3314,15 @@ function restoreUnfinishedEdit() {
// 宝宝切换相关方法
// 宝宝切换相关方法
function
showBabySwitch
()
{
function
showBabySwitch
()
{
// 检查是否正在录音
if
(
recordingState
.
value
.
isRecording
||
voiceRecognitionState
.
value
.
isRecording
)
{
uni
.
showToast
({
title
:
'录音进行中,不可切换宝宝'
,
icon
:
'none'
})
return
}
// 只有当有多个宝宝时才显示切换弹窗
// 只有当有多个宝宝时才显示切换弹窗
if
(
babyList
.
value
.
length
>
1
)
{
if
(
babyList
.
value
.
length
>
1
)
{
showBabySwitchPopup
.
value
=
true
showBabySwitchPopup
.
value
=
true
...
@@ -3387,15 +3431,18 @@ function loadDefaultFoodsData() {
...
@@ -3387,15 +3431,18 @@ function loadDefaultFoodsData() {
/* ===== 可滚动内容区域 ===== */
/* ===== 可滚动内容区域 ===== */
.scrollable-content
{
.scrollable-content
{
height
:
calc
(
100vh
-
218rpx
);
height
:
calc
(
100vh
-
218rpx
);
// height: 100vh;
background-color
:
#FFF8F1
;
background-color
:
#FFF8F1
;
/* 减去底部按钮的高度 */
/* 减去底部按钮的高度 */
overflow-y
:
auto
;
overflow-y
:
auto
;
z-index
:
200
;
position
:
absolute
;
}
}
/* ===== 底部完成按钮 ===== */
/* ===== 底部完成按钮 ===== */
.bottom_complete-btn
{
.bottom_complete-btn
{
padding-top
:
20rpx
;
padding-top
:
20rpx
;
position
:
fixed
;
position
:
absolute
;
bottom
:
0rpx
;
bottom
:
0rpx
;
left
:
0rpx
;
left
:
0rpx
;
right
:
0rpx
;
right
:
0rpx
;
...
@@ -3405,7 +3452,6 @@ function loadDefaultFoodsData() {
...
@@ -3405,7 +3452,6 @@ function loadDefaultFoodsData() {
background
:
#fff
;
background
:
#fff
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
z-index
:
100
;
.complete-btn-bg
{
.complete-btn-bg
{
width
:
686rpx
;
width
:
686rpx
;
...
@@ -4440,36 +4486,6 @@ function loadDefaultFoodsData() {
...
@@ -4440,36 +4486,6 @@ function loadDefaultFoodsData() {
}
}
.bottom_complete-btn
{
position
:
absolute
;
left
:
50%
;
transform
:
translateX
(
-50%
);
bottom
:
100rpx
;
width
:
686rpx
;
height
:
94rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
z-index
:
2
;
// cursor: pointer;
transition
:
all
0
.3s
ease
;
/* 移除点击高亮效果 */
-webkit-tap-highlight-color
:
transparent
;
-webkit-touch-callout
:
none
;
-webkit-user-select
:
none
;
user-select
:
none
;
&
.disabled
{
opacity
:
0
.6
;
pointer-events
:
none
;
}
.complete-btn-bg
{
position
:
absolute
;
width
:
686rpx
;
height
:
94rpx
;
}
}
// uni-datetime-picker样式覆盖(与feedingRecord页面保持一致)
// uni-datetime-picker样式覆盖(与feedingRecord页面保持一致)
::v-deep
.uni-datetime-picker--btn
{
::v-deep
.uni-datetime-picker--btn
{
...
...
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