index.js 905 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {
  2. getSaleData,
  3. getIncomeList
  4. } from '~/api/sale'
  5. Page({
  6. data: {
  7. currentIndex: 1,
  8. categoryList: [{
  9. id: 1,
  10. title: '全部'
  11. }, {
  12. id: 2,
  13. title: '7日'
  14. }, {
  15. id: 3,
  16. title: '月'
  17. }, {
  18. id: 4,
  19. title: '季'
  20. }, {
  21. id: 5,
  22. title: '半年'
  23. }],
  24. allIncome: {},
  25. orderList: []
  26. },
  27. async onShow() {
  28. let allIncome = await getSaleData()
  29. let data = await getIncomeList({pageSize:1000})
  30. console.log(allIncome,data);
  31. this.setData({
  32. allIncome,
  33. orderList:data.list
  34. })
  35. },
  36. setClass({
  37. currentTarget
  38. }) {
  39. this.setData({
  40. currentIndex: currentTarget.dataset.index,
  41. });
  42. // this.resetData();
  43. },
  44. })