com.ts 666 B

12345678910111213141516171819202122232425262728293031
  1. const com = {
  2. complete: {
  3. async main(args: { options: IRequestOption }) {
  4. if (store.common.data.debug) {
  5. await func.awaiter()
  6. }
  7. if (args.options.ext.showLoading) {
  8. if (--com.loading.count === 0) {
  9. com.loading.hide()
  10. // if (utils.store.curPage) {
  11. // utils.store.curPage.common.show = true;
  12. // }
  13. }
  14. }
  15. },
  16. },
  17. loading: {
  18. cur: null,
  19. count: 0,
  20. show(options: IRequestOption) {
  21. com.loading.count++
  22. uni.showLoading({
  23. title: options.ext.loadingText,
  24. })
  25. },
  26. hide() {
  27. uni.hideLoading()
  28. },
  29. },
  30. }
  31. export default com