newuser.js 3.1 KB

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