my-bar.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <view class="bg" style="position: relative;" >
  4. <slot name="content"></slot>
  5. </view>
  6. <view class="navbar-top" :style="{ 'background': 'rgba(42, 91, 164,'+transparent+')'}">
  7. <view class="content">
  8. <view class="back" @click="$back()">
  9. <text class="cuIcon-back text-white" style="font-size: 40rpx;"></text>
  10. </view>
  11. <view class="title">{{title}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: "my-bar",
  19. props:{
  20. title:String,
  21. transparent:{
  22. type:Number,
  23. default:0
  24. }
  25. },
  26. data() {
  27. return {
  28. };
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .bg {
  34. height: 440rpx;
  35. background-image: linear-gradient(#2a5ba4, #35668c, #7a5f79);
  36. border-radius: 0 0 200rpx -200rpx;
  37. }
  38. .navbar-top {
  39. position: fixed;
  40. width: 100%;
  41. top: 0;
  42. z-index: 99999;
  43. padding-top: var(--status-bar-height);
  44. transition: top .25s;
  45. .content {
  46. display: flex;
  47. justify-content: center;
  48. position: relative;
  49. .back {
  50. position: absolute;
  51. left: 0;
  52. padding: 26rpx;
  53. }
  54. .title {
  55. padding: 26rpx 0;
  56. text-align: center;
  57. font-size: 34rpx;
  58. color: #FFFFFF;
  59. }
  60. }
  61. }
  62. </style>