index_nav.vue 4.7 KB

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