loginNavbar.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <!-- 自定义导航栏 -->
  4. <view class="navBarBox">
  5. <!-- 状态栏占位 -->
  6. <view class="statusBar"></view>
  7. <!-- 真正的导航栏内容 -->
  8. <view class="navBar" :style="{ min_height: statusBarHeight + 'px'}">
  9. <uni-icons @click="goBack()" type="arrow-left" color="#fff" size="30"></uni-icons>
  10. <view class="button">未登录</view>
  11. <image class="logo-image" ></image>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import UniIcons from "../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
  18. export default {
  19. components: {UniIcons},
  20. data() {
  21. return {
  22. src:"/static/images/left.jpg",
  23. // 状态栏高度
  24. statusBarHeight: 0,
  25. // 导航栏高度
  26. navBarHeight: 82 + 11,
  27. };
  28. },
  29. props: {},
  30. //第一次加载时调用
  31. created() {
  32. //获取手机状态栏高度
  33. this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
  34. }, methods: {
  35. goBack(){
  36. uni.navigateBack({
  37. delta: 2
  38. });
  39. },
  40. }
  41. }
  42. </script>
  43. <style>
  44. .navBarBox {
  45. width: 100vw;
  46. }
  47. .navBarBox .navBar {
  48. padding: 3rpx 50rpx;
  49. padding-bottom: 8rpx;
  50. color: white;
  51. width: 100%;
  52. display: flex;
  53. justify-content: space-between;
  54. align-items: center;
  55. background: black;
  56. flex-direction: row;
  57. }
  58. .navBarBox .navBar .logo-image {
  59. width: 16rpx;
  60. height: 16rpx;
  61. margin-right: 10rpx;
  62. }
  63. </style>