index_nav.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/productShop.png',
  57. path: '/pages/orderingSet/index',
  58. needTopUp: true
  59. },
  60. {
  61. name: '储值管理',
  62. url: '/static/newIndex/toup.png',
  63. path: '/pages/topUp/index',
  64. needTopUp: true
  65. },
  66. {
  67. name: '广告管理',
  68. url: '/static/newIndex/ad.png',
  69. path: '/pages/adManagement/adlist'
  70. },
  71. {
  72. name: '优惠券',
  73. url: '/static/newIndex/coupon.png',
  74. path: '/pages/coupon/coupon'
  75. },
  76. {
  77. name: '客户评价',
  78. url: '/static/newIndex/evaluate.png',
  79. path: '/pages/evaluate/evaluate'
  80. },
  81. {
  82. name: '团餐设置',
  83. url: '/static/newIndex/groupMeal.png',
  84. path: '/pages/merchantDish/settings/index',
  85. needGroupMeal: true
  86. },
  87. {
  88. name: '团餐订单',
  89. url: '/static/newIndex/groupMealOrder.png',
  90. path: '/pages/merchantDish/orders/index',
  91. needGroupMeal: true
  92. },
  93. ],
  94. // 弹窗
  95. modalText: {
  96. title: '提示',
  97. btntext: '好的',
  98. content: '报名成功,请等待平台审核'
  99. },
  100. }
  101. },
  102. computed: {
  103. swiperList() {
  104. return this.baseList.filter((item) => {
  105. if (item.needTopUp && !this.showTopUp) return false;
  106. if (item.needGroupMeal && !this.showGroupMeal) return false;
  107. return true;
  108. });
  109. }
  110. },
  111. methods: {
  112. async jump(item) {
  113. if (!item.path) {
  114. uni.showToast({
  115. title: '功能暂未开放',
  116. icon: 'none'
  117. });
  118. return
  119. };
  120. if (item.type) {
  121. uni.switchTab({
  122. url: item.path
  123. })
  124. } else {
  125. uni.navigateTo({
  126. url: item.path
  127. });
  128. }
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped lang="scss">
  134. .item {
  135. width: 100%;
  136. height: 100%;
  137. display: flex;
  138. flex-wrap: wrap;
  139. column-gap: 0;
  140. }
  141. .card {
  142. width: 20%;
  143. display: flex;
  144. flex-direction: column;
  145. margin-bottom: 28rpx;
  146. justify-content: flex-start;
  147. align-items: center;
  148. font-size: 24rpx;
  149. color: #1d2129;
  150. line-height: 34rpx;
  151. image {
  152. width: 72rpx;
  153. height: 72rpx;
  154. margin-bottom: 12rpx;
  155. }
  156. }
  157. ::v-deep .uni-swiper-wrapper {
  158. -webkit-transform: translate3d(0px, 0, 0);
  159. -moz-transform: translate3d(0px, 0, 0);
  160. -o-transform: translate(0px, 0px);
  161. -ms-transform: translate3d(0px, 0, 0);
  162. transform: translate3d(0px, 0, 0);
  163. }
  164. </style>