navbar.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <image :src="navbg" class="navbg"></image>
  4. <uni-nav-bar :left-icon="leftflag?'left':''" :title="navtit" color="#ffffff" :background-color="bgColor" :border="navborder" statusBar='true' fixed="true" @clickLeft='getBack' @clickRight='getDetail'>
  5. <block slot="right" v-if="rtype&&rtype=='come'">
  6. <view class="right">
  7. <view>预约信息</view>
  8. </view>
  9. </block>
  10. </uni-nav-bar>
  11. </view>
  12. </template>
  13. <script>
  14. export default{
  15. props:{
  16. bgColor:{
  17. type: String,
  18. default () {
  19. return 'transparent'
  20. }
  21. },
  22. navborder:{
  23. type: Boolean,
  24. default () {
  25. return false
  26. }
  27. },
  28. rtype:{
  29. type: String,
  30. default () {
  31. return ''
  32. }
  33. },
  34. navtit:'',
  35. leftflag:{
  36. type: Boolean,
  37. default () {
  38. return false
  39. }
  40. }
  41. },
  42. data(){
  43. return{
  44. navbg:require("@/static/images/navbg.png"),
  45. backgroundColor: "transparent",
  46. }
  47. },
  48. methods:{
  49. getBack(){
  50. if(this.leftflag){
  51. uni.navigateBack({
  52. delta:1
  53. })
  54. }
  55. },
  56. getDetail(){
  57. this.$emit('getDetail')
  58. },
  59. }
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .navbg{width: 100%;height: 692rpx;position: fixed;left: 0;right: 0;top: 0;z-index: 1;}
  64. .navtit{display: flex;align-items: center;justify-content: center;font-size: 30rpx;color: #ffffff;width: 100%;
  65. }
  66. .right{position: absolute;right: 0;padding: 0 16rpx 0 26rpx;border-radius: 28rpx 0 0 28rpx;height: 56rpx;line-height: 56rpx;font-weight: bold;
  67. font-size: 24rpx;background-color: #7DC7FE;
  68. color: #FFFFFF;}
  69. </style>