Commit 0d9a4eb3 authored by spc's avatar spc

feeding

parent be8c4f4b
......@@ -497,8 +497,8 @@ const showBabySwitchPopup = ref(false)
// 为每种喂养方式设置独立的数据 - 根据接口数据初始化
const feedingData = ref({
breastfeeding: {
leftDuration: 0,
rightDuration: 0
leftDuration: 5,
rightDuration: 5
},
bottle: {
amount: 0 // 首次默认定位到0ml
......@@ -811,8 +811,8 @@ function clearPreviousState() {
// 清空计时器状态(如果不在计时中)
if (!isLeftTimerRunning.value && !isRightTimerRunning.value) {
// 重置母乳亲喂的时长
feedingData.value.breastfeeding.leftDuration = 0
feedingData.value.breastfeeding.rightDuration = 0
feedingData.value.breastfeeding.leftDuration = 5
feedingData.value.breastfeeding.rightDuration = 5
}
// 清空其他喂养方式的数据
......@@ -838,8 +838,8 @@ function clearPreviousState() {
// 清空喂养数据(保存成功后调用)
function clearFeedingData() {
// 清空所有喂养方式的数据
feedingData.value.breastfeeding.leftDuration = 0
feedingData.value.breastfeeding.rightDuration = 0
feedingData.value.breastfeeding.leftDuration = 5
feedingData.value.breastfeeding.rightDuration = 5
feedingData.value.bottle.amount = 0
feedingData.value.formula.amount = 0
feedingData.value.food.selectedItems = []
......@@ -1147,7 +1147,7 @@ async function completeRecord() {
// 检查当前是否为语音模式(辅食除外)
const currentMethod = recordMethods.value[selectedType.value]
if (currentMethod === 'voice' && selectedType.value !== 'food') {
// 语音模式应该在语音识别弹窗中确认提交,这里不处理
// 语音模式应该在语音识别结果中确认提交,这里不处理
uni.showToast({
title: '请在语音识别结果中确认提交',
icon: 'none'
......@@ -1209,7 +1209,10 @@ async function completeRecord() {
icon: 'none'
})
} finally {
isSubmitting.value = false
// 添加2秒防连点
setTimeout(() => {
isSubmitting.value = false
}, 2000)
}
}
......@@ -2175,7 +2178,10 @@ async function completeVoiceRecord() {
icon: 'none'
})
} finally {
isSubmitting.value = false
// 添加2秒防连点
setTimeout(() => {
isSubmitting.value = false
}, 2000)
}
}
......
......@@ -1117,6 +1117,21 @@ function formatMonthString(date) {
// 移除addFeedingRecord、saveRecord、closePopup等相关方法
// 清空缓存函数
function clearCache() {
console.log('清空缓存...')
// 清空记录缓存
recordsCache.value.clear()
// 清空日历状态缓存
calendarCache.value.clear()
// 清空API数据
apiRecords.value = {}
calendarStatus.value = {}
// 清空加载状态
loadingRecords.value.clear()
loadingCalendar.value.clear()
console.log('缓存清空完成')
}
function getCurrentTime() {
const now = new Date()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment