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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // components/listItem/listItem.js
  2. const app = getApp()
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. // 数据
  9. item: {
  10. type: Object,
  11. },
  12. // index => 首页 detatil => 详情 homepage => 个人主页
  13. pageStatus: {
  14. type: String,
  15. value: 'index',
  16. },
  17. // 是否收藏
  18. isCollect: {
  19. type: Boolean,
  20. value:false,
  21. },
  22. // 是否其他查看主页---用于是否显示聊一聊
  23. isOther:{
  24. type: Boolean,
  25. value:true,
  26. },
  27. // 类名
  28. listClass: {
  29. type: String,
  30. value: "",
  31. },
  32. },
  33. /**
  34. * 组件的初始数据
  35. */
  36. data: {
  37. },
  38. /**
  39. * 组件的方法列表
  40. */
  41. methods: {
  42. // 进入详情
  43. goDetails(e) {
  44. if (this.data.listClass == 'disabled-model-view') {
  45. return
  46. }
  47. let dataset = e.currentTarget.dataset;
  48. this.triggerEvent('getItem', dataset.item);
  49. },
  50. // 进入个人主页
  51. goHomePage(e) {
  52. let customerid = e.currentTarget.dataset.customerid;
  53. wx.navigateTo({
  54. url: '/pages/index/components/homepage/homepage',
  55. success: function (res) {
  56. // 通过eventChannel向被打开页面传送数据
  57. res.eventChannel.emit('customerid', { customerid })
  58. }
  59. })
  60. },
  61. // 收藏
  62. productCollect(e) {
  63. this.triggerEvent('changeCollect');
  64. },
  65. // 聊一聊
  66. goToChat() {
  67. if (!app.globalData.customerId) {
  68. app.goLogin();
  69. return
  70. }
  71. console.log(`点击了聊一聊`)
  72. // wx.navigateTo({
  73. // url:"/pages/msgModule/wechat2/wechat2",
  74. // success: function (res) {
  75. // // 通过eventChannel向被打开页面传送数据
  76. // res.eventChannel.emit('customerid', { customerid })
  77. // }
  78. // })
  79. },
  80. }
  81. })