From 0d482e3a1c9f0ff5f47049f8e0d49c775abfc46b Mon Sep 17 00:00:00 2001 From: nepiedg <806669289@qq.com> Date: Mon, 26 Jan 2026 22:16:20 +0800 Subject: [PATCH] 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. --- api/profile.js | 2 +- api/smoke.js | 6 +- .../smoke-record-dialog.vue | 464 ++++++--- config/index.js | 6 +- docs/ALGORITHM.md | 12 +- docs/PRD.md | 17 +- docs/api.md | 186 ++-- manifest.json | 2 +- pages/index/index.vue | 20 +- pages/logs/index.vue | 4 +- pages/stats/index.vue | 893 +++++++++++++----- 11 files changed, 1103 insertions(+), 509 deletions(-) diff --git a/api/profile.js b/api/profile.js index f6f0762..bd3e216 100644 --- a/api/profile.js +++ b/api/profile.js @@ -5,5 +5,5 @@ export function getProfile() { } export function updateProfile(data) { - return request.put('/smoke/profile', data) + return request.post('/smoke/profile', data) } diff --git a/api/smoke.js b/api/smoke.js index 6779bec..3affa81 100644 --- a/api/smoke.js +++ b/api/smoke.js @@ -25,7 +25,7 @@ export function createLog(data) { } export function updateLog(id, data) { - return request.put(`/smoke/logs/${id}`, data) + return request.post(`/smoke/logs/${id}`, data) } export function deleteLog(id) { @@ -43,3 +43,7 @@ export function getAiAdvice(date) { export function unlockAiAdvice(data) { return request.post('/smoke/ai/advice_unlocks', data) } + +export function getStats(params = {}) { + return request.get('/smoke/stats', params) +} diff --git a/components/smoke-record-dialog/smoke-record-dialog.vue b/components/smoke-record-dialog/smoke-record-dialog.vue index 770cbc8..28e0025 100644 --- a/components/smoke-record-dialog/smoke-record-dialog.vue +++ b/components/smoke-record-dialog/smoke-record-dialog.vue @@ -1,62 +1,87 @@