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.

60 lines
1.1 KiB

  1. const Http = require("../../utils/HttpBasics");
  2. const config = require("../../config/config");
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. businessList: {
  9. type: Array,
  10. value: []
  11. },
  12. businessData: {
  13. type: Array,
  14. value: []
  15. },
  16. },
  17. /**
  18. * 组件的初始数据
  19. */
  20. data: {
  21. classIndex: 0,
  22. couponListShowSelled: ""
  23. },
  24. /**
  25. * 组件的方法列表
  26. */
  27. methods: {
  28. goDetail(e) {
  29. let couponChannelId = e.currentTarget.dataset.id
  30. let couponId = e.currentTarget.dataset.couponid
  31. wx.navigateTo({
  32. url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
  33. })
  34. },
  35. setIndex(e) {
  36. let index = e.currentTarget.dataset.index
  37. let id = e.currentTarget.dataset.id
  38. this.triggerEvent('businessid', id)
  39. this.setData({
  40. classIndex: index
  41. })
  42. },
  43. },
  44. attached() {
  45. Http.get({
  46. url: config.api.couponListShowSelled,
  47. }).then(res => {
  48. this.setData({
  49. couponListShowSelled: res.data || ""
  50. })
  51. }).catch(err => {
  52. })
  53. }
  54. })