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 = common.formatDateENG(EndDate, "/"); 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; for (var i = 0; i < that.data.Info.List1.length; i++) { if (that.data.Info.List1[i].Name == "有效期") { detail.EndTime = common.formatDateENG(that.data.Info.List1[i].Content,"/"); } } detail = JSON.stringify(detail); console.log(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, } }, })