refactor: ES6+ modernization + 2 bugfixes
- var→const/let, function→arrow/class across all 13 JS files - Timer: prototype→class with ES6 getters - plan days: IIFE→Array.from declarative generation - storage/plan: unified formatDate via util.js - Bugfix: getPlanDay now filters by planId (plan switch accuracy) - Bugfix: getTodayRecord searches all months (cross-month boundary) - WXML/WXSS unchanged; public API unchanged
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var themeMod = require('../utils/theme')
|
||||
const themeMod = require('../utils/theme')
|
||||
|
||||
Component({
|
||||
data: {
|
||||
@@ -7,23 +7,23 @@ Component({
|
||||
},
|
||||
|
||||
lifetimes: {
|
||||
attached: function () {
|
||||
var theme = themeMod.getCurrentTheme()
|
||||
attached() {
|
||||
const theme = themeMod.getCurrentTheme()
|
||||
this.setData({ themeStyle: themeMod.getThemeStyle(theme) })
|
||||
}
|
||||
},
|
||||
|
||||
pageLifetimes: {
|
||||
show: function () {
|
||||
var theme = themeMod.getCurrentTheme()
|
||||
show() {
|
||||
const theme = themeMod.getCurrentTheme()
|
||||
this.setData({ themeStyle: themeMod.getThemeStyle(theme) })
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
switchTab: function (e) {
|
||||
var index = e.currentTarget.dataset.index
|
||||
var pages = [
|
||||
switchTab(e) {
|
||||
const index = e.currentTarget.dataset.index
|
||||
const pages = [
|
||||
'/pages/index/index',
|
||||
'/pages/records/records',
|
||||
'/pages/settings/settings'
|
||||
|
||||
Reference in New Issue
Block a user