| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
-
- },
- onLoad: function (options) {
- var that = this;
-
- that.setData({
- Containnerheight: main.getWindowHeight(),
- ListType:options.ListType,
- AgentCategory:options.AgentCategory,
- IsWithdraw:false,
- IsPromotion:false,
- User:app.globalData.userInfo,
- });
- wx.setNavigationBarTitle({
- title: that.data.ListType
- });
- this.getList();
- },
- getList:function(e){
- var that = this;
- var url="";
- if (that.data.ListType=="近期报名"){
- that.setData({
- Info: app.globalData.NewUserApplyArray,
- Len:app.globalData.NewUserApplyArray.List.length,
- });
- }
- else if (that.data.ListType=="预估新增收益"){
- that.setData({
- Info: app.globalData.EstimatedNewRevenue,
- Len:app.globalData.EstimatedNewRevenue.Length,
- Total:"0",
- });
- }
- else if (that.data.ListType=="可提现收益"){
- that.setData({
- Info: app.globalData.WithdrawableEarnings,
- Len:app.globalData.WithdrawableEarnings.Length,
- Total:app.globalData.WithdrawableEarnings.Total,
- });
- }
- else{
- if (that.data.ListType=="退款记录")
- url="GetRefundList?AgentCategory="+that.data.AgentCategory;
- else if (that.data.ListType=="未续费记录")
- url="GetIntroducerUserList2?ListType="+that.data.ListType;
- else if (that.data.ListType=="报名步骤没做完")
- url="GetIntroducerUserList2?ListType="+that.data.ListType;
-
- url+="&UserID=" + app.globalData.userInfo.UserID;
- main.getData(url, function (data) {
- wx.hideLoading();
- if (data) {
- that.setData({
- Info: data,
- Len:data.List.length,
- });
- }
- });
- }
- },
- showWithdraw:function(e){
- this.setData({
- IsWithdraw:!this.data.IsWithdraw,
- });
- },
- applyPay:function(e){
- var that=this;
- if (that.data.Total<1){
- wx.showToast({
- title: '不足1元不能提现',
- mask: true,
- image: "../../pages/images/universalpic_exclamation_white_120x120.png",
- });
- }
- else{
- wx.showLoading({
- title: '申请保存中',
- mask: true,
- });
- var url="ApplyWithdraw?UserID="+app.globalData.userInfo.UserID+"&AgentCategory="+that.data.AgentCategory;
- main.getData(url, function () {
- var url = "GetMiaoguoAgentRecordList?UserID=" + app.globalData.userInfo.UserID + "&AgentCategory=" + that.data.AgentCategory;
- main.getData(url, function (data) {
- if (data) {
- wx.hideLoading();
- app.globalData.EarningsList = data;
- wx.redirectTo({
- url: "earnings_list?AgentCategory="+that.data.AgentCategory,
- });
- }
- });
- });
- }
- },
- onPullDownRefresh: function () {
- wx.stopPullDownRefresh();
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|