index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. },
  5. onLoad(options) {
  6. this.setData({
  7. content: JSON.parse(options.perams)
  8. })
  9. this.getList();
  10. getApp().globalData.Language.getLanguagePackage(this, '搜索财务信息');
  11. },
  12. /* 开始搜索 */
  13. startSearch({
  14. detail
  15. }) {
  16. this.setData({
  17. "content.where.condition": detail
  18. });
  19. this.getList(true);
  20. },
  21. onClear() {
  22. this.setData({
  23. "content.where.condition": ""
  24. });
  25. this.getList(true);
  26. },
  27. /* 获取地址列表 */
  28. getList(init) {
  29. let content = this.data.content;
  30. if (init) content.pageNumber = 1;
  31. if (content.pageNumber > content.pageTotal) return;
  32. _Http.basic({
  33. "id": "20221013160602",
  34. content
  35. }).then(res => {
  36. console.log("财务信息列表", res)
  37. if (res.code != '1') return wx.showToast({
  38. title: res.data,
  39. icon: "none"
  40. })
  41. this.setData({
  42. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  43. "content.pageNumber": res.pageNumber + 1,
  44. "content.pageSize": res.pageSize,
  45. "content.pageTotal": res.pageTotal,
  46. "content.total": res.total
  47. })
  48. })
  49. },
  50. onReachBottom() {
  51. this.getList();
  52. },
  53. })