newuserlist.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import common from '../../utils/util';
  2. import server from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. UserList: [],
  7. },
  8. onLoad: function (options) {
  9. this.setData({
  10. Height: common.getSystemHeight(),
  11. });
  12. this.init();
  13. },
  14. init: function () {
  15. var that = this;
  16. server.getData('GetHanziUserListByIntroducer?UserID=' + app.globalData.userInfo.UserID, function (data) {
  17. if (data) {
  18. if (data.length >= 6) {
  19. wx.removeStorageSync("IsMemberForeverRemind");
  20. wx.reLaunch({
  21. url: '../index/index'
  22. })
  23. }
  24. else {
  25. for (var i = 0; i < data.length; i++) {
  26. if (data[i].NickName == "陌生用户")
  27. data[i].NickName = "未授权";
  28. if (data[i].NickName.length > 4)
  29. data[i].NickName = data[i].NickName.substr(0, 3) + "...";
  30. }
  31. that.setData({
  32. UserList: data,
  33. });
  34. }
  35. }
  36. });
  37. },
  38. onShareAppMessage: function () {
  39. return {
  40. title: app.globalData.ShareTitle,
  41. path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
  42. imageUrl: '../../images/07001.png',
  43. }
  44. },
  45. })