com.ts 845 B

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