bgNavBar.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view>
  3. <u-sticky offsetTop="0" customNavHeight="0" zIndex="999">
  4. <view class="content-header-sticky x-c">
  5. <image class="bg-img" src="/static/image/home/home_top_bg.png" style="z-index: -1;"></image>
  6. <view class="backicon"><uni-icons type="left" size="26" color="#fff" @click="$navBack()"></uni-icons></view>
  7. <text class="textOne" style="width: 50%;text-align: center;color: #fff;">{{title}}</text>
  8. </view>
  9. </u-sticky>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. title: {
  16. type: String,
  17. default: ''
  18. }
  19. }
  20. }
  21. </script>
  22. <style scoped lang="scss">
  23. @mixin u-flex($flexD, $alignI, $justifyC) {
  24. display: flex;
  25. flex-direction: $flexD;
  26. align-items: $alignI;
  27. justify-content: $justifyC;
  28. }
  29. .content-header-sticky {
  30. height: calc(44px + var(--status-bar-height));
  31. padding-top: var(--status-bar-height);
  32. position: relative;
  33. z-index: 999;
  34. overflow: hidden;
  35. .backicon {
  36. position: absolute;
  37. top: 0;
  38. bottom: 0;
  39. left: 24rpx;
  40. padding-top: var(--status-bar-height);
  41. @include u-flex(row,center,flex-start);
  42. }
  43. }
  44. .bg-img {
  45. position: absolute;
  46. width: 100%;
  47. height: 524rpx;
  48. top: 0;
  49. left: 0;
  50. right: 0;
  51. bottom: 0;
  52. }
  53. </style>