| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- IsPromotion: false,
- },
- onLoad: function (options) {
- var that = this;
- var isPromotion = false;
- var title = "秒过大使计划";
- var backColor = "#FFB808";
- var frontColor = "#000000";
- var frontColor2 = "#2e2e2e";
- if (options.AgentCategory == "promotion") {
- isPromotion = true;
- title = "秒过推广计划";
- backColor = "#FC7406";
- frontColor = "#ffffff";
- frontColor2 = "#ffffff";
- }
- that.setData({
- Containnerheight: main.getWindowHeight(),
- IsPromotion: isPromotion,
- BackColor: backColor,
- User: app.globalData.userInfo,
- AgentCategory: options.AgentCategory,
- FrontColor: frontColor2,
- });
- wx.setNavigationBarTitle({
- title: title
- });
- wx.setBackgroundColor({
- backgroundColor: backColor,
- });
- wx.setNavigationBarColor({
- backgroundColor: backColor,
- backgroundColorTop: backColor,
- backgroundColorBottom: backColor,
- frontColor: frontColor,
- });
- },
- onShow:function(){
- this.init();
- },
- init: function () {
- var that = this;
- if (that.data.AgentCategory == "promotion") {
- var url = "GetIntroducerUserList2?ListType=近期报名&AgentCategory=" + that.data.AgentCategory;
- url += "&UserID=" + app.globalData.userInfo.UserID;
- main.getData(url, function (data) {
- if (data) {
- that.setData({
- NewUserCount: data.List.length,
- });
- app.globalData.NewUserApplyArray = data;
- }
- });
- }
- //历史账单
- var url = "GetMiaoguoAgentRecordList?UserID=" + app.globalData.userInfo.UserID + "&AgentCategory=" + that.data.AgentCategory;
- main.getData(url, function (data) {
- if (data) {
- that.setData({
- Total: data.Total,
- Total1: data.Total1,
- Total2: data.Total2,
- WithdrawableEarnings: data.WithdrawableEarnings,
- });
- app.globalData.EarningsList = data;
- }
- });
- //预估新增收益
- var url = url="GetMiaoguoEstimatedNewRevenueList?AgentCategory="+that.data.AgentCategory+"&UserID=" + app.globalData.userInfo.UserID+"&IsDue=0";
- main.getData(url, function (data) {
- if (data) {
- that.setData({
- EstimatedNewRevenueTotal: Math.round(data.Total),
- });
- app.globalData.EstimatedNewRevenue = data;
- }
- });
- //可提现收益
- var url = url="GetMiaoguoEstimatedNewRevenueList?AgentCategory="+that.data.AgentCategory+"&UserID=" + app.globalData.userInfo.UserID+"&IsDue=1";
- main.getData(url, function (data) {
- if (data) {
- that.setData({
- WithdrawableEarningsTotal: Math.round(data.Total),
- });
- app.globalData.WithdrawableEarnings = data;
- }
- });
- },
- onPullDownRefresh: function () {
- wx.stopPullDownRefresh();
- this.init();
- },
- goto: function (e) {
- var url = e.currentTarget.dataset.url;
- var gotoType = e.currentTarget.dataset.type;
- if (!gotoType) {
- wx.navigateTo({
- url: url,
- });
- } else {
- wx.redirectTo({
- url: url,
- })
- }
- },
- gotoIndex: function () {
- wx.reLaunch({
- url: '../../pages/index/index',
- })
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|