my-nav.vue 2.3 KB

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