tabbar.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view>
  3. <workTable ref="workTableRef" v-if="pageCurrent=='workTable'"></workTable>
  4. <me v-if="pageCurrent=='me'"></me>
  5. <order v-if="pageCurrent=='order'"></order>
  6. <view class="box">
  7. <view class="cu-bar tabbar bg-white shadow foot">
  8. <!-- <view class="action" @click="navChange" data-cur="order">-->
  9. <!-- <view class='cuIcon-cu-image'>-->
  10. <!-- <image v-if="pageCurrent=='order'" src="../../static/tabbar/order_cur.png"></image>-->
  11. <!-- <image v-if="pageCurrent != 'order'" src="../../static/tabbar/order.png"></image>-->
  12. <!-- </view>-->
  13. <!-- <view :class="pageCurrent=='order'?'color_main':'text-gray'">配送列表</view>-->
  14. <!-- </view>-->
  15. <view class="action" @click="navChange" data-cur="workTable">
  16. <view class='cuIcon-cu-image'>
  17. <image v-if="pageCurrent=='workTable'" src="../../static/tabbar/workTable_cur.png"></image>
  18. <image v-if="pageCurrent != 'workTable'" src="../../static/tabbar/workTable.png"></image>
  19. </view>
  20. <view :class="pageCurrent=='workTable'?'color_main':'text-gray'">工作台</view>
  21. </view>
  22. <view class="action" @click="navChange" data-cur="me">
  23. <view class='cuIcon-cu-image'>
  24. <view class="cu-tag badge">
  25. <!-- 红点 -->
  26. </view>
  27. <image v-if="pageCurrent=='me'" src="../../static/tabbar/me_cur.png"></image>
  28. <image v-if="pageCurrent != 'me'" src="../../static/tabbar/me.png"></image>
  29. </view>
  30. <view :class="pageCurrent=='me'?'color_main':'text-gray'">个人中心</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import order from "./order.vue"; //配送列表
  38. import workTable from "./workTable.vue"; //工作台
  39. import me from "./me.vue"; //个人中心
  40. export default {
  41. components: {
  42. order,
  43. workTable,
  44. me
  45. },
  46. data() {
  47. return {
  48. pageCurrent: 'workTable'
  49. }
  50. },
  51. onPullDownRefresh() {
  52. // console.log('refresh');
  53. if (this.pageCurrent == 'workTable') {
  54. this.$refs['workTableRef'].pullDownRefresh();
  55. setTimeout(function () {
  56. uni.stopPullDownRefresh();
  57. }, 1000);
  58. }
  59. },
  60. methods: {
  61. navChange: function(e) {
  62. this.pageCurrent = e.currentTarget.dataset.cur;
  63. }
  64. },
  65. }
  66. </script>
  67. <style>
  68. .box {
  69. margin: 20upx 0;
  70. }
  71. .box view.cu-bar {
  72. margin-top: 20upx;
  73. }
  74. .logo_btn{
  75. width: 38*2rpx;
  76. height: 38*2rpx;
  77. position: absolute;
  78. z-index: 2;
  79. border: #09BB07;
  80. border-radius: 50%;
  81. top: -50rpx;
  82. left: 0rpx;
  83. right: 0;
  84. margin: auto;
  85. padding: 0;
  86. }
  87. .cu-bar.tabbar .action.add-action {
  88. padding-top: 56rpx !important;
  89. }
  90. </style>