custom.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="navigation" >
  3. <view class="me-container" :class="bgColor">
  4. <view class="me-left flex_ac">
  5. <!-- <view v-if="isBack" @tap="toBack" class="iconfont icon-back"></view> -->
  6. <!-- <image v-if="isBack" @tap="toBack" src="@/static/icon/back.png"></image> -->
  7. <u-icon name="arrow-left" v-if="isBack" @tap="toBack"></u-icon>
  8. <slot name="left"></slot>
  9. </view>
  10. <view class="me-content">
  11. <slot name="content"></slot>
  12. </view>
  13. <view class="me-right">
  14. <slot name="right"></slot>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props:{
  22. isBack:{
  23. type:Boolean,
  24. default:true
  25. },
  26. bgColor:{
  27. type:String,
  28. default:'bg-white'
  29. }
  30. },
  31. computed:{
  32. },
  33. data() {
  34. return {
  35. StatusBar:this.StatusBar,
  36. CustomBar:this.CustomBar
  37. };
  38. },
  39. methods:{
  40. toBack(){
  41. uni.navigateBack({
  42. delta:1
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style scoped lang="scss">
  49. cover-view{
  50. box-sizing: border-box;
  51. }
  52. .navigation{
  53. height: 88rpx;
  54. position: relative;
  55. .bg-none {
  56. background: none;
  57. }
  58. .bg-white{
  59. background: #FFFFFF;
  60. }
  61. .bg-tran{
  62. background: transparent;
  63. }
  64. .bg-them{
  65. background: #fb5152;
  66. }
  67. .bg-linear {
  68. background: linear-gradient(262deg, #DAF8FA 0%, #D3E6FC 84%, #D2E2FC 100%);
  69. }
  70. .me-container{
  71. position: fixed;
  72. width: 100%;
  73. top: 0;
  74. z-index: 1024;
  75. // box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1);
  76. // padding: 0 30rpx;
  77. height: 88rpx;
  78. display: flex;
  79. align-items: center;
  80. justify-content: space-between;
  81. .me-content{
  82. position: absolute;
  83. left: 50%;
  84. transform: translateX(-50%);
  85. }
  86. .me-left{
  87. image {
  88. width: 32rpx;
  89. height: 32rpx;
  90. display: block;
  91. margin-left: 30rpx;
  92. }
  93. }
  94. }
  95. }
  96. </style>