Problem applet wx.showToast () and wx.hideLoading () conflict

 

Difference between the two balloons as shown below:

 

 Conflict:

The reason is the following error occurs when real machine simulation:

After using wx.hideLoading (), if we want to play the prompt box, you will find can be displayed in the emulator, but it is not displayed in real machine test.

Summary found because wx.showToast () and wx.hideLoading () conflict. As long as the same one wx.showModal () using the front wx.showLoading () will not show the elastic block.

wx.showLoading wx.showToast simultaneously and can only display a
wx.showLoading should wx.hideLoading paired
wx.showToast should wx.hideToast paired
wx.showLoading and can only display a wx.showToast, but using wx.hideToast or wx.hideloading can close the prompt box
solution: avoid using wx.hideLoading () in front of (the same level domain scope) showToast, because showToast itself has hidden wx.showLoading () function prompt box, if wx.hideLoading ( ), the latter will not be able to display the showToast

Guess you like

Origin www.cnblogs.com/-ting/p/12398310.html