index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. addContacts() {
  44. wx.navigateTo({
  45. url: `/packageA/select/contacts/select?params=${
  46. JSON.stringify({
  47. id: 20221111130704,
  48. content: {
  49. nocache: true,
  50. sa_projectid: this.data.content.sa_projectid,
  51. pageSize: 20,
  52. pageNumber: 1,
  53. pageTotal: 1,
  54. "where": {
  55. "condition": ""
  56. }
  57. }
  58. })
  59. }`,
  60. })
  61. },
  62. /* 修改总数 */
  63. changeTotal() {
  64. this.setData({
  65. "content.total": this.data.content.total - 1
  66. })
  67. }
  68. }
  69. })