import common from '../../utils/util'; import main from '../../utils/main'; var app = getApp(); var userid = 0; Page({ data: { PayPanel: 0, }, onPullDownRefresh: function () { this.gotoIndex(); wx.stopPullDownRefresh(); }, onLoad: function (options) { userid = options.UserID; var PayType = options.PayType; var EndDate = options.EndDate; this.init(PayType, EndDate); }, init: function (PayType, EndDate) { var that = this; EndDate = EndDate.replace("年", "-"); EndDate = EndDate.replace("月", "-"); EndDate = EndDate.replace("日", ""); main.getData('GetMiaoguoPayInfo3?EndDate=' + EndDate + '&PayType=' + PayType +'&UserID='+app.globalData.userInfo.UserID, function (data) { if (data) { that.setData({ Info: data, }); } }); }, payMoney: function () { var that = this; var money = this.data.Info.PayMoney; var detail = {}; detail.UserID = app.globalData.userInfo.UserID; detail.Introducer = app.globalData.userInfo.Introducer; detail = JSON.stringify(detail); console.log(money); main.payMoney(7, null, money, detail,function(){ that.setData({ PayPanel: 1, }) }) }, gotoIndex:function(){ wx.reLaunch({ url: '../index/index', }) }, onShareAppMessage: function () { return { title: app.globalData.ShareTitle, path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID, imageUrl: app.globalData.ShareImage, } }, })