index_nav.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. :style="{width:item.name=='广告管理'?'52rpx':'56rpx',height:item.name=='广告管理'?'52rpx':'56rpx',}">
  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. data() {
  26. return {
  27. dotStyle: true,
  28. swiperList: [{
  29. name: '店铺设置',
  30. url: '/static/index/shop.png',
  31. path: '/pages/store/settings'
  32. },
  33. {
  34. name: '团餐活动',
  35. url: '/static/index/groupMeal.png',
  36. path: '/pages/groupMeal/goods/list'
  37. },
  38. {
  39. name: '优惠券',
  40. url: '/static/index/coupon.png',
  41. path: '/pages/coupon/coupon'
  42. },
  43. {
  44. name: '退款管理',
  45. url: '/static/index/refund.png'
  46. },
  47. {
  48. name: '订单管理',
  49. url: '/static/index/indent.png'
  50. },
  51. // {
  52. // name: '审核查询',
  53. // url: '/static/index/audit.png',
  54. // path: '/pages/store/examine'
  55. // },
  56. {
  57. name: '提现管理',
  58. url: '/static/index/withdraw.png'
  59. },
  60. {
  61. name: '商品管理',
  62. url: '/static/index/product.png',
  63. path: '/pages/product/index'
  64. },
  65. {
  66. name: '客户评价',
  67. url: '/static/index/evaluate.png',
  68. path: '/pages/evaluate/evaluate'
  69. },
  70. {
  71. name: '广告管理',
  72. url: '/static/index/ad.png',
  73. path: '/pages/adManagement/adlist'
  74. },
  75. // {
  76. // name: '秒杀活动',
  77. // url: '/static/index/seckill.png'
  78. // },
  79. {
  80. name: '全部服务',
  81. url: '/static/index/all.png',
  82. path: '/pages/index/full'
  83. },
  84. ],
  85. // 弹窗
  86. modalText: {
  87. title: '提示',
  88. btntext: '好的',
  89. // 很抱歉,您没有通过平台审核,如有疑问请联系平台客服。
  90. content: '报名成功,请等待平台审核'
  91. },
  92. }
  93. },
  94. methods: {
  95. async jump(item) {
  96. // 需要先报名
  97. if (item.name === '团餐活动') {
  98. try {
  99. // 获取门店状态
  100. const res1 = await this.$http.get('/groupmeal/gmMerchant/queryByMerchantId?merchantId=' + uni
  101. .getStorageSync('login_user_info').merchantId);
  102. const isOpen = res1.data.result;
  103. // 门店是否关闭
  104. if (isOpen) {
  105. // 检查报名状态
  106. const res2 = await this.$http.post('/groupmeal/gmMerchantApplicationRecord/isApply', {});
  107. if (!res2.data.result) {
  108. uni.navigateTo({
  109. url: '/pages/groupMeal/goods/index'
  110. });
  111. } else {
  112. let status = res2.data.result.status;
  113. if (status == 1) {
  114. uni.navigateTo({
  115. url: item.path
  116. });
  117. } else {
  118. this.modalText.content = status == 2 ?
  119. '很抱歉,您没有通过平台审核,如有疑问请联系平台客服。' :
  120. '团餐活动报名审核中,请耐心等待';
  121. this.$refs.myModal.onOpen();
  122. }
  123. }
  124. } else {
  125. uni.showToast({
  126. icon: 'none',
  127. title: '团餐活动已关闭'
  128. });
  129. }
  130. } catch (error) {
  131. console.error('跳转出错:', error);
  132. uni.showToast({
  133. icon: 'none',
  134. title: '网络错误,请重试'
  135. });
  136. }
  137. return;
  138. }
  139. if (!item.path) return;
  140. uni.navigateTo({
  141. url: item.path
  142. });
  143. }
  144. }
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. .item {
  149. width: 100%;
  150. display: flex;
  151. flex-wrap: wrap;
  152. justify-content: space-between;
  153. padding-top: 32rpx;
  154. }
  155. .card {
  156. width: 20%;
  157. display: flex;
  158. flex-direction: column;
  159. flex-wrap: wrap;
  160. justify-content: space-between;
  161. align-items: center;
  162. font-size: 24rpx;
  163. image {
  164. width: 60rpx;
  165. height: 60rpx;
  166. margin-bottom: 8rpx;
  167. }
  168. }
  169. .card:nth-child(-n+5) {
  170. margin-bottom: 40rpx;
  171. }
  172. ::v-deep .uni-swiper-wrapper {
  173. -webkit-transform: translate3d(0px, 0, 0);
  174. -moz-transform: translate3d(0px, 0, 0);
  175. -o-transform: translate(0px, 0px);
  176. -ms-transform: translate3d(0px, 0, 0);
  177. transform: translate3d(0px, 0, 0);
  178. }
  179. </style>