first commit
This commit is contained in:
0
pages/storage/storage.acss
Normal file
0
pages/storage/storage.acss
Normal file
3
pages/storage/storage.axml
Normal file
3
pages/storage/storage.axml
Normal file
@@ -0,0 +1,3 @@
|
||||
<view>
|
||||
<button type="primary" loading onTap="clearStorage">清除缓存并退出</button>
|
||||
</view>
|
||||
56
pages/storage/storage.js
Normal file
56
pages/storage/storage.js
Normal file
@@ -0,0 +1,56 @@
|
||||
Page({
|
||||
data: {
|
||||
|
||||
},
|
||||
onLoad(query) {
|
||||
// 页面加载
|
||||
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
|
||||
},
|
||||
onReady() {
|
||||
// 页面加载完成
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示
|
||||
},
|
||||
onHide() {
|
||||
// 页面隐藏
|
||||
},
|
||||
onUnload() {
|
||||
// 页面被关闭
|
||||
},
|
||||
onTitleClick() {
|
||||
// 标题被点击
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// 页面被下拉
|
||||
},
|
||||
onReachBottom() {
|
||||
// 页面被拉到底部
|
||||
},
|
||||
onShareAppMessage() {
|
||||
// 返回自定义分享信息
|
||||
return {
|
||||
title: 'My App',
|
||||
desc: 'My App description',
|
||||
path: 'pages/index/index',
|
||||
};
|
||||
},
|
||||
//
|
||||
clearStorage() {
|
||||
try {
|
||||
dd.clearStorageSync();
|
||||
console.log('本地缓存已清空');
|
||||
dd.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
success: () => {
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('页面跳转失败:', err);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('清空本地缓存失败', e);
|
||||
}
|
||||
}
|
||||
//
|
||||
});
|
||||
3
pages/storage/storage.json
Normal file
3
pages/storage/storage.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
Reference in New Issue
Block a user