Refactor: UI & Feature updates (Calculator, UnitConverter, Privacy, Cleanup)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
Page({
|
||||
data: {
|
||||
historyList: []
|
||||
},
|
||||
|
||||
onShow() {
|
||||
const list = wx.getStorageSync('CALC_HISTORY') || [];
|
||||
this.setData({
|
||||
historyList: list
|
||||
});
|
||||
},
|
||||
|
||||
clearHistory() {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '确定要清空所有记录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.removeStorageSync('CALC_HISTORY');
|
||||
this.setData({
|
||||
historyList: []
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user