index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <u-cell-group :border="false">
  4. <u-cell-item v-for="(item, i) in data" :key="i" value="" @click="onClick(item)">
  5. <view class="cell-box" slot="title">
  6. <image class="img" :src="item.icon" />
  7. <text class="text">{{ item.name }}</text>
  8. </view>
  9. </u-cell-item>
  10. </u-cell-group>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. data: [
  18. {
  19. name: '我的团长',
  20. icon: '/static/icon/icon_edit.png',
  21. path: ''
  22. },
  23. {
  24. name: '团餐设置',
  25. icon: '/static/icon/icon_edit.png',
  26. path: '/pages/groupMeal/users/settings'
  27. },
  28. {
  29. name: '企业团餐设置',
  30. icon: '/static/icon/icon_edit.png',
  31. path: ''
  32. },
  33. ]
  34. }
  35. },
  36. onShow() {
  37. },
  38. methods: {
  39. onClick(e) {
  40. console.log(e)
  41. if (!e.path) return;
  42. uni.navigateTo({
  43. url: `${e.path}`
  44. });
  45. },
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .cell-box {
  51. display: flex;
  52. align-items: center;
  53. .img {
  54. width: 40rpx;
  55. height: 40rpx;
  56. margin-right: 16rpx
  57. }
  58. .text {
  59. font-weight: 400;
  60. font-size: 28rpx;
  61. color: #232832;
  62. }
  63. }
  64. </style>