customer.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template name="headerNavbar">
  2. <!-- 自定义导航栏 -->
  3. <view class='navbar-wrap' :style="{height:(CustomBar+55)+'px',paddingTop:StatusBar+'px'}">
  4. <view class="navbar-text"
  5. :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : 12+'px'}" :class="platformClass">
  6. {{navbarData.title ? navbarData.title : " "}}
  7. </view>
  8. <view class="search-input">
  9. <view class="gosearch-btn" @click="this.$api.navigateTo(clickPath)">
  10. <view class="search-icon">
  11. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  12. </view>
  13. <view class="search-text">{{hotSearchText}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. var self;
  20. export default{
  21. name:'headerNavbar',
  22. props:{
  23. navbarData: { // 由父页面传递的数据
  24. type: Object
  25. }
  26. },
  27. data() {
  28. return{
  29. clickPath:'/search/pages/search/search',
  30. hotSearchText:'搜索商品/项目仪器',
  31. CustomBar:this.CustomBar,// 顶部导航栏高度
  32. StatusBar: this.StatusBar,
  33. fontSizeSetting:this.fontSizeSetting,
  34. screenWidth:this.screenWidth,
  35. capsule:this.capsule,
  36. platformClass:this.platformClass,
  37. }
  38. },
  39. created() {
  40. if (getCurrentPages().length === 1) { // 当只有一个页面时
  41. this.navbarData.haveBack = false;
  42. } else {
  43. this.navbarData.haveBack = true;
  44. }
  45. },
  46. onLoad(){
  47. },
  48. methods:{
  49. BackPage: function () {
  50. this.$emit('navigateBack')
  51. },
  52. _goSearchPath:function () {
  53. this.$emit('goSearchPath')
  54. },
  55. _goHome:function(){
  56. uni.switchTab({
  57. url: '/pages/tabBar/index/index'
  58. })
  59. }
  60. },
  61. onShow(){
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. .navbar-wrap {
  67. position: fixed;
  68. width: 100%;
  69. top: 0;
  70. z-index: 100000;
  71. box-sizing: border-box;
  72. background: url(https://img.caimei365.com/group1/M00/03/B0/Cmis217Z9LCAF_anAADHlsIu3aE475.png);
  73. background-size: cover;
  74. border-bottom:none;
  75. }
  76. .navbar-text {
  77. font-size: 30rpx;
  78. color: #000000;
  79. font-weight: 500;
  80. }
  81. .navbar-text.center{
  82. text-align: center;
  83. }
  84. .navbar-text.left{
  85. text-align: left;
  86. padding-left: 45px;
  87. }
  88. .navbar-icon {
  89. position: fixed;
  90. display: flex;
  91. box-sizing: border-box;
  92. }
  93. .navbar-icon .iconfont {
  94. display: inline-block;
  95. overflow: hidden;
  96. font-size: 44rpx;
  97. padding-right:40rpx;
  98. margin-top: 1px;
  99. }
  100. .navbar-icon .icon-iconfonticonfontsousuo1 {
  101. color: #000000;
  102. }
  103. .navbar-icon view {
  104. height: 18px;
  105. border-left: 0.5px solid rgba(0,0,0, 0.3);
  106. margin-top: 6px;
  107. }
  108. .navbar-loading {
  109. background: #fff;
  110. text-align: center;
  111. }
  112. .search-input{
  113. width: 100%;
  114. height: 110rpx;
  115. padding: 20rpx 24rpx;
  116. box-sizing: border-box;
  117. .gosearch-btn{
  118. width: 100%;
  119. height: 100%;
  120. border-radius: 40rpx;
  121. background: #F0F0F0;
  122. margin: 0 auto;
  123. font-size: 28rpx;
  124. line-height: 70rpx;
  125. color: #8A8A8A;
  126. background: #FFFFFF;
  127. position: relative;
  128. box-sizing: border-box;
  129. padding-left: 80rpx;
  130. .search-icon{
  131. width: 80rpx;
  132. height: 70rpx;
  133. position:absolute ;
  134. left: 0;
  135. top: 2rpx;
  136. text-align: center;
  137. line-height: 70rpx;
  138. .icon-iconfonticonfontsousuo1{
  139. margin:0 6rpx;
  140. font-size: $font-size-34;
  141. color: #8A8A8A;
  142. z-index: 10;
  143. }
  144. }
  145. .search-text{
  146. font-size: $font-size-24;
  147. line-height: 70rpx;
  148. color: #8A8A8A;
  149. }
  150. }
  151. }
  152. </style>