32 lines
895 B
JavaScript
32 lines
895 B
JavaScript
var app = getApp()
|
||
|
||
Page({
|
||
goEntry: function () {
|
||
wx.navigateTo({ url: '/pages/entry/entry' })
|
||
},
|
||
goItems: function () {
|
||
wx.navigateTo({ url: '/pages/items/items' })
|
||
},
|
||
goTrend: function () {
|
||
wx.navigateTo({ url: '/pages/trend/trend' })
|
||
},
|
||
goDetails: function () {
|
||
wx.navigateTo({ url: '/pages/details/details' })
|
||
},
|
||
onClearAll: function () {
|
||
var that = this
|
||
wx.showModal({
|
||
title: "⚠️ 危险操作",
|
||
content: "确定要清除所有检查记录吗?\n此操作将删除所有历史数据,但保留检查项目,且不可恢复!",
|
||
confirmText: "确认清除",
|
||
confirmColor: "#e53e3e",
|
||
success: function (res) {
|
||
if (!res.confirm) return
|
||
app.globalData.records = []
|
||
app.saveData()
|
||
wx.showToast({ title: "已清除全部记录", icon: "success", duration: 1500 })
|
||
}
|
||
})
|
||
}
|
||
})
|