index_nav.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="item">
  3. <view class="card" v-for="(item,index) in swiperList" :key="index" @click="jump(item)">
  4. <image :src="item.url" mode="aspectFill"></image>
  5. {{item.name}}
  6. </view>
  7. <!-- 弹窗 -->
  8. <Modal ref="myModal" :title="modalText.title" :content="modalText.content" :showCancelButton="false" />
  9. </view>
  10. </template>
  11. <script>
  12. import Modal from '@/components/modal/index.vue';
  13. export default {
  14. name: 'indexNav',
  15. components: {
  16. Modal,
  17. },
  18. props: {
  19. /** 行业是否为美食(由分类准入接口控制) */
  20. showTopUp: {
  21. type: Boolean,
  22. default: false
  23. },
  24. /** 是否展示团餐设置/团餐订单(isApply 审核通过才展示) */
  25. showGroupMeal: {
  26. type: Boolean,
  27. default: false
  28. }
  29. },
  30. data() {
  31. return {
  32. baseList: [{
  33. name: '店铺设置',
  34. url: '/static/newIndex/shop.png',
  35. path: '/pages/store/settings'
  36. },
  37. {
  38. name: '菜品管理',
  39. url: '/static/newIndex/productShop.png',
  40. path: '/pages/merchantDish/dish/list',
  41. needTopUp: true
  42. },
  43. {
  44. name: '商品管理',
  45. url: '/static/newIndex/product.png',
  46. path: '/pages/product/index'
  47. },
  48. {
  49. name: '门店管理',
  50. url: '/static/newIndex/store.png',
  51. path: '/pages/index/shop',
  52. needTopUp: true
  53. },
  54. {
  55. name: '储值管理',
  56. url: '/static/newIndex/toup.png',
  57. path: '/pages/topUp/index',
  58. needTopUp: true
  59. },
  60. {
  61. name: '广告管理',
  62. url: '/static/newIndex/ad.png',
  63. path: '/pages/adManagement/adlist'
  64. },
  65. {
  66. name: '优惠券',
  67. url: '/static/newIndex/coupon.png',
  68. path: '/pages/coupon/coupon'
  69. },
  70. {
  71. name: '客户评价',
  72. url: '/static/newIndex/evaluate.png',
  73. path: '/pages/evaluate/evaluate'
  74. },
  75. {
  76. name: '团餐设置',
  77. url: '/static/newIndex/groupMeal.png',
  78. path: '/pages/merchantDish/settings/index',
  79. needGroupMeal: true
  80. },
  81. {
  82. name: '团餐订单',
  83. url: '/static/newIndex/groupMealOrder.png',
  84. path: '/pages/merchantDish/orders/index',
  85. needGroupMeal: true
  86. },
  87. ],
  88. // 弹窗
  89. modalText: {
  90. title: '提示',
  91. btntext: '好的',
  92. content: '报名成功,请等待平台审核'
  93. },
  94. }
  95. },
  96. computed: {
  97. swiperList() {
  98. return this.baseList.filter((item) => {
  99. if (item.needTopUp && !this.showTopUp) return false;
  100. if (item.needGroupMeal && !this.showGroupMeal) return false;
  101. return true;
  102. });
  103. }
  104. },
  105. methods: {
  106. async jump(item) {
  107. if (!item.path) {
  108. uni.showToast({
  109. title: '功能暂未开放',
  110. icon: 'none'
  111. });
  112. return
  113. };
  114. if (item.type) {
  115. uni.switchTab({
  116. url: item.path
  117. })
  118. } else {
  119. uni.navigateTo({
  120. url: item.path
  121. });
  122. }
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped lang="scss">
  128. .item {
  129. width: 100%;
  130. height: 100%;
  131. display: flex;
  132. flex-wrap: wrap;
  133. column-gap: 0;
  134. }
  135. .card {
  136. width: 20%;
  137. display: flex;
  138. flex-direction: column;
  139. margin-bottom: 28rpx;
  140. justify-content: flex-start;
  141. align-items: center;
  142. font-size: 24rpx;
  143. color: #1d2129;
  144. line-height: 34rpx;
  145. image {
  146. width: 72rpx;
  147. height: 72rpx;
  148. margin-bottom: 12rpx;
  149. }
  150. }
  151. ::v-deep .uni-swiper-wrapper {
  152. -webkit-transform: translate3d(0px, 0, 0);
  153. -moz-transform: translate3d(0px, 0, 0);
  154. -o-transform: translate(0px, 0px);
  155. -ms-transform: translate3d(0px, 0, 0);
  156. transform: translate3d(0px, 0, 0);
  157. }
  158. </style>