index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="order_wrap">
  3. <u-navbar title="接单中心" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
  4. <yui-tabs :tabs="tabs" v-model="activeIndex" :lineWidth="'120rpx'" :isLazyRender="true" color="#108cff"
  5. titleActiveColor="#108cff" :swipeable="true" :swiper="false" :ellipsis="false" :scroll-threshold="3"
  6. :sticky="true" :sticky-threshold="0" :offset-top="offsetTop" :z-index="99">
  7. <template #orderCenter>
  8. <orderCenter ref="orderCenter" type="1" :dicts="dicts"></orderCenter>
  9. </template>
  10. <template #myOrder>
  11. <orderCenter ref="myOrder" type="2" :dicts="dicts"></orderCenter>
  12. </template>
  13. <template #myCommission>
  14. <myCommission ref="myCommission" type="2" :showStats="true" ></myCommission>
  15. </template>
  16. </yui-tabs>
  17. </view>
  18. </template>
  19. <script>
  20. import orderCenter from "./components/orderCenter/orderCenter.vue";
  21. import myCommission from "./components/commission/myCommission.vue";
  22. export default {
  23. components: {
  24. orderCenter,
  25. myCommission
  26. },
  27. onPullDownRefresh() {
  28. uni.stopPullDownRefresh();
  29. this.$refs[this.activeTel].resetData();
  30. },
  31. onReachBottom() {
  32. this.$refs[this.activeTel].handleOnReachBottom();
  33. },
  34. computed: {
  35. activeTel() {
  36. return this.tabs.find(v => v.activeIndex === this.activeIndex).slot;
  37. },
  38. },
  39. data() {
  40. return {
  41. activeIndex: 0,
  42. offsetTop: 0,
  43. tabs: [{
  44. label: '接单中心',
  45. slot: 'orderCenter',
  46. activeIndex: 0,
  47. }, {
  48. label: '我的接发单',
  49. slot: 'myOrder',
  50. activeIndex: 1,
  51. },
  52. {
  53. label: '我的分成',
  54. slot: 'myCommission',
  55. activeIndex: 2,
  56. }
  57. ],
  58. dicts : {
  59. crmFormStatusDict : [],
  60. crmFormCategoryDict : [],
  61. crmFormStateDict : [],
  62. crmFormTacticDict : [],
  63. }
  64. }
  65. },
  66. mounted() {
  67. // 页面初始化后的逻辑
  68. uni.getSystemInfo({
  69. success: (e) => {
  70. let offsetTop = 0
  71. // #ifdef H5
  72. offsetTop = 43
  73. // #endif
  74. this.offsetTop = offsetTop;
  75. }
  76. });
  77. this.$getDicts('crm_form_status').then(res => {
  78. this.dicts.crmFormStatusDict = res;
  79. });
  80. this.$getDicts('crm_form_category').then(res => {
  81. this.dicts.crmFormCategoryDict = res;
  82. });
  83. this.$getDicts('crm_form_state').then(res => {
  84. this.dicts.crmFormStateDict = res;
  85. });
  86. this.$getDicts('crm_form_tactic').then(res => {
  87. this.dicts.crmFormTacticDict = res;
  88. });
  89. },
  90. methods: {
  91. // tab切换事件处理
  92. handleTabChange(index) {
  93. this.activeIndex = index;
  94. }
  95. },
  96. // 页面滚动触发事件
  97. onPageScroll(e) {
  98. //页面滚动事件
  99. uni.$emit('onPageScroll', e)
  100. },
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. ::v-deep .yui-tabs__content {
  105. background-color: transparent;
  106. .yui-tabs__track {
  107. background-color: transparent;
  108. }
  109. }
  110. </style>