C端小程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.1 KiB

  1. // components/advertisement.js
  2. const Http = require("../../utils/HttpBasics");
  3. var config = require("../../config/config.js");
  4. Component({
  5. properties: {
  6. ggdata: {
  7. type: Object,
  8. value: {}
  9. }
  10. },
  11. data: {
  12. flag: false,
  13. alphaData: null,
  14. gameUrl: ''
  15. },
  16. methods: {
  17. gotoGg: function (e) {
  18. let that = this;
  19. Http.get({
  20. url: config.api.checkPhoneStatus,
  21. data: {}
  22. })
  23. .then(res => {
  24. console.log(e.currentTarget.dataset)
  25. wx.navigateTo({
  26. url: '/pages/coupon/detail/index?couponChannelId=' + e.currentTarget.dataset.data.produceId ,
  27. })
  28. })
  29. .catch(err => {
  30. if (err.code == 11005) {
  31. // 用户手机未授权
  32. /**
  33. * 将值传到用户手机号授权的页面
  34. *
  35. */
  36. wx.redirectTo({
  37. url: "/pages/getphoneInfo/index?path=index&pagePath=" + e.currentTarget.dataset.data.pagePath + "&id=" + e.currentTarget.dataset.data.id + "&couponChannelId=" + e.currentTarget.dataset.data.produceId
  38. });
  39. } else if (err.code == 11006) {
  40. // 用户手机已加密
  41. wx.redirectTo({
  42. url: "/pages/phoneinput/phoneinput?path=index&pagePath=" + e.target.dataset.data.pagePath + "&id=" + e.currentTarget.dataset.data.id + "&couponChannelId=" + e.currentTarget.dataset.data.produceId
  43. });
  44. } else {
  45. wx.showToast({
  46. title: err.errMsg,
  47. icon: 'none',
  48. duration: 2000,
  49. mask: false
  50. });
  51. }
  52. })
  53. },
  54. a: function () {
  55. this.setData({ flag: false })
  56. },
  57. closeGg: function () {
  58. let that = this;
  59. var animation = wx.createAnimation({})
  60. // animation.opacity(0).step({ duration: 1000 })
  61. setTimeout(function () {
  62. that.setData({ flag: true })
  63. }, 500)
  64. animation.rotateZ(180).scale(0).opacity(0.5).step({ duration: 1000 })
  65. that.setData({ alphaData: animation.export() });
  66. },
  67. },
  68. });