s-menu-tools.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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">快捷菜单</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" @tap="onClick(item)">
  11. <image v-if="show" :src="sheep.$url.static(item.icon)" class="list-icon" />
  12. </button>
  13. <view class="list-title ss-m-t-20">{{ item.title }}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </su-popup>
  19. </template>
  20. <script setup>
  21. import { reactive, computed } from 'vue';
  22. import sheep from '@/sheep';
  23. import { showMenuTools, closeMenuTools } from '@/sheep/hooks/useModal';
  24. const show = computed(() => sheep.$store('modal').menu);
  25. function onClick(item) {
  26. closeMenuTools();
  27. if (item.url) sheep.$router.go(item.url);
  28. }
  29. const list = [
  30. {
  31. url: '/pages/index/index',
  32. icon: '/static/img/shop/tools/home.png',
  33. title: '首页',
  34. },
  35. {
  36. url: '/pages/index/search',
  37. icon: '/static/img/shop/tools/search.png',
  38. title: '搜索',
  39. },
  40. {
  41. url: '/pages/index/user',
  42. icon: '/static/img/shop/tools/user.png',
  43. title: '个人中心',
  44. },
  45. // {
  46. // url: '/pages/index/cart',
  47. // icon: '/static/img/shop/tools/cart.png',
  48. // title: '购物车',
  49. // },
  50. // {
  51. // url: '/pages/user/goods-log',
  52. // icon: '/static/img/shop/tools/browse.png',
  53. // title: '浏览记录',
  54. // },
  55. {
  56. url: '/pages/user/goods-collect',
  57. icon: '/static/img/shop/tools/collect.png',
  58. title: '我的收藏',
  59. },
  60. {
  61. url: '/pages/chat/index',
  62. icon: '/static/img/shop/tools/service.png',
  63. title: '客服',
  64. },
  65. ];
  66. </script>
  67. <style lang="scss" scoped>
  68. .tools-wrap {
  69. // background: #F0F0F0;
  70. // box-shadow: 0px 0px 28rpx 7rpx rgba(0, 0, 0, 0.13);
  71. // opacity: 0.98;
  72. // border-radius: 0 0 20rpx 20rpx;
  73. .title {
  74. font-size: 36rpx;
  75. font-weight: bold;
  76. color: #333333;
  77. }
  78. .list-item {
  79. width: calc(25vw - 20rpx);
  80. .list-image {
  81. width: 104rpx;
  82. height: 104rpx;
  83. border-radius: 52rpx;
  84. background: var(--ui-BG);
  85. .list-icon {
  86. width: 54rpx;
  87. height: 54rpx;
  88. }
  89. }
  90. .list-title {
  91. font-size: 26rpx;
  92. font-weight: 500;
  93. color: #333333;
  94. }
  95. }
  96. }
  97. .uni-popup {
  98. top: 0 !important;
  99. }
  100. :deep(.button-hover) {
  101. background: #fafafa !important;
  102. }
  103. </style>