mui.dialog.alert.js 591 B

1234567891011121314151617181920212223242526272829
  1. (function($, window) {
  2. /**
  3. * 警告消息框
  4. */
  5. $.alert = function(message, title, btnValue, callback) {
  6. if ($.os.plus) {
  7. if (typeof message === 'undefined') {
  8. return;
  9. } else {
  10. if (typeof title === 'function') {
  11. callback = title;
  12. title = null;
  13. btnValue = '确定';
  14. } else if (typeof btnValue === 'function') {
  15. callback = btnValue;
  16. btnValue = null;
  17. }
  18. $.plusReady(function() {
  19. plus.nativeUI.alert(message, callback, title, btnValue);
  20. });
  21. }
  22. } else {
  23. //TODO H5版本
  24. window.alert(message);
  25. }
  26. };
  27. })(mui, window);