other_list.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. },
  7. onLoad: function (options) {
  8. var that = this;
  9. that.setData({
  10. Containnerheight: main.getWindowHeight(),
  11. ListType:options.ListType,
  12. AgentCategory:options.AgentCategory,
  13. IsWithdraw:false,
  14. IsPromotion:false,
  15. User:app.globalData.userInfo,
  16. });
  17. wx.setNavigationBarTitle({
  18. title: that.data.ListType
  19. });
  20. this.getList();
  21. },
  22. getList:function(e){
  23. var that = this;
  24. var url="";
  25. if (that.data.ListType=="近期报名"){
  26. that.setData({
  27. Info: app.globalData.NewUserApplyArray,
  28. Len:app.globalData.NewUserApplyArray.List.length,
  29. });
  30. }
  31. else if (that.data.ListType=="预估新增收益"){
  32. that.setData({
  33. Info: app.globalData.EstimatedNewRevenue,
  34. Len:app.globalData.EstimatedNewRevenue.Length,
  35. Total:"0",
  36. });
  37. }
  38. else if (that.data.ListType=="可提现收益"){
  39. that.setData({
  40. Info: app.globalData.WithdrawableEarnings,
  41. Len:app.globalData.WithdrawableEarnings.Length,
  42. Total:app.globalData.WithdrawableEarnings.Total,
  43. });
  44. }
  45. else{
  46. if (that.data.ListType=="退款记录")
  47. url="GetRefundList?AgentCategory="+that.data.AgentCategory;
  48. else if (that.data.ListType=="未续费记录")
  49. url="GetIntroducerUserList2?ListType="+that.data.ListType;
  50. else if (that.data.ListType=="报名步骤没做完")
  51. url="GetIntroducerUserList2?ListType="+that.data.ListType;
  52. url+="&UserID=" + app.globalData.userInfo.UserID;
  53. main.getData(url, function (data) {
  54. wx.hideLoading();
  55. if (data) {
  56. that.setData({
  57. Info: data,
  58. Len:data.List.length,
  59. });
  60. }
  61. });
  62. }
  63. },
  64. showWithdraw:function(e){
  65. this.setData({
  66. IsWithdraw:!this.data.IsWithdraw,
  67. });
  68. },
  69. applyPay:function(e){
  70. var that=this;
  71. if (that.data.Total<1){
  72. wx.showToast({
  73. title: '不足1元不能提现',
  74. mask: true,
  75. image: "../../pages/images/universalpic_exclamation_white_120x120.png",
  76. });
  77. }
  78. else{
  79. wx.showLoading({
  80. title: '申请保存中',
  81. mask: true,
  82. });
  83. var url="ApplyWithdraw?UserID="+app.globalData.userInfo.UserID+"&AgentCategory="+that.data.AgentCategory;
  84. main.getData(url, function () {
  85. var url = "GetMiaoguoAgentRecordList?UserID=" + app.globalData.userInfo.UserID + "&AgentCategory=" + that.data.AgentCategory;
  86. main.getData(url, function (data) {
  87. if (data) {
  88. wx.hideLoading();
  89. app.globalData.EarningsList = data;
  90. wx.redirectTo({
  91. url: "earnings_list?AgentCategory="+that.data.AgentCategory,
  92. });
  93. }
  94. });
  95. });
  96. }
  97. },
  98. onPullDownRefresh: function () {
  99. wx.stopPullDownRefresh();
  100. },
  101. onShareAppMessage: function () {
  102. return {
  103. title: app.globalData.ShareTitle,
  104. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  105. imageUrl: app.globalData.ShareImage,
  106. }
  107. },
  108. })