index.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: Boolean
  5. },
  6. data: {
  7. list: [],
  8. sa_customersid: "",
  9. content: {
  10. "nacache": true,
  11. "pageNumber": 1,
  12. "pageSize": 10,
  13. "pageTotal": 1,
  14. "total": null,
  15. "where": {
  16. "condition": "",
  17. }
  18. },
  19. },
  20. methods: {
  21. getList(id, init) {
  22. let content = this.data.content;
  23. content.sa_customersid = id;
  24. if (init) {
  25. content.pageNumber = 1
  26. content.pageTotal = 1
  27. }
  28. _Http.basic({
  29. "id": "20221208163302",
  30. content
  31. }).then(res => {
  32. console.log("线索列表", res)
  33. if (res.msg != '成功') return wx.showToast({
  34. title: res.data,
  35. icon: "none"
  36. })
  37. this.setData({
  38. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  39. "content.pageNumber": res.pageNumber + 1,
  40. "content.pageSize": res.pageSize,
  41. "content.pageTotal": res.pageTotal,
  42. "content.total": res.total,
  43. sa_customersid: id
  44. })
  45. })
  46. },
  47. /* 修改总数 */
  48. changeTotal() {
  49. this.setData({
  50. "content.total": this.data.content.total - 1
  51. })
  52. },
  53. toAdd(e) {
  54. let data = getCurrentPages()[getCurrentPages().length - 1].data.detail;
  55. wx.navigateTo({
  56. url: '/packageA/saleClue/addClue?rowData=' + JSON.stringify({
  57. enterprisename: data.enterprisename || "",
  58. city: data.city || "",
  59. county: data.county || "",
  60. province: data.province || "",
  61. address: data.address || "",
  62. cluesource: "客户:" + data.enterprisename || "",
  63. sa_customersid: data.sa_customersid
  64. }),
  65. });
  66. }
  67. }
  68. })