index.js 1.7 KB

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