mixin.js 812 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. module.exports = {
  9. computed: {
  10. $const() {
  11. return constant
  12. },
  13. $api() {
  14. return $api
  15. },
  16. $util() {
  17. return $util
  18. },
  19. $cache() {
  20. return $cache
  21. },
  22. $loading() {
  23. return function(title = '数据加载中...') {
  24. uni.showLoading({
  25. title,
  26. mask: true
  27. })
  28. }
  29. },
  30. $hideLoading() {
  31. return function() {
  32. uni.hideLoading()
  33. }
  34. },
  35. $colors() {
  36. return {
  37. main: '#652907',
  38. mainBg: '#F3F4F8',
  39. grey: '#868B91',
  40. black: '#2A211A',
  41. textBlack: '#3b434e'
  42. }
  43. }
  44. }
  45. }