customer.vue 3.5 KB

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