耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

  1. <template>
  2. <view class="comm-navbar position-fixed top-0 vw-100" :style="{background: backgroundColor}">
  3. <!-- 状态栏 -->
  4. <view class="status-bar-height"></view>
  5. <view class="navbar flex justify-center align-center">
  6. <view class="nav-icon">
  7. <slot></slot>
  8. <u-icon v-if="back" class="bakc" :style="{color: textColor}" @click="handleBack" name="arrow-left"></u-icon>
  9. </view>
  10. <view class="nav-text" :style="{color: textColor}">{{ text }}</view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. props: {
  17. text: {
  18. type: String
  19. },
  20. textColor: {
  21. type: String,
  22. default: '#333'
  23. },
  24. backgroundColor: {
  25. type: String,
  26. default: 'transparent'
  27. },
  28. back: {
  29. type: Boolean,
  30. default: false
  31. },
  32. backNum: {
  33. type: Number,
  34. default: 1
  35. }
  36. },
  37. methods: {
  38. handleBack () {
  39. uni.navigateBack({
  40. delta: this.backNum
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .comm-navbar {z-index: 999;
  48. .navbar {height: 80rpx;width: 100%;padding: 0 32rpx;}
  49. .nav-text {font-size: 36rpx;}
  50. .nav-icon {position: absolute;left: 32rpx;}
  51. .bakc {font-size: 36rpx}
  52. }
  53. </style>