s-menu-tools.vue 2.8 KB

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