index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="nav-bar" :style="{ paddingTop: 12 + BarHeight + 'px' }">
  3. <view class="go-back">
  4. <u-icon name="arrow-left" :color="color" size="32" @click="goBack"></u-icon>
  5. </view>
  6. <view class="nav-title" :style="{color:color}">
  7. {{ title }}
  8. </view>
  9. <view class="go-back">
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. BarHeight:'',
  18. goBack(){
  19. uni.navigateBack()
  20. }
  21. };
  22. },
  23. props: {
  24. title: "",
  25. color:''
  26. },
  27. mounted(){
  28. // #ifdef APP-PLUS
  29. let systemInfo = uni.getSystemInfoSync();
  30. this.BarHeight = systemInfo.statusBarHeight;
  31. // #endif
  32. }
  33. };
  34. </script>
  35. <style lang="scss" scoped>
  36. .nav-bar {
  37. width: 100%;
  38. padding: 24rpx 32rpx 20rpx 32rpx;
  39. box-sizing: border-box;
  40. color: rgba(255, 255, 255, 1);
  41. font-family: DM Sans;
  42. font-size: 30rpx;
  43. font-weight: 700;
  44. line-height: 26px;
  45. display: flex;
  46. // justify-content: center;
  47. align-items: center;
  48. position: relative;
  49. .go-back{
  50. width: 32.61px;
  51. height: 26px;
  52. }
  53. .nav-title{
  54. flex: 1;
  55. text-align: center;
  56. }
  57. }
  58. </style>