result_list.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. IsPromotion:false,
  7. },
  8. onLoad: function (options) {
  9. var that = this;
  10. var isPromotion=false;
  11. if (options.AgentCategory=="promotion"){
  12. isPromotion=true;
  13. }
  14. that.setData({
  15. Containnerheight: main.getWindowHeight(),
  16. IsPromotion:isPromotion,
  17. ListType:options.ListType,
  18. AgentCategory:options.AgentCategory,
  19. SelectMenuCss1:"selectItem",
  20. SelectMenuCss2:"",
  21. });
  22. wx.setNavigationBarTitle({
  23. title: that.data.ListType
  24. });
  25. this.getList();
  26. },
  27. getList:function(e){
  28. var that = this;
  29. var url="";
  30. if (that.data.ListType=="团队动态"){
  31. url="GetMiaoguoTeamDynamic?UserID=" + app.globalData.userInfo.UserID;
  32. }
  33. else{
  34. url="GetIntroducerUserList2?ListType="+that.data.ListType;
  35. url+="&AgentCategory="+that.data.AgentCategory;
  36. url+="&UserID=" + app.globalData.userInfo.UserID;
  37. }
  38. main.getData(url, function (data) {
  39. if (data) {
  40. if (that.data.ListType=="团队动态"){
  41. if (that.data.SelectMenuCss1=="selectItem")
  42. data.List=data.List1;
  43. else if (id==2)
  44. data.List=data.List2;
  45. }
  46. that.setData({
  47. Info:data,
  48. });
  49. }
  50. });
  51. },
  52. gotoRecord: function (e) {
  53. var that = this;
  54. var userid = e.currentTarget.dataset.userid;
  55. if (that.data.ListType=="团队动态"){
  56. wx.navigateTo({
  57. url: "user_relation?UserID="+userid,
  58. });
  59. }
  60. else{
  61. var url="GetMiaoguoAgentRecordID?AgentCategory="+that.data.AgentCategory;
  62. url+="&UserID=" + userid;
  63. main.getData(url, function (data) {
  64. if (data) {
  65. wx.navigateTo({
  66. url: "earnings_apply?RecordID="+data+"&AgentCategory="+that.data.AgentCategory,
  67. });
  68. }
  69. });
  70. }
  71. },
  72. goto: function (e) {
  73. var url = e.currentTarget.dataset.url;
  74. wx.navigateTo({
  75. url: url,
  76. });
  77. },
  78. onPullDownRefresh: function () {
  79. wx.stopPullDownRefresh();
  80. },
  81. onMenu:function(e){
  82. var that = this;
  83. var id=e.currentTarget.dataset.id;
  84. var SelectMenuCss1="",SelectMenuCss2="";
  85. if (id==1){
  86. SelectMenuCss1="selectItem";
  87. that.data.Info.List=that.data.Info.List1;
  88. }
  89. else if (id==2){
  90. SelectMenuCss2="selectItem";
  91. that.data.Info.List=that.data.Info.List2;
  92. }
  93. this.setData({
  94. SelectMenuCss1:SelectMenuCss1,
  95. SelectMenuCss2:SelectMenuCss2,
  96. Info: that.data.Info
  97. });
  98. },
  99. onShareAppMessage: function () {
  100. return {
  101. title: app.globalData.ShareTitle,
  102. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  103. imageUrl: app.globalData.ShareImage,
  104. }
  105. },
  106. })