newuser.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. var app = getApp();
  4. Page({
  5. data: {
  6. PanelShow: 0,
  7. ImagePath: app.globalData.uploadImageUrl,
  8. },
  9. onLoad: function (options) {
  10. var that = this;
  11. wx.getSetting({
  12. success(res) {
  13. if (res.authSetting['scope.userInfo'] || app.globalData.userInfo.IsShow == 0) {
  14. that.setData({
  15. Containnerheight: main.getWindowHeight(),
  16. });
  17. that.init();
  18. wx.setNavigationBarColor({
  19. frontColor: "#ffffff",
  20. backgroundColor: "#9BD41C",
  21. });
  22. }
  23. else {
  24. wx.navigateTo({
  25. url: '../index/accredit',
  26. });
  27. }
  28. }
  29. });
  30. },
  31. init: function () {
  32. var that = this;
  33. main.getData("GetClassList?Flag=0", function (data) {
  34. if (data && data.length>0) {
  35. that.setData({
  36. StartDate: common.formatDateCHS(data[0].StartDate),
  37. })
  38. }
  39. });
  40. },
  41. payMoney: function () {
  42. var that = this;
  43. var money = 1;
  44. var detail = {};
  45. detail.UserID = app.globalData.userInfo.UserID;
  46. detail.Introducer = app.globalData.userInfo.Introducer;
  47. detail.PayType=9;
  48. detail = JSON.stringify(detail);
  49. //console.log(detail);
  50. //console.log(money);
  51. var remark = null;
  52. main.payMoney(9, remark, money, detail, function () {
  53. that.setData({
  54. PanelShow:1,
  55. });
  56. wx.setNavigationBarColor({
  57. frontColor: "#000000",
  58. backgroundColor: "#ffffff",
  59. });
  60. });
  61. },
  62. copyManager: function () {
  63. wx.setClipboardData({
  64. data: "秒过学习法",
  65. success(res) {
  66. wx.showModal({
  67. title: '已复制',
  68. showCancel: false,
  69. content: "请在微信添加公众号中长按粘贴。",
  70. confirmText: "知道了",
  71. });
  72. }
  73. });
  74. },
  75. gotoIndex: function () {
  76. wx.reLaunch({
  77. url: '../index/index',
  78. })
  79. },
  80. onShareAppMessage: function () {
  81. return {
  82. title: app.globalData.ShareTitle,
  83. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  84. imageUrl: app.globalData.ShareImage,
  85. }
  86. },
  87. })