Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
911a81e317
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
<t-button bind:tap="printRunningTree" t-class="btn-item" theme="primary" size="small" shape="circle">R</t-button>
|
||||
<t-button bind:tap="printDebugStore" t-class="btn-item" theme="primary" size="small" shape="circle">S</t-button>
|
||||
<t-button bind:tap="printCachedStore" t-class="btn-item" theme="primary" size="small" shape="circle">C</t-button>
|
||||
<t-button bind:tap="showDialog" t-class="btn-item" theme="danger" size="small" shape="circle">Reset</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</t-popup>
|
||||
<t-dialog visible="{{dialogVisible}}" title="重置数据" content="重置后,原来的数据不可恢复" cancel-btn="取消" confirm-btn="确定" bind:cancel="closeDialog" bind:confirm="handleReset" />
|
||||
Loading…
Reference in New Issue