index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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";
  21. import myCommission from "./components/myCommission";
  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. crmFormStateDicts : [],
  60. }
  61. }
  62. },
  63. mounted() {
  64. // 页面初始化后的逻辑
  65. uni.getSystemInfo({
  66. success: (e) => {
  67. let offsetTop = 0
  68. // #ifdef H5
  69. offsetTop = 43
  70. // #endif
  71. this.offsetTop = offsetTop;
  72. }
  73. });
  74. this.$getDicts('crm_follow_status').then(res => {
  75. this.dicts.crmFormStateDicts = res;
  76. });
  77. },
  78. methods: {
  79. // tab切换事件处理
  80. handleTabChange(index) {
  81. this.activeIndex = index;
  82. }
  83. },
  84. // 页面滚动触发事件
  85. onPageScroll(e) {
  86. //页面滚动事件
  87. uni.$emit('onPageScroll', e)
  88. },
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. ::v-deep .yui-tabs__content {
  93. background-color: transparent;
  94. .yui-tabs__track {
  95. background-color: transparent;
  96. }
  97. }
  98. </style>