mixin.js 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Created by JianJia.Zhou<jianjia.zhou> on 2022/5/20.
  3. */
  4. import $api from '../api'
  5. import constant from './constant'
  6. import $util from './index'
  7. import $cache from './cache.js'
  8. import $setting from '../setting.js'
  9. module.exports = {
  10. computed: {
  11. $const() {
  12. return constant
  13. },
  14. $setting() {
  15. return $setting
  16. },
  17. $api() {
  18. return $api
  19. },
  20. $util() {
  21. return $util
  22. },
  23. $cache() {
  24. return $cache
  25. },
  26. $loading() {
  27. return function(title = '数据加载中...') {
  28. uni.showLoading({
  29. title,
  30. mask: true
  31. })
  32. }
  33. },
  34. $hideLoading() {
  35. return function() {
  36. uni.hideLoading()
  37. }
  38. },
  39. $colors() {
  40. return {
  41. bgColor: '#ffffff',
  42. primaryColor: '#030303',
  43. infoColor: '#333333'
  44. }
  45. }
  46. }
  47. }