newuser.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. var app = getApp();
  4. var backgroundAudioManager;
  5. Page({
  6. data: {
  7. PanelShow: 0,
  8. IsShowPay:false,
  9. IsShowMore:false,
  10. IsPlay:false,
  11. ImagePath: app.globalData.uploadImageUrl,
  12. officialAccounts:app.globalData.officialAccounts,
  13. },
  14. onLoad: function (options) {
  15. var that = this;
  16. backgroundAudioManager = wx.getBackgroundAudioManager();
  17. that.setData({
  18. Containnerheight: main.getWindowHeight(),
  19. NoButton:options.nobutton
  20. });
  21. that.init(options.index);
  22. },
  23. init: function (index) {
  24. var that = this;
  25. if (!index)
  26. index=0;
  27. main.getData("GetMiaoguoNewUserImageList3126", function (data) {
  28. that.setData({
  29. List: data[index].Images,
  30. List2:data[1].Images,
  31. PageIndex:index,
  32. });
  33. wx.setNavigationBarTitle({
  34. title: data[index].Name
  35. });
  36. if (app.globalData.IsIPhoneX) {
  37. that.setData({
  38. IsIPad: "_IPhoneX",
  39. });
  40. }
  41. });
  42. if (wx.setNavigationBarColor) {
  43. wx.setNavigationBarColor({
  44. frontColor: "#000000",
  45. backgroundColor: "#ffffff",
  46. })
  47. }
  48. },
  49. goto: function (e) {
  50. var url = e.currentTarget.dataset.url;
  51. wx.navigateTo({
  52. url: url,
  53. });
  54. },
  55. showPay:function(){
  56. var that = this;
  57. main.getData("GetClassList?Flag=0", function (data) {
  58. if (data && data.length>0) {
  59. var startDate=common.formatDateCHS(data[0].StartDate);
  60. that.setData({
  61. IsShowPay:true,
  62. StartDate: startDate,
  63. })
  64. }
  65. });
  66. },
  67. hidePay:function(){
  68. this.setData({
  69. IsShowPay:false,
  70. });
  71. },
  72. payMoney: function () {
  73. var that = this;
  74. var money = 1;
  75. var detail = {};
  76. detail.UserID = app.globalData.userInfo.UserID;
  77. detail.Introducer = app.globalData.userInfo.Introducer;
  78. detail.PayType=9;
  79. detail = JSON.stringify(detail);
  80. //console.log(detail);
  81. //console.log(money);
  82. var remark = null;
  83. main.payMoney(9, remark, money, detail, function () {
  84. that.setData({
  85. PanelShow:1,
  86. });
  87. wx.setNavigationBarColor({
  88. frontColor: "#000000",
  89. backgroundColorTop: "#ffffff",
  90. backgroundColor: "#ffffff",
  91. });
  92. if (app.globalData.userInfo.NickName=="陌生用户" && app.globalData.userInfo.IsShow == 1){
  93. wx.navigateTo({
  94. url: '../other/grade',
  95. });
  96. }
  97. });
  98. },
  99. gotoIndex: function () {
  100. wx.reLaunch({
  101. url: '../index/index',
  102. })
  103. },
  104. play:function(){
  105. var that=this;
  106. var isPlay=!that.data.IsPlay;
  107. if (isPlay){
  108. that.data.List[10].Image="bm_sy_banner-zc_pause.png";
  109. backgroundAudioManager.title = "暖暖爸致辞";
  110. backgroundAudioManager.src = app.globalData.uploadImageUrl+"web/_lesson/nuannuanbazhici.m4a";
  111. }
  112. else{
  113. that.data.List[10].Image="bm_sy_banner-zc_play.png";
  114. backgroundAudioManager.pause();
  115. }
  116. that.setData({
  117. List:that.data.List,
  118. IsPlay:isPlay,
  119. });
  120. },
  121. onShareAppMessage: function () {
  122. return {
  123. title: app.globalData.ShareTitle,
  124. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  125. imageUrl: app.globalData.ShareImage,
  126. }
  127. },
  128. })