newuser.js 3.1 KB

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