receivedCard.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var util = require('../../../../utils/util.js');
  2. var api = require('../../../../config/api');
  3. var user = require('../../../../utils/user.js');
  4. var app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. rId: 0,
  11. userName: '',
  12. avatarUrl: '/static/images/member/get.png',
  13. plugid:'0775f898abc4d932f5e9a2f2b8f88bcb' //企微id
  14. },
  15. goIndex() {
  16. wx.switchTab({
  17. url: '/pages/index/index',
  18. })
  19. },
  20. /**
  21. * 生命周期函数--监听页面加载
  22. */
  23. onLoad: function (options) {
  24. let rid = options.rId;
  25. if (rid) {
  26. this.setData({
  27. rId: rid
  28. })
  29. }
  30. this.getReferee();
  31. },
  32. getReferee() {
  33. util.request(api.ReferrerRidInfo, {
  34. rId: this.data.rId,
  35. }, "GET")
  36. .then((res) => {
  37. if (res.errno == 0) {
  38. this.setData({
  39. userName: res.data.applyName,
  40. avatarUrl: res.data.avatar
  41. })
  42. app.globalData.recommend = {
  43. userName: res.data.applyName,
  44. avatarUrl: res.data.avatar
  45. };
  46. } else {
  47. util.showErrorToast(res.errmsg);
  48. }
  49. });
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady: function () {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function () {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function () {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function () {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage: function () {
  85. }
  86. })