diff --git a/app/components/func/debugPanel/index.json b/app/components/func/debugPanel/index.json
index f2858f706..d28daaa47 100644
--- a/app/components/func/debugPanel/index.json
+++ b/app/components/func/debugPanel/index.json
@@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"t-button": "../../../miniprogram_npm/tdesign/button/button",
- "t-popup": "../../../miniprogram_npm/tdesign/popup/popup"
+ "t-popup": "../../../miniprogram_npm/tdesign/popup/popup",
+ "t-dialog": "../../../miniprogram_npm/tdesign/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/app/components/func/debugPanel/index.ts b/app/components/func/debugPanel/index.ts
index 345f100d9..469af847d 100644
--- a/app/components/func/debugPanel/index.ts
+++ b/app/components/func/debugPanel/index.ts
@@ -1,3 +1,4 @@
+
export default OakComponent({
data: {
visible: false,
@@ -26,5 +27,33 @@ export default OakComponent({
onVisibleChange(e: any) {
this.setVisible(e.detail.visible);
},
+ //小程序重置
+ handleReset() {
+ this.resetInitialData();
+ const pages = getCurrentPages(); //获取加载的页面
+ const currentPage = pages[pages.length - 1]; //获取当前页面的对象
+ const url = currentPage.route; //当前页面url
+ const options = currentPage.options; //如果要获取url中所带的参数可以查看options
+ this.redirectTo(
+ {
+ url: url
+ .replace('/pages', '')
+ .replace('pages', '')
+ .replace('/index', ''),
+ },
+ options
+ );
+ this.closeDialog();
+ },
+ showDialog() {
+ this.setState({
+ dialogVisible: true,
+ });
+ },
+ closeDialog() {
+ this.setState({
+ dialogVisible: false,
+ });
+ },
},
});
diff --git a/app/components/func/debugPanel/index.wxml b/app/components/func/debugPanel/index.wxml
index 936230eb1..7455b7aa2 100644
--- a/app/components/func/debugPanel/index.wxml
+++ b/app/components/func/debugPanel/index.wxml
@@ -5,6 +5,8 @@
R
S
C
+ Reset
-
\ No newline at end of file
+
+
\ No newline at end of file