index.js 1.4 KB

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