ecUI.js 572 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. function i18(textr){
  2. return textr;
  3. }
  4. const showModal = (title, content, cb) => {
  5. title = i18(title);
  6. content = i18(content);
  7. uni.showModal({
  8. title,
  9. content,
  10. showCancel: false,
  11. complete: () => {
  12. if (cb) cb();
  13. }
  14. });
  15. };
  16. const showLoading = (title) => {
  17. title = i18(title);
  18. uni.showLoading({
  19. title,
  20. mask:true,
  21. });
  22. };
  23. const hideLoading = () => {
  24. uni.hideLoading();
  25. };
  26. // #ifdef APP
  27. export default {
  28. showModal,
  29. showLoading,
  30. hideLoading
  31. };
  32. // #endif
  33. // #ifdef MP
  34. module.exports = {
  35. showModal,
  36. showLoading,
  37. hideLoading
  38. };
  39. // #endif