commodity_card.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // components/commodity_card/commodity_card.js
  2. const { getClassifyGoods, getAllGoods } = require('../../API/appraise')
  3. Component({
  4. lifetimes: {
  5. created: function() {
  6. }
  7. },
  8. /**
  9. * 组件的属性列表
  10. * 是属性名到属性设置的映射表
  11. */
  12. properties: {
  13. comList: {
  14. type: []
  15. }
  16. },
  17. /**
  18. * 组件的初始数据
  19. */
  20. data: {
  21. imgUrl: "",
  22. price: 0,
  23. page: 1,
  24. pageSize: 6,
  25. id: 0
  26. },
  27. /**
  28. * 组件的方法列表
  29. */
  30. methods: {
  31. detailTo(e) {
  32. console.log(e.currentTarget.dataset);
  33. const id = e.currentTarget.dataset.id;
  34. const title = e.currentTarget.dataset.title;
  35. const price = e.currentTarget.dataset.price;
  36. const comImg = e.currentTarget.dataset.pic;
  37. wx.navigateTo({
  38. url: '/pages/details/details?id=' + id + '&title=' + title + '&price=' + price + '&img=' + comImg,
  39. })
  40. },
  41. }
  42. })