tabbar.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. mounted() {
  55. },
  56. methods: {
  57. navChange: function(e) {
  58. console.log(e.currentTarget.dataset.cur);
  59. this.pageCurrent = e.currentTarget.dataset.cur;
  60. }
  61. },
  62. onLoad: function (options) {
  63. //uni.startPullDownRefresh();
  64. setTimeout(function () {
  65. console.log('start pulldown');
  66. }, 1500);
  67. // uni.startPullDownRefresh();
  68. },
  69. onPullDownRefresh() {
  70. // console.log('refresh');
  71. // if (this.pageCurrent == 'workTable') {
  72. // this.$refs['workTableRef'].pullDownRefresh();
  73. // setTimeout(function () {
  74. // uni.stopPullDownRefresh();
  75. // }, 1000);
  76. // }
  77. }
  78. }
  79. </script>
  80. <style>
  81. .box {
  82. margin: 20upx 0;
  83. }
  84. .box view.cu-bar {
  85. margin-top: 20upx;
  86. }
  87. .logo_btn{
  88. width: 38*2rpx;
  89. height: 38*2rpx;
  90. position: absolute;
  91. z-index: 2;
  92. border: #09BB07;
  93. border-radius: 50%;
  94. top: -50rpx;
  95. left: 0rpx;
  96. right: 0;
  97. margin: auto;
  98. padding: 0;
  99. }
  100. .cu-bar.tabbar .action.add-action {
  101. padding-top: 56rpx !important;
  102. }
  103. </style>