chore: 上线前优化 — 清理调试日志/启用组件按需注入/补全组件声明

- 移除全项目 34 处调试 console.* 输出
- project.config.json: minified true、uploadWithSourceMap false、启用 lazyCodeLoading(requiredComponents 组件按需注入)
- pages/records/records.json 补全 ui-skeleton 组件声明(此前漏声明,WXML 已使用)
- 删除根目录残留 preview-buttons.html
This commit is contained in:
2026-08-04 14:05:16 +08:00
parent b52db87ddf
commit 187c426243
14 changed files with 100 additions and 199 deletions
-1
View File
@@ -138,7 +138,6 @@ Page({
// local data silently. No toast here: empty day-leaderboard is
// normal (user didn't train today), and a toast would mislead
// them into thinking the cloud is broken.
console.warn('[leaderboard] cloud function failed, using local fallback:', err)
if (seq !== this._fetchSeq) { if (cb) cb(); return }
// 已有缓存秒显时后台刷新失败:保持旧数据,不打断用户;仅无缓存才走本地兜底。
if (cached && cached.rankedList) {
+2 -1
View File
@@ -2,7 +2,8 @@
"usingComponents": {
"calendar-heatmap": "/components/calendar-heatmap/calendar-heatmap",
"trend-chart": "/components/trend-chart/trend-chart",
"ui-card": "/components/ui-card/ui-card"
"ui-card": "/components/ui-card/ui-card",
"ui-skeleton": "/components/ui-skeleton/ui-skeleton"
},
"navigationBarTitleText": "训练记录"
}
-3
View File
@@ -187,11 +187,9 @@ Page({
try {
permanentUrl = await this._uploadAvatar(avatarUrl)
} catch (err) {
console.warn('[avatar] cloud upload failed, trying base64:', err)
try {
permanentUrl = await util.fileToDataURI(avatarUrl)
} catch (err2) {
console.warn('[avatar] base64 convert failed, saving temp URL:', err2)
permanentUrl = avatarUrl
}
}
@@ -377,7 +375,6 @@ Page({
await cloud.clearAll()
} catch (e) {
cloudClearFailed = true
console.warn('[settings] cloud clear failed:', e)
}
// 4. Reinstate default settings and streak
+2 -2
View File
@@ -286,7 +286,7 @@ Page({
if (s.vibrate === false) return
const intensity = s.vibrateIntensity || 'heavy'
const doVibrate = () => {
const fail = (err) => console.warn('[vibrate] failed:', err.errMsg || err)
const fail = (err) => {}
if (intensity === 'light') wx.vibrateShort({ type: 'light', fail })
else if (intensity === 'medium') wx.vibrateShort({ type: 'medium', fail })
else wx.vibrateLong({ fail })
@@ -452,7 +452,7 @@ Page({
// vibrateLong is the most reliable on iOS real devices; the short
// types are nicer but may be silent on some devices - user picks.
const doVibrate = () => {
const fail = (err) => console.warn('[vibrate] failed:', err.errMsg || err)
const fail = (err) => {}
if (intensity === 'light') wx.vibrateShort({ type: 'light', fail })
else if (intensity === 'medium') wx.vibrateShort({ type: 'medium', fail })
else wx.vibrateLong({ fail })