my-nav.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 @click="goToUrl(1)" 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. goToUrl(type){
  44. if(type===1){
  45. uni.navigateTo({
  46. 'url':'./editInformation'
  47. })
  48. }
  49. }
  50. },
  51. created() {
  52. uni.getSystemInfo({
  53. success: (e) =>{
  54. this.statusBarH = e.statusBarHeight + 10
  55. this.$emit('navHeight', this.customBarH+this.statusBarH)
  56. }
  57. })
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. @import url("/static/css/en-common.css") ;
  63. .header {
  64. width: calc(100vw - 62rpx);
  65. position: fixed;
  66. left: 0;
  67. top: 0;
  68. z-index: 100;
  69. display: flex;
  70. justify-content: space-between;
  71. align-items: center;
  72. padding: 0 44rpx 0 18rpx;
  73. height: 132rpx;
  74. //box-sizing: border-box;
  75. .header-left{
  76. .left-img{
  77. height: 132rpx;
  78. }
  79. }
  80. .header-right{
  81. height: 52rpx;
  82. display: flex;
  83. justify-content: flex-end;
  84. .right-img{
  85. width: 52rpx;
  86. height: 52rpx;
  87. }
  88. .right-img:first-child{
  89. margin-right: 40rpx;
  90. }
  91. }
  92. }
  93. .box-title {
  94. width: 100vw;
  95. }
  96. </style>