index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. },
  7. path: {
  8. type: String
  9. },
  10. enterprisename: {
  11. type: String
  12. },
  13. sa_customersid: {
  14. type: String
  15. }
  16. },
  17. data: {
  18. list: [],
  19. sys_enterpriseid: "",
  20. content: {
  21. "nacache": true,
  22. "pageNumber": 1,
  23. "pageSize": 20,
  24. "pageTotal": 1,
  25. "total": null,
  26. "where": {
  27. "condition": "",
  28. }
  29. },
  30. },
  31. methods: {
  32. getList(id, init) {
  33. let content = this.data.content;
  34. content.sys_enterpriseid = id;
  35. if (init) content.pageNumber = 1;
  36. _Http.basic({
  37. "id": "20240531165504",
  38. content
  39. }).then(res => {
  40. console.log("联系人", res)
  41. if (res.msg != '成功') return wx.showToast({
  42. title: res.data,
  43. icon: "none"
  44. })
  45. this.setData({
  46. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  47. "content.pageNumber": res.pageNumber + 1,
  48. "content.pageSize": res.pageSize,
  49. "content.pageTotal": res.pageTotal,
  50. "content.total": res.total,
  51. sys_enterpriseid: id
  52. })
  53. })
  54. },
  55. /* 修改总数 */
  56. changeTotal() {
  57. this.setData({
  58. "content.total": this.data.content.total - 1
  59. })
  60. }
  61. }
  62. })