s-menu-tools.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!-- 全局 - 快捷入口 -->
  2. <template>
  3. <su-popup :show="show" type="top" round="20" backgroundColor="#F0F0F0" @close="closeMenuTools">
  4. <su-status-bar />
  5. <view class="tools-wrap ss-m-x-30 ss-m-b-16">
  6. <view class="title ss-m-b-34 ss-p-t-20">{{$t('menu.quick_menu')}}</view>
  7. <view class="container-list ss-flex ss-flex-wrap">
  8. <view class="list-item ss-m-b-24" v-for="item in list" :key="item.title">
  9. <view class="ss-flex-col ss-col-center">
  10. <button class="ss-reset-button list-image ss-flex ss-row-center ss-col-center"
  11. @tap="onClick(item)">
  12. <image v-if="show" :src="sheep.$url.static(item.icon)" class="list-icon" />
  13. </button>
  14. <view class="list-title ss-m-t-20">{{ item.title }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </su-popup>
  20. </template>
  21. <script setup>
  22. import {
  23. reactive,
  24. computed
  25. } from 'vue';
  26. import sheep from '@/sheep';
  27. import {
  28. showMenuTools,
  29. closeMenuTools
  30. } from '@/sheep/hooks/useModal';
  31. const show = computed(() => sheep.$store('modal').menu);
  32. import {
  33. useI18n
  34. } from 'vue-i18n';
  35. const {
  36. t
  37. } = useI18n();
  38. function onClick(item) {
  39. closeMenuTools();
  40. if (item.url) sheep.$router.go(item.url);
  41. }
  42. const list = [{
  43. url: '/pages/index/index',
  44. icon: '/static/images/home.png',
  45. title: t('common.home'),
  46. },
  47. {
  48. url: '/pages/index/search',
  49. icon: '/static/images/search.png',
  50. title: t('common.search'),
  51. },
  52. {
  53. url: '/pages/index/user',
  54. icon: '/static/images/user.png',
  55. title: t('menu.personal_center'),
  56. },
  57. {
  58. url: '/pages/index/cart',
  59. icon: '/static/images/cart.png',
  60. title: t('menu.shopping_cart'),
  61. },
  62. {
  63. url: '/pages/user/goods-log',
  64. icon: '/static/images/browse.png',
  65. title: t('menu.browsing_history'),
  66. },
  67. {
  68. url: '/pages/user/goods-collect',
  69. icon: '/static/images/collect.png',
  70. title: t('menu.my_favorites'),
  71. },
  72. // {
  73. // url: '/pages/chat/index',
  74. // icon: '/static/images/service.png',
  75. // title: t('menu.customer_service'),
  76. // },
  77. ];
  78. </script>
  79. <style lang="scss" scoped>
  80. .tools-wrap {
  81. // background: #F0F0F0;
  82. // box-shadow: 0px 0px 28rpx 7rpx rgba(0, 0, 0, 0.13);
  83. // opacity: 0.98;
  84. // border-radius: 0 0 20rpx 20rpx;
  85. .title {
  86. font-size: 36rpx;
  87. font-weight: bold;
  88. color: #333333;
  89. }
  90. .list-item {
  91. width: calc(25vw - 20rpx);
  92. .list-image {
  93. width: 104rpx;
  94. height: 104rpx;
  95. border-radius: 52rpx;
  96. background: var(--ui-BG);
  97. .list-icon {
  98. width: 54rpx;
  99. height: 54rpx;
  100. }
  101. }
  102. .list-title {
  103. font-size: 26rpx;
  104. font-weight: 500;
  105. color: #333333;
  106. }
  107. }
  108. }
  109. .uni-popup {
  110. top: 0 !important;
  111. }
  112. :deep(.button-hover) {
  113. background: #fafafa !important;
  114. }
  115. </style>