C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB

  1. const app = getApp()
  2. const Http = require("../../utils/HttpBasics");
  3. const config = require("../../config/config");
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. paramAtoB: String,
  10. from: String,
  11. data: {
  12. value: {},
  13. type: Object
  14. },
  15. },
  16. /**
  17. * 组件的初始数据
  18. */
  19. data: {
  20. mouldType: 0,
  21. mouldConfig: {},
  22. couponListShowSelled: ''
  23. },
  24. attached: function () {
  25. // 在组件实例进入页面节点树时执行
  26. if (app.globalData.mouldType) {
  27. this.setData({
  28. mouldType: app.globalData.mouldType,
  29. mouldConfig: app.globalData.mouldConfig
  30. })
  31. }
  32. Http.get({
  33. url: config.api.couponListShowSelled,
  34. }).then(res => {
  35. this.setData({
  36. couponListShowSelled: res.data || ""
  37. })
  38. }).catch(err => {
  39. })
  40. },
  41. methods: {
  42. gotoDetail(e) {
  43. let couponId = e.currentTarget.dataset.couponid;
  44. let title = e.currentTarget.dataset.title;
  45. let id = e.currentTarget.dataset.id;
  46. let targetAd = e.currentTarget.dataset.targetad;
  47. if (id && targetAd != 7) {
  48. wx.navigateTo({
  49. url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`,
  50. })
  51. } else if (targetAd == 7) {
  52. wx.navigateTo({
  53. url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`,
  54. })
  55. }
  56. }
  57. }
  58. });