index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import lifecycle from '/util/lifecycle';
  2. Page({
  3. ...lifecycle,
  4. data: {
  5. pageName: 'biz/index',
  6. pageInfo: {
  7. pageId: 0,
  8. },
  9. curIndex: 0,
  10. arr: {
  11. onItemTap: 'onGridItemTap',
  12. list: [{
  13. icon: '/image/biz_collapse.png',
  14. title: '折叠面板',
  15. entitle: 'Collapse',
  16. page: '/page/biz/pages/collapse/index',
  17. }, {
  18. icon: '/image/biz_dropdown.png',
  19. title: '下拉菜单',
  20. entitle: 'Dropdown',
  21. page: '/page/biz/pages/dropdown/index',
  22. }, {
  23. icon: '/image/biz_errorview.png',
  24. title: '通用错误页',
  25. entitle: 'ErrorView',
  26. page: '/page/biz/pages/error-view/index',
  27. }, {
  28. icon: '/image/biz_grid.png',
  29. title: '宫格',
  30. entitle: 'Grid',
  31. page: '/page/biz/pages/grid/index',
  32. }, {
  33. icon: '/image/biz_list.png',
  34. title: '列表',
  35. entitle: 'List',
  36. page: '/page/biz/pages/list/index',
  37. }, {
  38. icon: '/image/biz_tag.png',
  39. title: '标签',
  40. entitle: 'Tag',
  41. page: '/page/biz/pages/tag/index',
  42. }],
  43. },
  44. },
  45. onGridItemTap(e) {
  46. const page = this.data.arr.list[e.target.dataset.index].page;
  47. my.navigateTo({ url: page });
  48. },
  49. });