index.js 1.5 KB

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