多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
1.9 KiB

  1. <template>
  2. <view>
  3. <view class="menu-window" :class="{ 'menu-window-visible': value }">
  4. <scroll-view style="height: 100%;" scroll-y="true" class="list">
  5. <view v-for="(vo,index) in cateList" :key="index" class="navlist" @click.stop="onCateClick(vo, index)">
  6. <span :class="{active:checked == index}">{{vo.classifyName}}</span>
  7. </view>
  8. </scroll-view>
  9. </view>
  10. <view class="mask" @touchmove.prevent :hidden="value === false" @click="onClose"></view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "slide-cate",
  16. props: {
  17. value: Boolean,
  18. checked: Number,
  19. cateList: Array,
  20. },
  21. methods: {
  22. onClose() {
  23. this.$emit("input", false);
  24. },
  25. onCateClick(item, index) {
  26. this.$emit("checked", item, index);
  27. this.$emit("input", false);
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .mask {
  34. position: fixed;
  35. top: 0;
  36. left: 0;
  37. right: 0;
  38. bottom: 0;
  39. z-index: 55;
  40. background-color: rgba(0, 0, 0, 0.5);
  41. }
  42. .menu-window {
  43. display: block;
  44. position: fixed;
  45. width: 85%;
  46. height: 100%;
  47. left: 0;
  48. top: 86rpx;
  49. //background-color: #fff;
  50. background-color: rgba(255, 255, 255, 1);
  51. z-index: 999;
  52. transform: translateX(calc(-100%));
  53. transition: transform 0.3s ease;
  54. }
  55. .menu-window-visible {
  56. //z-index: 999;
  57. transform: translateX(0px);
  58. }
  59. .menu-window .list {
  60. width: 100%;
  61. display: flex;
  62. flex-direction: column;
  63. }
  64. .list{
  65. background-color: white;
  66. color: #333333;
  67. font-size: 14px;
  68. padding-bottom: 20rpx;
  69. padding-top: 20rpx;
  70. width: 710rpx;
  71. .navlist {
  72. box-sizing: border-box;
  73. border-radius: 10vw;
  74. margin-top: 20rpx;
  75. margin-right: 3vw;
  76. margin-left: 3vw;
  77. padding: 1.2vw 3vw;
  78. overflow: hidden;
  79. white-space: nowrap;
  80. text-overflow: ellipsis;
  81. transition: all linear 0.2s;
  82. }
  83. .active {
  84. background-color: #252744;
  85. border-radius: 10vw;
  86. padding: 1.2vw 3vw;
  87. color: white;
  88. margin-right: -3vw;
  89. margin-left: -3vw;
  90. }
  91. }
  92. </style>