index.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // components/My_VerticalBox/index.js
  2. Component({
  3. options: {
  4. addGlobalClass: true,
  5. },
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. list: {
  11. type: Array
  12. },
  13. pageType: {
  14. type: String,
  15. value: 'home'
  16. }
  17. },
  18. lifetimes: {
  19. attached: function () {
  20. // 在组件实例进入页面节点树时执行
  21. console.log(this.data.list)
  22. },
  23. detached: function () {
  24. // 在组件实例被从页面节点树移除时执行
  25. },
  26. },
  27. /**
  28. * 组件的初始数据
  29. */
  30. data: {
  31. },
  32. /**
  33. * 组件的方法列表
  34. */
  35. methods: {
  36. /* 首页合作商家跳转 */
  37. homeToPage(e) {
  38. const {
  39. index
  40. } = e.currentTarget.dataset;
  41. wx.navigateTo({
  42. url: '/pages/storeMessage/storehomepage?id=' + this.data.list[index].tcooperationagentsid,
  43. })
  44. }
  45. }
  46. })