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:
+16
-4
@@ -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' })
|
||||
}
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user