nav.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="" >
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back_black.png" mode="aspectFit" class="backImg" @click="goback"></image>
  9. <view class="navsx"></view>
  10. <image src="../../static/img/nav_icon_home_black.png" mode="" class="homeImg" @click="gohome"></image>
  11. </view>
  12. <view class="zdyNavTitle">{{title}}</view>
  13. <view style="width: 250rpx;"></view>
  14. </view>
  15. </view>
  16. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  17. <view style="height: 44px;"></view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props:['title','iStatusBarHeight','cj'],
  23. data() {
  24. return {
  25. }
  26. },
  27. onLoad(opt) {
  28. //this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  29. },
  30. onShow() {
  31. },
  32. methods: {
  33. goback() {
  34. uni.navigateBack({
  35. delta: 1
  36. })
  37. },
  38. gohome(){
  39. /* uni.switchTab({
  40. url:'../../pages/index/index'
  41. }) */
  42. uni.navigateTo({
  43. url:'/pages/index/index'
  44. })
  45. },
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. .zdyNavBox{
  51. width: 100vw;
  52. background: #FFFFFF;
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. z-index: 9999999;
  57. }
  58. .zdyNav{
  59. height: 44px;
  60. display: flex;
  61. justify-content: space-between;
  62. align-items: center;
  63. }
  64. .backImg{
  65. width: 44rpx;
  66. height: 44rpx;
  67. /* margin-left: 10rpx; */
  68. /* margin-right: 20rpx; */
  69. }
  70. .navsx{
  71. width: 2rpx;
  72. height: 44rpx;
  73. background: #e1e1e1;
  74. margin: 0 26rpx 0rpx 18rpx;
  75. }
  76. .homeImg{
  77. width: 44rpx;
  78. height: 44rpx;
  79. }
  80. .zdyNavLeft{
  81. display: flex;
  82. align-items: center;
  83. border: 1px solid #e1e1e1;
  84. margin-left: 15rpx;
  85. border-radius: 35rpx;
  86. padding: 10rpx 23rpx 8rpx 13rpx;
  87. }
  88. .zdyNavTitle{
  89. width: 100vw;
  90. height: 44px;
  91. background: #FFFFFF;
  92. text-align: center;
  93. font-size: 34rpx;
  94. line-height: 44px;
  95. }
  96. </style>