index_nav.vue 4.2 KB

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