tabbar.vue 3.0 KB

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