index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. lifetimes: {
  32. attached: function () {
  33. getApp().globalData.Language.getLanguagePackage(this)
  34. }
  35. },
  36. methods: {
  37. getList(id, init) {
  38. let content = this.data.content;
  39. content.sys_enterpriseid = id;
  40. if (init) content.pageNumber = 1;
  41. _Http.basic({
  42. "id": "20240531165504",
  43. content
  44. }).then(res => {
  45. console.log("联系人", res)
  46. if (res.code != '1') return wx.showToast({
  47. title: res.data,
  48. icon: "none"
  49. })
  50. this.setData({
  51. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  52. "content.pageNumber": res.pageNumber + 1,
  53. "content.pageSize": res.pageSize,
  54. "content.pageTotal": res.pageTotal,
  55. "content.total": res.total,
  56. sys_enterpriseid: id
  57. })
  58. })
  59. },
  60. /* 修改总数 */
  61. changeTotal() {
  62. this.setData({
  63. "content.total": this.data.content.total - 1
  64. })
  65. }
  66. }
  67. })