chat-custom.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template name="headerNavbar">
  2. <!-- 自定义导航栏 -->
  3. <view class='navbar-wrap'
  4. :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : '#f5f4f6'}">
  5. <view class="navbar-text"
  6. :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : (capsule.height+10)+'px'}"
  7. :class="platformClass">
  8. {{navbarData.title ? navbarData.title : " "}}
  9. </view>
  10. <view class="navbar-icon"
  11. :style="{top:capsule.top +'px;',left:((screenWidth-capsule.right)+5)+'px;',height:capsule.height+'px;',lineHeight:capsule.height+'px;'}">
  12. <text :style="{width:capsule.height+'px;'}" @tap="handleBack" class="iconfont icon-fanhui"></text>
  13. <text class="iconfont icon-vertical_line" ></text>
  14. <text :style="{width:capsule.height+'px;'}" @tap="handleShowDr" class="iconfont icon-xiaoxi1"></text>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. var self
  20. export default {
  21. name: 'chatCustom',
  22. data() {
  23. return {
  24. CustomBar: this.CustomBar, // 顶部导航栏高度
  25. StatusBar: this.StatusBar,
  26. fontSizeSetting: this.fontSizeSetting,
  27. screenWidth: this.screenWidth,
  28. capsule: this.capsule,
  29. platformClass: this.platformClass,
  30. }
  31. },
  32. created() {
  33. },
  34. onLoad() {
  35. },
  36. methods: {
  37. handleBack() {
  38. uni.navigateBack({ delta: 1 })
  39. },
  40. handleShowDr() {
  41. this.$emit('showDr')
  42. }
  43. },
  44. onShow() {
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .navbar-wrap {
  50. position: fixed;
  51. width: 100%;
  52. top: 0;
  53. z-index: 100000;
  54. box-sizing: border-box;
  55. background: #f5f4f6;
  56. border-bottom: 1px solid #f5f4f6;
  57. }
  58. .navbar-text {
  59. font-size: 30rpx;
  60. color: #000000;
  61. font-weight: 500;
  62. }
  63. .navbar-text.center {
  64. text-align: center;
  65. }
  66. .navbar-text.left {
  67. text-align: left;
  68. padding-left: 45px;
  69. }
  70. .navbar-icon {
  71. position: fixed;
  72. display: flex;
  73. border-radius: 64rpx;
  74. border: 0.5px solid rgba(0,0,0, 0.2);
  75. box-sizing: border-box;
  76. }
  77. .navbar-icon .iconfont {
  78. text-align: center;
  79. display: inline-block;
  80. overflow: hidden;
  81. }
  82. .navbar-icon .icon-vertical_line {
  83. color: #999999;
  84. border-color: rgba(0,0,0,0.4);
  85. }
  86. .navbar-loading {
  87. background: #fff;
  88. text-align: center;
  89. }
  90. </style>