receivedCard.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. imgList1:[],
  15. imgList2:[]
  16. },
  17. goIndex() {
  18. wx.switchTab({
  19. url: '/pages/index/index',
  20. })
  21. },
  22. /**
  23. * 生命周期函数--监听页面加载
  24. */
  25. onLoad: function (options) {
  26. let rid = options.rId;
  27. if (rid) {
  28. this.setData({
  29. rId: rid
  30. })
  31. }
  32. this.getReferee();
  33. this.getMemberAd();
  34. },
  35. getReferee() {
  36. util.request(api.ReferrerRidInfo, {
  37. rId: this.data.rId,
  38. }, "GET")
  39. .then((res) => {
  40. if (res.errno == 0) {
  41. this.setData({
  42. userName: res.data.applyName,
  43. avatarUrl: res.data.avatar
  44. })
  45. app.globalData.recommend = {
  46. userName: res.data.applyName,
  47. avatarUrl: res.data.avatar
  48. };
  49. } else {
  50. util.showErrorToast(res.errmsg);
  51. }
  52. });
  53. },
  54. getMemberAd(){
  55. util.request(api.GetMemberAd, {
  56. },'GET')
  57. .then(res=>{
  58. if (res.errno === 0) {
  59. this.setData({
  60. imgList1:res.data.firstPurchase,
  61. imgList2:res.data.memberActivity
  62. });
  63. }
  64. });
  65. },
  66. /**
  67. * 生命周期函数--监听页面初次渲染完成
  68. */
  69. onReady: function () {
  70. },
  71. /**
  72. * 生命周期函数--监听页面显示
  73. */
  74. onShow: function () {
  75. },
  76. /**
  77. * 生命周期函数--监听页面隐藏
  78. */
  79. onHide: function () {
  80. },
  81. /**
  82. * 生命周期函数--监听页面卸载
  83. */
  84. onUnload: function () {
  85. },
  86. /**
  87. * 页面相关事件处理函数--监听用户下拉动作
  88. */
  89. onPullDownRefresh: function () {
  90. },
  91. /**
  92. * 页面上拉触底事件的处理函数
  93. */
  94. onReachBottom: function () {
  95. },
  96. /**
  97. * 用户点击右上角分享
  98. */
  99. onShareAppMessage: function () {
  100. }
  101. })