index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. loading: true,
  5. "content": {
  6. "version": 1,
  7. nocache: true,
  8. "pageNumber": 1,
  9. "pageTotal": 1,
  10. "where": {
  11. "condition": ""
  12. },
  13. sort: []
  14. }
  15. },
  16. onLoad(options) {
  17. this.getList()
  18. getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
  19. },
  20. /* 处理筛选 */
  21. handleFilter({
  22. detail
  23. }) {
  24. console.log(detail)
  25. },
  26. getList(init = false) {
  27. if (init.detail != undefined) init = init.detail;
  28. let content = this.data.content;
  29. if (init) content.pageNumber = 1;
  30. if (content.pageNumber > content.pageTotal) return;
  31. _Http.basic({
  32. "id": 20220103140003,
  33. content
  34. }).then(res => {
  35. console.log("活动列表", res)
  36. this.selectComponent('#ListBox').RefreshToComplete();
  37. this.setData({
  38. list: res.pageNumber == 1 ? res.data : this.data.list.concat(this.data.list),
  39. "content.pageNumber": res.pageNumber + 1,
  40. "content.pageTotal": res.pageTotal,
  41. "content.sort": res.sort,
  42. loading: false
  43. })
  44. })
  45. },
  46. /* 搜索 */
  47. onSearch({
  48. detail
  49. }) {
  50. this.setData({
  51. "content.where.condition": detail
  52. });
  53. this.getList(true)
  54. },
  55. onReady() {
  56. this.setListHeight()
  57. },
  58. /* 设置页面高度 */
  59. setListHeight() {
  60. this.selectComponent("#ListBox").setHeight(".division", this);
  61. },
  62. })