s-menu-tools.vue 2.7 KB

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