weixinxiaochengxu/pages/home/home.js

32 lines
895 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 })
}
})
}
})