navbar.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="navbox">
  3. <uni-nav-bar color="#ffffff" leftWidth='300rpx' :background-color="bgColor" :border="false" statusBar='true' fixed="true">
  4. <block slot="left">
  5. <!-- <image :src="titimg" class="topl"></image> -->
  6. </block>
  7. <block slot="right">
  8. <!-- <view class="topr">
  9. <image :src="noticeimg"></image>
  10. <view class="cir"></view>
  11. </view> -->
  12. </block>
  13. </uni-nav-bar>
  14. </view>
  15. </template>
  16. <script>
  17. export default{
  18. props:{
  19. bgColor:{
  20. type: String,
  21. default () {
  22. return 'transparent'
  23. }
  24. },
  25. navborder:{
  26. type: Boolean,
  27. default () {
  28. return false
  29. }
  30. },
  31. navtit:'',
  32. leftflag:{
  33. type: Boolean,
  34. default () {
  35. return false
  36. }
  37. },
  38. },
  39. data(){
  40. return{
  41. navbg:require("@/static/images/navbg.png"),
  42. backgroundColor: "transparent",
  43. }
  44. },
  45. methods:{
  46. getBack(){
  47. if(this.leftflag){
  48. uni.navigateBack({
  49. delta:1
  50. })
  51. }
  52. },
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  58. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  59. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  60. image{width: 100%;height: 100%;}
  61. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  62. }
  63. }
  64. </style>