Update API endpoints and enhance UI components. Changed appid in manifest.json, modified profile and log update methods from PUT to POST in profile.js and smoke.js, respectively. Added new statistics retrieval function in smoke.js and improved the smoke record dialog with updated styles and validation logic. Updated configuration for development environment and refined documentation for health recovery and savings calculations.

This commit is contained in:
nepiedg
2026-01-26 22:16:20 +08:00
parent 35405efcdf
commit 0d482e3a1c
11 changed files with 1103 additions and 509 deletions
+16 -4
View File
@@ -155,7 +155,8 @@ const changeText = computed(() => {
})
const timerDisplay = computed(() => {
const totalSeconds = (dashboardStore.minutesSinceLast || 165) * 60 + timerSeconds.value
const baseMinutes = dashboardStore.minutesSinceLast ?? 165
const totalSeconds = baseMinutes * 60 + timerSeconds.value
const hours = Math.floor(totalSeconds / 3600)
const minutes = Math.floor((totalSeconds % 3600) / 60)
const seconds = totalSeconds % 60
@@ -203,14 +204,25 @@ function openResistedDialog() {
async function handleSubmit(submitData) {
try {
await api.createLog(submitData)
if (dialogType.value === 'smoke') {
dashboardStore.incrementTodayCount()
await api.createLog(submitData)
dashboardStore.resetTimer()
timerSeconds.value = 0
uni.showToast({ title: '记录成功', icon: 'success' })
try {
await Promise.all([
dashboardStore.fetchDashboard(true),
dashboardStore.fetchNextSmokeTime()
])
} catch (e) {
console.error('refreshAfterSmokeLog error:', e)
}
} else {
await api.createResistedLog({
smoke_time: submitData.smoke_time,
smoke_at: submitData.smoke_at,
remark: submitData.remark
})
resistedCount.value++
uni.showToast({ title: '太棒了!', icon: 'success' })
}
+2 -2
View File
@@ -196,8 +196,8 @@ function handleEdit(log) {
smoke_time_only: log.displayTime,
smoke_at: log.smoke_at,
remark: log.remark || '',
level: log.level || 2,
num: log.num || 1
level: log.level ?? 2,
num: log.num ?? 1
}
showEditDialog.value = true
}
+679 -214
View File
File diff suppressed because it is too large Load Diff