pay.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. var app = getApp();
  4. var userid = 0;
  5. Page({
  6. data: {
  7. PayPanel: 0,
  8. },
  9. onPullDownRefresh: function () {
  10. this.gotoIndex();
  11. wx.stopPullDownRefresh();
  12. },
  13. onLoad: function (options) {
  14. userid = options.UserID;
  15. var PayType = options.PayType;
  16. var EndDate = options.EndDate;
  17. this.init(PayType, EndDate);
  18. },
  19. init: function (PayType, EndDate) {
  20. var that = this;
  21. EndDate = EndDate.replace("年", "-");
  22. EndDate = EndDate.replace("月", "-");
  23. EndDate = EndDate.replace("日", "");
  24. main.getData('GetMiaoguoPayInfo3?EndDate=' + EndDate + '&PayType=' + PayType +'&UserID='+app.globalData.userInfo.UserID, function (data) {
  25. if (data) {
  26. that.setData({
  27. Info: data,
  28. });
  29. }
  30. });
  31. },
  32. payMoney: function () {
  33. var that = this;
  34. var money = this.data.Info.PayMoney;
  35. var detail = {};
  36. detail.UserID = app.globalData.userInfo.UserID;
  37. detail.Introducer = app.globalData.userInfo.Introducer;
  38. detail = JSON.stringify(detail);
  39. console.log(money);
  40. main.payMoney(7, null, money, detail,function(){
  41. that.setData({
  42. PayPanel: 1,
  43. })
  44. })
  45. },
  46. gotoIndex:function(){
  47. wx.reLaunch({
  48. url: '../index/index',
  49. })
  50. },
  51. onShareAppMessage: function () {
  52. return {
  53. title: app.globalData.ShareTitle,
  54. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  55. imageUrl: app.globalData.ShareImage,
  56. }
  57. },
  58. })