index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. ownertable: null,
  5. ownerid: null,
  6. copyTeams: [], //用来本地搜索
  7. keyword: "", //搜索关键字
  8. activeNames: ["1"],
  9. },
  10. handelSubmit(userids) {
  11. const that = this;
  12. wx.showModal({
  13. title: '提示',
  14. content: '是否确认添加成员',
  15. success: ({
  16. confirm
  17. }) => {
  18. if (confirm) _Http.basic({
  19. "id": 20220930103601,
  20. "content": {
  21. "ownertable": that.data.ownertable,
  22. "ownerid": that.data.ownerid,
  23. userids
  24. }
  25. }).then(res => {
  26. console.log("添加团队成员", res)
  27. if (res.msg != '成功') return wx.showToast({
  28. title: res.data,
  29. icon: "none"
  30. });
  31. that.getList();
  32. wx.showToast({
  33. title: '添加成功',
  34. icon: "none"
  35. })
  36. getCurrentPages().forEach(v => {
  37. switch (v.__route__) {
  38. case "packageA/setclient/detail":
  39. v.getGroup();
  40. break;
  41. }
  42. })
  43. setTimeout(wx.navigateBack, 300);
  44. })
  45. }
  46. })
  47. },
  48. onLoad(options) {
  49. if (options.item) {
  50. this.setData({
  51. ...JSON.parse(options.item)
  52. });
  53. this.getList()
  54. }
  55. },
  56. onChange(event) {
  57. this.setData({
  58. activeNames: event.detail,
  59. });
  60. },
  61. toAdd() {
  62. wx.navigateTo({
  63. url: `/packageA/group/select?data=${
  64. JSON.stringify({
  65. ownertable:this.data.ownertable,
  66. ownerid:this.data.ownerid
  67. })
  68. }`,
  69. })
  70. },
  71. //获取列表
  72. getList() {
  73. _Http.basic({
  74. "id": 20220930103501,
  75. "content": {
  76. "ownertable": this.data.ownertable,
  77. "ownerid": this.data.ownerid
  78. }
  79. }).then(res => {
  80. console.log("团队成员列表", res)
  81. if (res.msg != '成功') return wx.showToast({
  82. title: res.data,
  83. icon: "none"
  84. })
  85. this.setData({
  86. teams: res.data,
  87. copyTeams: res.data.map(v => v.team)
  88. })
  89. })
  90. },
  91. onReachBottom() {
  92. this.getList();
  93. }
  94. })