|
发表于 2022-10-13 09:37:17
|
显示全部楼层
可以使用setTimeout定时刷新,
或者是以平台首页(组件版)为例,操作待办时刷新首页,待办点击事件代码如下:
_self = this;
this.define("view_pending_window_open", function (openid, idtype, callfun, callType) {
if (idtype == "work") {
window_pending_handle = _self.page.openWork(openid);
}
else if (idtype == "job") {
window_pending_handle = _self.page.openJob(openid, false);
} else {
window_pending_handle = window.open(openid);
}
if (window.pendingTimer) {
clearInterval(pendingTimer);
}
pendingTimer = setInterval(function () {
//console.log("检测中。。。")
if (window_pending_handle && window_pending_handle.closed) {
//刷新
//callfun();
//alert("closed")
if (callType == "fireclick") {
window.location.reload();
} else {
callfun();
}
clearInterval(pendingTimer);
}
}, 500);
})
var dw = _self.target.data.work;
if(dw){
var options = {
"workId": dw, "appId": "process.Work"+dw
};
}else{
dw = _self.target.data.id
var options = {
"draftId": dw, "appId": "process.Work"+dw
};
}
var _form = _self.form.getApp().appForm;
if (_form.app.inBrowser) { //浏览器模式
_self.view_pending_window_open (dw, "work","","fireclick")
}
return false; |
|