【发布时间】:2019-04-25 08:46:44
【问题描述】:
嗨,伙计们,我正在使用 nativescript 在移动应用程序中忘记密码,我想在用户在对话框中插入错误的电子邮件或错误的密码时显示警报消息,但我无法做到是否有任何机构可以提供帮助?
let options: PromptOptions = {
title: "Entrez votre nouveau mot de passe",
okButtonText: "Suivant",
cancelButtonText: "Annuler",
cancelable: true,
inputType: inputType.password,
capitalizationType: capitalizationType.none
}; prompt(options).then((pass: PromptResult) => {
if (pass.text && pass.result == true) {
let options: PromptOptions = {
title: "Entrez votre nouveau mot de passe de nouveau",
okButtonText: "Suivant",
cancelButtonText: "Annuler",
cancelable: true,
inputType: inputType.password,
capitalizationType: capitalizationType.none
}; prompt(options).then((pass2: PromptResult) => {
if (pass2.text && pass2.result == true) {
if (pass.text == pass2.text) {
this.auth.resetMDP(this.email, this.code, pass2)
.then((res: any) => {
if (res.message == 'OK')
alert('votre mot de passe a été changé avec succès')
}).catch((err: any) => { alert(err); })
} else alert("re-entrez le mot de passe correctement s'il vous plait");
}
})
}
});
因为我试图让它工作,但对话框总是关闭
【问题讨论】:
-
您的意思是,您希望对话框在按下 OK 按钮后仍保持打开状态,直到您以编程方式将其关闭?
-
我的意思是当我在警报中单击确定而不是输入对话框时保持对话框打开
-
我认为给定的 api 方法不可能,如果输入为空,您可以再次显示对话框。
-
okayyy thx.....
标签: javascript dialog nativescript alert