【发布时间】:2017-09-20 22:19:40
【问题描述】:
对于在第二个渐进分析屏幕event==='afterSubmit' 上单击提交按钮后的 JS 自定义事件,整个事件不断重复,直到我关闭它。我正在使用e.stopImmediatePropagation(); 来阻止此事件,但它没有任何提示?
【问题讨论】:
标签: gigya
对于在第二个渐进分析屏幕event==='afterSubmit' 上单击提交按钮后的 JS 自定义事件,整个事件不断重复,直到我关闭它。我正在使用e.stopImmediatePropagation(); 来阻止此事件,但它没有任何提示?
【问题讨论】:
标签: gigya
我看到的一件事是,由于您正在使用 afterSubmit 事件,并在其中调用 accounts.showScreenSet ,每次您在新屏幕上按下提交时,它都会再次调用该事件。这可能不是想要的行为。
其次,最好仅在您检查的字段为空而不是满时才触发屏幕。现在的方式意味着如果用户已经填写了该字段,屏幕将始终触发。
你可以试试这个:
if (e.eventName === 'afterSubmit') {
alert('afterSubmit Fired');
if (typeof (e.profile.zip) !== 'undefined') {
if ((e.profile.zip == '') || (e.profile.zip == null)) {
alert('Yo 2nd step..');
alert('Zip is empty, please fill out your zipcode on the next screen');
gigya.accounts.showScreenSet({
screenSet: 'New-RegistrationLogin',
startScreen: 'Bio'
});
}
}
}
此外,在向现有用户的个人资料添加其他信息时,建议最佳做法是使用 ProfileUpdate 屏幕集中的屏幕,而不是 RegistrationLogin 屏幕集中的屏幕。
【讨论】: