event.js 709 B

12345678910111213141516171819202122232425262728
  1. export default {
  2. key: {
  3. APP_SHOW: 'APP_SHOW',
  4. LOGIN: 'LOGIN',
  5. ADDRESS: 'ADDRESS',
  6. ADDRESS_SET: 'ADDRESS_SET',
  7. AWARD_REFRESH: 'AWARD_REFRESH',
  8. LANUCH_COUPON: 'LANUCH_COUPON',
  9. STORE_CHOOSE: 'STORE_CHOOSE',
  10. WEAL_REFRESH: 'WEAL_REFRESH',
  11. STORE_REFRESH: 'STORE_REFRESH',
  12. SELL_REFRESH: 'SELL_REFRESH',
  13. NUM_REFRESH: 'NUM_REFRESH'
  14. },
  15. on(key, callback) {
  16. uni.$on(key, callback)
  17. },
  18. off(key, callback) {
  19. if (key) {
  20. !!callback ? uni.$off(key, callback) : uni.$off(key)
  21. } else {
  22. uni.$off()
  23. }
  24. },
  25. emit(key, data) {
  26. uni.$emit(key, data)
  27. }
  28. }