contacts.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. content: {
  5. nocache: true,
  6. pageNumber: 1,
  7. pageSize: 20,
  8. ownertable: "",
  9. ownerid: "",
  10. pageTotal: 1,
  11. total: 0,
  12. where: {
  13. "condition": "",
  14. }
  15. },
  16. list: [],
  17. },
  18. getList(init = false) {
  19. _Http.init(this.data.content, init).then(content => {
  20. _Http.basic({
  21. "id": 20240531152004,
  22. content
  23. }).then(res => {
  24. this.selectComponent('#ListBox').RefreshToComplete();
  25. console.log("通讯录列表", res)
  26. if (res.code != '1') return wx.showToast({
  27. title: res.data,
  28. icon: "none"
  29. });
  30. this.setData({
  31. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  32. content: _Http.paging(content, res),
  33. })
  34. })
  35. })
  36. },
  37. onLoad(options) {
  38. this.getList();
  39. getApp().globalData.Language.getLanguagePackage(this, '选择联系人');
  40. },
  41. onClick(e) {
  42. const {
  43. item
  44. } = e.currentTarget.dataset;
  45. getApp().globalData.handleSelect(item)
  46. },
  47. onSearch({
  48. detail
  49. }) {
  50. this.setData({
  51. 'content.where.condition': detail ? detail : ""
  52. });
  53. this.getList(true);
  54. },
  55. onClear() {
  56. this.setData({
  57. 'content.where.condition': ""
  58. });
  59. this.getList(true);
  60. },
  61. })