fxmember.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. const app = getApp()
  2. const WXAPI = require('apifm-wxapi')
  3. const AUTH = require('../../../utils/auth')
  4. const wxpay = require('../../../utils/pay.js')
  5. const APP = getApp()
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. level:0,
  12. description:''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. var level = options.level;
  19. if(level==0){
  20. wx.setNavigationBarTitle({
  21. title: '团队长列表',
  22. })
  23. this.setData({
  24. description:'暂无团队长'
  25. })
  26. }
  27. if(level==1){
  28. wx.setNavigationBarTitle({
  29. title: '团员列表',
  30. })
  31. this.setData({
  32. description:'暂无团员'
  33. })
  34. }
  35. AUTH.checkHasLogined().then(isLogined => {
  36. console.log("用到了1")
  37. this.setData({
  38. wxlogin: isLogined
  39. })
  40. if (isLogined) {
  41. this.fxMembers(level)
  42. }
  43. })
  44. },
  45. /**
  46. * 生命周期函数--监听页面初次渲染完成
  47. */
  48. onReady: function () {
  49. },
  50. /**
  51. * 生命周期函数--监听页面显示
  52. */
  53. onShow: function () {
  54. },
  55. getUserApiInfo: function () {
  56. var that = this;
  57. WXAPI.userDetail(wx.getStorageSync('token')).then(function (res) {
  58. if (res.code == 0) {
  59. let _data = {}
  60. _data.apiUserInfoMap = res.data
  61. if (res.data.base.mobile) {
  62. _data.userMobile = res.data.base.mobile
  63. }
  64. if (that.data.order_hx_uids && that.data.order_hx_uids.indexOf(res.data.base.id) != -1) {
  65. _data.canHX = true // 具有扫码核销的权限
  66. }
  67. const adminUserIds = wx.getStorageSync('adminUserIds')
  68. if (adminUserIds && adminUserIds.indexOf(res.data.base.id) != -1) {
  69. _data.isAdmin = true
  70. }
  71. if (res.data.peisongMember && res.data.peisongMember.status == 1) {
  72. _data.memberChecked = false
  73. } else {
  74. _data.memberChecked = true
  75. }
  76. that.setData(_data);
  77. that.commision();
  78. }
  79. })
  80. },
  81. cancelLogin() {
  82. wx.switchTab({
  83. url: '/pages/my/index'
  84. })
  85. },
  86. processLogin(e) {
  87. if (!e.detail.userInfo) {
  88. wx.showToast({
  89. title: '已取消',
  90. icon: 'none',
  91. })
  92. return;
  93. }
  94. AUTH.register(this);
  95. },
  96. async fxMembers(level){
  97. const res = await WXAPI.partnerMembers({
  98. token:wx.getStorageSync('token'),
  99. type:level
  100. })
  101. if(res.code==0){
  102. this.setData({
  103. memberList:res.data
  104. })
  105. }
  106. console.log("fxmenber",res)
  107. }
  108. })