giftinfo.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import common from '../../utils/util';
  2. import server from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. List: [],
  7. },
  8. onLoad: function (options) {
  9. this.setData({
  10. Containnerheight: common.getSystemHeight(),
  11. ProgramList: server.getProgramList(),
  12. ProgramID:app.globalData.ProgramID,
  13. canGive:false,
  14. });
  15. this.init(options.id);
  16. },
  17. init: function (id) {
  18. var that = this;
  19. var url = "GetGiftInfoByUserID500?ID=" + id + "&ProductID=" + app.globalData.ProgramID;
  20. server.getData(url, function (data) {
  21. if (data) {
  22. that.setData({
  23. GiftInfo: data,
  24. });
  25. }
  26. });
  27. },
  28. gotoFeedback: function () {
  29. server.gotoFeedback();
  30. },
  31. getRemind:function(){
  32. var that=this;
  33. wx.getSetting({
  34. success(res) {
  35. wx.showModal({
  36. title: '慎重转发',
  37. content: '请勿转发到群。如误转,只能在聊天窗口中撤回(1分钟内)。',
  38. confirmText: '知道了',
  39. showCancel: false,
  40. });
  41. that.setData({
  42. canGive: true,
  43. });
  44. }
  45. });
  46. },
  47. onShareAppMessage: function () {
  48. if (this.data.GiftInfo.PayType == 5 && this.data.GiftInfo.ExchangeUserID>0){
  49. return {
  50. title: app.globalData.ShareTitle,
  51. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  52. imageUrl: app.globalData.ShareImage,
  53. }
  54. }
  55. else{
  56. return {
  57. title: "有价商品尽快领取",
  58. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&GiftID=' + this.data.GiftInfo.ID,
  59. imageUrl: '../images/program_screenshot_giftcard.png',
  60. }
  61. }
  62. },
  63. })