index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true
  5. },
  6. data: {
  7. sys_enterpriseid: 0,
  8. list: [],
  9. content: {
  10. "nacache": true,
  11. "pageNumber": 1,
  12. "pageSize": 15,
  13. "pageTotal": 1,
  14. "total": null,
  15. "where": {
  16. "condition": "",
  17. "workaddress": 1
  18. }
  19. }
  20. },
  21. methods: {
  22. changeTotal() {
  23. this.setData({
  24. "content.total": this.data.content.total - 1
  25. })
  26. },
  27. /* 获取地址列表 */
  28. getList(id, init) {
  29. let content = this.data.content;
  30. content.sys_enterpriseid = id;
  31. if (init) {
  32. content.pageNumber = 1
  33. content.pageTotal = 1
  34. }
  35. _Http.basic({
  36. "id": "20221022165503",
  37. content
  38. }).then(res => {
  39. console.log("地址列表", res)
  40. if (res.msg != '成功') 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.total": res.total,
  50. sys_enterpriseid: id
  51. })
  52. setTimeout(() => {
  53. this.selectComponent("#List").initRadio();
  54. }, 300)
  55. })
  56. }
  57. }
  58. })