|
我写了一个函数,调用justep.Shell.fireEvent关闭页面,
Model.prototype.backBtnClick = function(event) {
justep.Shell.fireEvent('onPayPageClose');
};
关闭功能
Model.prototype.onPayPageClose = function(event){
debugger
if (this.params.paytype == 1) {
justep.Shell.closePage();
} else {
// cancel order
debugger
this.comp('messageDialog1').show();
}
Model.prototype.messageDialog1OK = function(event) {
var self = this;
justep.Baas.sendRequest({
"url" : "/app/main",
"action" : "cancelUserOrder",
"async" : false,
"params" : {
"usertoken" : localStorage.getItem("usertoken"),
"orderid" : self.orderid,
"canceltype" : 0
},
"success" : function(data) {
justep.Shell.closePage();
},
"error" : function() {
// 失败
justep.Util.hint("取消失败,请重试!");
}
});
};
}
第一次的时候,能正常弹出提示框,第二次的时候,则 this.comp('messageDialog1') 为null ,出现 cannot read property ‘show’ of null 的错误, wex5的版本是3.5,
各位大侠,怎么解决这个问题呀?
|
|