my-nav.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="">
  3. <view class="header" :style="[{'height': customBarH + 'rpx', 'padding-top': statusBarH + 'px'}]">
  4. <view class="header-left">
  5. <image class="left-img" src="/static/img/my/like.png" mode="heightFix"></image>
  6. </view>
  7. <view class="header-right">
  8. <image class="right-img" src="/static/img/my/edit.png" mode="aspectFill"></image>
  9. <image class="right-img" src="/static/img/my/set.png" mode="aspectFill"></image>
  10. </view>
  11. </view>
  12. <view class="box-title">
  13. <view class="" :style="[{'height': customBarH + 'rpx', 'padding-top': statusBarH + 'px'}]">
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "my-nav",
  21. data() {
  22. return {
  23. statusBarH: 0,
  24. customBarH: 132,
  25. left: 35,
  26. isXcx:false,
  27. tabNum:0
  28. }
  29. },
  30. props: {
  31. },
  32. computed: {
  33. },
  34. watch: {
  35. },
  36. methods: {
  37. setTabNum(tabNum){
  38. if(this.tabNum!==tabNum){
  39. this.tabNum=tabNum
  40. this.$emit('setTabNum',tabNum)
  41. }
  42. }
  43. },
  44. created() {
  45. uni.getSystemInfo({
  46. success: (e) =>{
  47. this.statusBarH = e.statusBarHeight + 10
  48. this.$emit('navHeight', this.customBarH+this.statusBarH)
  49. }
  50. })
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. @import url("/static/css/en-common.css") ;
  56. .header {
  57. width: calc(100vw - 62rpx);
  58. position: fixed;
  59. left: 0;
  60. top: 0;
  61. z-index: 100;
  62. display: flex;
  63. justify-content: space-between;
  64. align-items: center;
  65. padding: 0 44rpx 0 18rpx;
  66. height: 132rpx;
  67. //box-sizing: border-box;
  68. .header-left{
  69. .left-img{
  70. height: 132rpx;
  71. }
  72. }
  73. .header-right{
  74. height: 52rpx;
  75. display: flex;
  76. justify-content: flex-end;
  77. .right-img{
  78. width: 52rpx;
  79. height: 52rpx;
  80. }
  81. .right-img:first-child{
  82. margin-right: 40rpx;
  83. }
  84. }
  85. }
  86. .box-title {
  87. width: 100vw;
  88. }
  89. </style>