index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <u-navbar :border-bottom="false" :is-back="false" title-color="#2b85e4" title=" " :background="nav_background">
  4. <view class="tabs-ul">
  5. <block v-for="(item, index) in list" :key="index">
  6. <view v-if="$accessCheck($Access[item.access])" @click="tabChange(index)" :class="[tab_current === index ? 'tabs-on' : '']" class="tabs-li">
  7. {{ item.label }}
  8. </view>
  9. </block>
  10. </view>
  11. </u-navbar>
  12. <view v-if="tab_current === 0 && $accessCheck($Access['orderQuery'])">
  13. <OrderList :customerData="customerData" :shopData="shopData" :paymentData="paymentData" :customerTypeData="customerTypeData" :staffData="staffData"></OrderList>
  14. </view>
  15. <view v-else-if="tab_current === 1 && $accessCheck($Access['ReturnWarehousingOrder'])"><OrderReturn :shopData="shopData" :staffData="staffData"></OrderReturn></view>
  16. <view v-else class="empty-view"><u-empty text="没有权限" mode="order"></u-empty></view>
  17. <!-- 底部tabbar -->
  18. <Tabbar v-model="tabbar_current"></Tabbar>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapActions } from 'vuex';
  23. import OrderReturn from './OrderReturn.vue';
  24. import OrderList from './OrderList.vue';
  25. export default {
  26. components: {
  27. OrderReturn,
  28. OrderList
  29. },
  30. data() {
  31. return {
  32. tabbar_current: 1,
  33. nav_background: {
  34. backgroundColor: '#ffffff'
  35. },
  36. tab_current: 0, // 页面current 0,订单,1,退货单
  37. list: [
  38. {
  39. label: '订单',
  40. access: 'orderQuery'
  41. },
  42. {
  43. label: '退货单',
  44. access: 'ReturnWarehousingOrder'
  45. }
  46. ],
  47. customerData: '',
  48. shopData: '',
  49. paymentData: '',
  50. staffData: '',
  51. customerTypeData: '',
  52. search_data: {}
  53. };
  54. },
  55. onLoad() {
  56. if (!this.$store.state.hasLogin) {
  57. this.logout();
  58. }
  59. },
  60. methods: {
  61. ...mapActions({
  62. logout: 'logout'
  63. }),
  64. tabChange(index) {
  65. this.tab_current = index;
  66. }
  67. }
  68. };
  69. </script>
  70. <style scoped lang="scss">
  71. .tabs-ul {
  72. color: #ffffff;
  73. // border: 1px solid rgba($color: #ffffff, $alpha: 0.7);
  74. // border-right:1rpx solid #F1F1F1;
  75. // border-left:1rpx solid #F1F1F1;
  76. display: flex;
  77. width: 280rpx;
  78. height: 64rpx;
  79. font-size: 28rpx;
  80. font-weight: 500;
  81. line-height: 60rpx;
  82. color: #ffffff;
  83. background-color: #4076d6;
  84. position: absolute;
  85. /* #ifdef MP*/
  86. right: 20rpx;
  87. /*#endif*/
  88. /* #ifdef H5 || APP-PLUS*/
  89. left: 50%;
  90. transform: translateX(-50%);
  91. /*#endif*/
  92. border-radius: 32rpx;
  93. // color: #FFFFFF;
  94. // background-color: #4076D6;
  95. .tabs-li {
  96. flex: 2;
  97. text-align: center;
  98. }
  99. .tabs-on {
  100. background-color: #ffffff;
  101. border-radius: 32rpx;
  102. color: #62738e;
  103. border-right: 1rpx solid #f1f1f1;
  104. border-left: 1rpx solid #f1f1f1;
  105. font-size: 32rpx;
  106. }
  107. }
  108. </style>