ecUI.js 567 B

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