| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- 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) {
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- userid = options.UserID;
- var PayType = options.PayType;
- if (PayType == "6") {//自定义开具
- if (options.PayUserID != app.globalData.userInfo.UserID) {
- that.setData({
- PayPanel: 2,
- });
- }
- else {
- var EndDate = common.formatTime(new Date());
- this.init(PayType, EndDate, options.Price, options.DayNumber);
- that.setData({
- Options: options,
- });
- }
- }
- else {
- var EndDate = options.EndDate;
- this.init(PayType, EndDate);
- }
- },
- init: function (PayType, EndDate, Price, DayNumber) {
- var that = this;
- EndDate = common.formatDateENG(EndDate, "/");
- var url = 'GetMiaoguoPayInfo3?EndDate=' + EndDate + '&PayType=' + PayType + '&UserID=' + app.globalData.userInfo.UserID;
- if (Price && DayNumber) {
- url += "&Price=" + Price + "&DayNumber=" + DayNumber;
- }
- main.getData(url, 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);
- var remark = null;
- if (that.data.Options && that.data.Options.Remark)
- remark = that.data.Options.Remark;
- main.payMoney(7, remark, 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,
- }
- },
- })
|