buyad.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import common from '../../utils/util';
  2. import server from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. },
  7. onLoad: function (options) {
  8. this.setData({
  9. Containnerheight: common.getSystemHeight(),
  10. ProgramID: app.globalData.ProgramID,
  11. });
  12. this.init();
  13. },
  14. init:function(){
  15. var that=this;
  16. var arrProduct = wx.getStorageSync("ProductPrice");
  17. for (var i = 0; i < arrProduct.length; i++) {
  18. if (arrProduct[i].ProductNum == app.globalData.ProgramID) {
  19. that.setData({
  20. Price: Math.floor(100 * arrProduct[i].Period[0].Price) / 100,
  21. });
  22. }
  23. }
  24. },
  25. gotoOrder: function () {
  26. wx.redirectTo({
  27. url: "./order?id=" + app.globalData.ProgramID + "&paytype=3",
  28. });
  29. },
  30. gotoPackList: function () {
  31. wx.redirectTo({
  32. url: "./list?IsGift=0",
  33. });
  34. },
  35. gotoGiftList: function () {
  36. wx.redirectTo({
  37. url: "./list?IsGift=1",
  38. });
  39. },
  40. closePage:function(e){
  41. if (e.currentTarget.dataset.type){
  42. app.globalData.IsShowMiaoguo=true;
  43. wx.navigateBack({
  44. delta: 3
  45. });
  46. }
  47. else{
  48. wx.navigateBack({
  49. delta: 1
  50. });
  51. }
  52. },
  53. onShareAppMessage: function () {
  54. return {
  55. title: app.globalData.ShareTitle,
  56. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  57. imageUrl: app.globalData.ShareImage,
  58. }
  59. },
  60. })