56 lines
1011 B
JavaScript
56 lines
1011 B
JavaScript
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);
|
|
}
|
|
}
|
|
//
|
|
}); |