applyFor.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import {
  2. ApiModel
  3. } from "../../utils/api";
  4. const _Http = new ApiModel;
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. requestList: [], //请求列表
  11. showBtn: -1, //选中下标
  12. pattern: false, //显示方式选择
  13. tabsList: ['商户二维码', '加入请求'], //tabs
  14. tabsIndex: 0, //tabs 选中下标
  15. joinList: [], //申请加入列表
  16. },
  17. /**
  18. * 生命周期函数--监听页面加载
  19. */
  20. onLoad: function (options) {
  21. /* 获取申请列表 */
  22. _Http.basic({
  23. "accesstoken": wx.getStorageSync('userData').token,
  24. "classname": "customer.usercenter.teammsg.teammsg",
  25. "method": "getEntryTeamApplyList",
  26. "content": {
  27. pageSize: 1000
  28. }
  29. }).then(res => {
  30. console.log("团队申请加入列表", res)
  31. if (res.msg != '成功') return wx.showToast({
  32. title: res.data,
  33. icon: "none"
  34. });
  35. this.setData({
  36. joinList: res.data
  37. })
  38. })
  39. },
  40. /* tabs切换页面 */
  41. setIndex({
  42. detail
  43. }) {
  44. this.setData({
  45. tabsIndex: detail
  46. });
  47. },
  48. /* 下拉触底 */
  49. scrolltolower() {
  50. if (!this.data.scrolltolowerThrottle) return;
  51. if (this.data.pageTotal < this.data.pageNumber) return;
  52. this.setData({
  53. scrolltolowerThrottle: false
  54. })
  55. this.getList();
  56. },
  57. /* 获得列表 */
  58. getList() {},
  59. /**
  60. * 生命周期函数--监听页面初次渲染完成
  61. */
  62. onReady: function () {
  63. },
  64. /* 选择 */
  65. showBtnIndex(e) {
  66. const {
  67. index
  68. } = e.currentTarget.dataset;
  69. if (index == this.data.showBtn) return this.setData({
  70. showBtn: -1
  71. });
  72. this.setData({
  73. pattern: false,
  74. showBtn: index,
  75. });
  76. },
  77. /* 同意 */
  78. ratify(e) {
  79. const that = this;
  80. wx.showModal({
  81. title: "提示",
  82. content: "是否同意“" + that.data.joinList[that.data.showBtn].fname + "”加入到您的团队",
  83. success: (res => {
  84. if (res.confirm) that.checkEntryTeamApply(1);
  85. })
  86. })
  87. },
  88. /* 拒绝 */
  89. refuse(e) {
  90. const that = this;
  91. wx.showModal({
  92. title: "提示",
  93. content: "是否拒绝“" + that.data.joinList[that.data.showBtn].fname + "”加入团队申请",
  94. success: (res => {
  95. if (res.confirm) that.checkEntryTeamApply(0);
  96. })
  97. })
  98. },
  99. /* 审核 */
  100. checkEntryTeamApply(isPass) {
  101. _Http.basic({
  102. "accesstoken": wx.getStorageSync('userData').token,
  103. "classname": "customer.usercenter.teammsg.teammsg",
  104. "method": "checkEntryTeamApply",
  105. "content": {
  106. "isPass": isPass,
  107. "tenterprise_userid": this.data.joinList[this.data.showBtn].tenterprise_userid,
  108. "tagentteamapplyid": this.data.joinList[this.data.showBtn].tagentteamapplyid
  109. }
  110. }).then(res => {
  111. console.log(res)
  112. })
  113. },
  114. /**
  115. * 生命周期函数--监听页面显示
  116. */
  117. onShow: function () {
  118. },
  119. /**
  120. * 生命周期函数--监听页面隐藏
  121. */
  122. onHide: function () {
  123. },
  124. /**
  125. * 生命周期函数--监听页面卸载
  126. */
  127. onUnload: function () {
  128. },
  129. /**
  130. * 页面相关事件处理函数--监听用户下拉动作
  131. */
  132. onPullDownRefresh: function () {
  133. },
  134. /**
  135. * 页面上拉触底事件的处理函数
  136. */
  137. onReachBottom: function () {
  138. },
  139. /**
  140. * 用户点击右上角分享
  141. */
  142. onShareAppMessage: function () {
  143. }
  144. })