业务交流通
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.

listItem.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // components/listItem/listItem.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. item: {
  8. type: Object,
  9. },
  10. // index => 首页 detatil => 详情 homepage => 个人主页
  11. pageStatus: {
  12. type: String,
  13. default: 'index',
  14. },
  15. },
  16. /**
  17. * 组件的初始数据
  18. */
  19. data: {
  20. // 是否收藏
  21. isCollect:false,
  22. },
  23. /**
  24. * 组件的方法列表
  25. */
  26. methods: {
  27. // 进入详情
  28. goDetails(e) {
  29. let dataset = e.currentTarget.dataset;
  30. this.triggerEvent('getItem', dataset.item);
  31. },
  32. // 进入个人主页
  33. goHomePage(e){
  34. let customerid = e.currentTarget.dataset.customerid;
  35. wx.navigateTo({
  36. url: '/pages/index/components/homepage/homepage',
  37. success: function (res) {
  38. // 通过eventChannel向被打开页面传送数据
  39. res.eventChannel.emit('customerid', { customerid })
  40. }
  41. })
  42. },
  43. }
  44. })