first commit

This commit is contained in:
2025-04-15 01:51:54 +08:00
commit 40c821350f
47 changed files with 2816 additions and 0 deletions

View File

View File

@@ -0,0 +1,3 @@
<view>
<button type="primary" loading onTap="clearStorage">清除缓存并退出</button>
</view>

56
pages/storage/storage.js Normal file
View 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);
}
}
//
});

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}