index_nav.vue 5.0 KB

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