newuser.js 3.2 KB

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