index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <u-tabbar :list="list" active-color="#449AFF" v-model="current" @change="onChange"></u-tabbar>
  3. </template>
  4. <script>
  5. export default {
  6. name: "",
  7. props: {
  8. title: {
  9. default: '',
  10. type: String
  11. },
  12. },
  13. data() {
  14. return {
  15. list: [
  16. {
  17. iconPath: "/static/groupMeal/tab_un1.png",
  18. selectedIconPath: "/static/groupMeal/tab_1.png",
  19. text: "商品",
  20. customIcon: false,
  21. urlPath: '/pages/groupMeal/goods/list'
  22. },
  23. {
  24. iconPath: "/static/groupMeal/tab_un2.png",
  25. selectedIconPath: "/static/groupMeal/tab_2.png",
  26. text: "订单",
  27. customIcon: false,
  28. urlPath: '/pages/groupMeal/orders/order-alist'
  29. },
  30. {
  31. iconPath: "/static/groupMeal/tab_un3.png",
  32. selectedIconPath: "/static/groupMeal/tab_3.png",
  33. text: "设置",
  34. customIcon: false,
  35. urlPath: '/pages/groupMeal/users/index'
  36. },
  37. ],
  38. current: 0,
  39. };
  40. },
  41. mounted() {
  42. this.current = this.list.findIndex(item => item.urlPath === this.$route.path);
  43. },
  44. methods: {
  45. onChange(e) {
  46. uni.redirectTo({
  47. url: this.list[e].urlPath
  48. });
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. ::v-deep .u-tabbar__content__item__text {
  55. bottom: 4px;
  56. }
  57. </style>