index.js 769 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import event from '~/mixins/event'
  2. import reachBottom from '~/mixins/reachBottom';
  3. import {
  4. getSaleOrder
  5. } from '~/api/sale'
  6. Page({
  7. behaviors: [reachBottom,event],
  8. data: {
  9. currentIndex: '',
  10. categoryList: [{
  11. id: '',
  12. title: '全部'
  13. }, {
  14. id: 1,
  15. title: '已付款'
  16. }, {
  17. id: 2,
  18. title: '退单'
  19. }, ]
  20. },
  21. onLoad(options) {
  22. this.resetData();
  23. },
  24. loadMore() {
  25. this.getData(getSaleOrder, {
  26. status: this.data.currentIndex
  27. });
  28. },
  29. setClass({
  30. currentTarget
  31. }) {
  32. this.setData({
  33. currentIndex: currentTarget.dataset.index,
  34. });
  35. this.resetData();
  36. },
  37. })