index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="container" :style="{height: winHeight + 'px'}">
  3. <!-- 状态栏高度 -->
  4. <view :style="{ height: `${statusBarHeight}px`, width: '100%', backgroundColor: '#FF6702' }"></view>
  5. <!-- 导航栏 -->
  6. <view :style="{ height: `${navigationBarHeight}rpx`,lineHeight: `${navigationBarHeight}rpx`}" class="order-nav">
  7. <!-- <view class="back-button" @tap="handBack()"></view> -->
  8. {{activeRole == '0' ? '接单' : '我的' }}
  9. </view>
  10. <!-- <view class="content-dom"> -->
  11. <view style="flex: 1;width: 100%;overflow: hidden;" v-if="activeRole == '0'">
  12. <rider-shipping></rider-shipping>
  13. </view>
  14. <view style="flex: 1;width: 100%;overflow: hidden;" v-if="activeRole == '1'">
  15. <rider-me></rider-me>
  16. </view>
  17. <!-- </view> -->
  18. <!-- 底部导航 -->
  19. <view class="page-footer">
  20. <view class="foot-item" :class="item.pagePath == activeRouter?'active':''" v-for="(item,index) in footerList" :key="index"
  21. @click="goRouter(item)">
  22. <block v-if="item.pagePath == activeRouter">
  23. <image :src="item.selectedIconPath"></image>
  24. <view class="txt">{{item.text}}</view>
  25. </block>
  26. <block v-else>
  27. <image :src="item.iconPath"></image>
  28. <view class="txt">{{item.text}}</view>
  29. </block>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import riderOrder from "@/components/riderOrder/index.vue";
  36. import riderShipping from "./components/rider_shipping/index.vue";
  37. import riderMe from "./components/rider_me/index.vue";
  38. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  39. let app = getApp();
  40. export default {
  41. components: {
  42. riderOrder,
  43. riderShipping,
  44. riderMe
  45. },
  46. data() {
  47. return {
  48. winHeight: 0,
  49. activeRouter: '/pages/rider/rider_shipping/index',
  50. activeRole: '0',
  51. footerList: [{
  52. pagePath: "/pages/rider/rider_shipping/index",
  53. iconPath: require("./static/ddh.png"),
  54. selectedIconPath: require("./static/ddl.png"),
  55. text: "订单",
  56. role: '0'
  57. },
  58. {
  59. pagePath: "/pages/rider/rider_me/index",
  60. iconPath: require("./static/wdh.png"),
  61. selectedIconPath: require("./static/wdl.png"),
  62. text: "我的",
  63. role: '1'
  64. }
  65. ],
  66. statusBarHeight: app.globalData.statusBarHeight,
  67. navigationBarHeight: 112,
  68. }
  69. },
  70. methods: {
  71. goRouter(item) {
  72. if (this.activeRouter == item.pagePath) return
  73. this.activeRouter = item.pagePath
  74. this.activeRole = item.role
  75. // uni.redirectTo({
  76. // url: item.pagePath,
  77. // animationType: 'none' // 关闭默认的滑动效果
  78. // });
  79. },
  80. },
  81. onLoad(options) {
  82. let that = this
  83. // 隐藏TabBar
  84. uni.hideTabBar({});
  85. uni.getSystemInfo({
  86. success: function(res) {
  87. that.winHeight = res.windowHeight
  88. },
  89. });
  90. },
  91. mounted() {
  92. },
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .container {
  97. display: flex;
  98. align-items: center;
  99. flex-direction: column;
  100. justify-content: space-between;
  101. overflow: hidden;
  102. position: relative;
  103. }
  104. .content-dom {
  105. width: 100%;
  106. flex: 1;
  107. }
  108. .order-nav {
  109. width: 100%;
  110. font-weight: 500;
  111. font-size: 35rpx;
  112. margin-top: -2rpx;
  113. color: #FFFFFF;
  114. position: relative;
  115. background-color: #FF6702;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. .back-button {
  120. position: absolute;
  121. left: 20rpx;
  122. }
  123. }
  124. .page-footer {
  125. // position: fixed;
  126. // bottom: 0;
  127. // z-index: 9;
  128. display: flex;
  129. align-items: center;
  130. justify-content: space-around;
  131. width: 100%;
  132. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  133. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  134. box-sizing: border-box;
  135. border-top: solid 1rpx #F3F3F3;
  136. background-color: #fff;
  137. // box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
  138. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  139. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  140. .foot-item {
  141. display: flex;
  142. width: max-content;
  143. align-items: center;
  144. justify-content: center;
  145. flex-direction: column;
  146. position: relative;
  147. padding: 0 20rpx;
  148. margin-top: 18rpx;
  149. &.active {
  150. color: $bg-color-primary
  151. }
  152. }
  153. .foot-item image {
  154. height: 50rpx;
  155. width: 50rpx;
  156. text-align: center;
  157. margin: 0 auto;
  158. }
  159. .foot-item .txt {
  160. font-size: 27rpx;
  161. margin-top: 8rpx;
  162. }
  163. }
  164. </style>