commodity_card.js 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. const id = e.currentTarget.dataset.id;
  33. const title = e.currentTarget.dataset.title;
  34. const price = e.currentTarget.dataset.price;
  35. const comImg = e.currentTarget.dataset.pic;
  36. wx.navigateTo({
  37. url: '/pages/details/details?id=' + id + '&title=' + title + '&price=' + price + '&img=' + comImg,
  38. })
  39. },
  40. }
  41. })