applyFor.js 4.0 KB

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