index.js 728 B

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