index.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. sa_projectid: String,
  5. disabled: Boolean
  6. },
  7. data: {
  8. "sa_projectid": 1,
  9. "content": {
  10. "nocache": true,
  11. "sa_projectid": 1,
  12. pageNumbe: 1,
  13. pageTotal: 1,
  14. total: null,
  15. "where": {
  16. "conditino": ""
  17. }
  18. }
  19. },
  20. methods: {
  21. /* 获取地址列表 */
  22. getList(id, init) {
  23. let content = this.data.content;
  24. content.sa_projectid = id;
  25. if (init) content.pageNumber = 1
  26. _Http.basic({
  27. "id": "20221111131004",
  28. content
  29. }).then(res => {
  30. console.log("关联联系人列表", res)
  31. if (res.msg != '成功') return wx.showToast({
  32. title: res.data,
  33. icon: "none"
  34. })
  35. this.setData({
  36. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  37. "content.pageNumber": res.pageNumber + 1,
  38. "content.pageSize": res.pageSize,
  39. "content.pageTotal": res.pageTotal,
  40. "content.sa_projectid": id,
  41. "content.total": res.total,
  42. sa_projectid: id,
  43. })
  44. })
  45. },
  46. /* 修改总数 */
  47. changeTotal() {
  48. this.setData({
  49. "content.total": this.data.content.total - 1
  50. })
  51. }
  52. }
  53. })