nav.vue 1.8 KB

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