customer.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="search-tab">
  10. <view class="search-tab-btn" @click="topBubble">
  11. <text>{{ tabValue }}</text>
  12. <text class="iconfont icon-xiangxiajiantou"></text>
  13. </view>
  14. <tui-bubble-popup :show="show" :mask="false" position="absolute" direction="top" @close="topBubble" width="140rpx"
  15. left="10rpx" bottom="0rpx" translateY="100%" triangleRight="60rpx" triangleTop="-22rpx">
  16. <view class="tui-menu-item" @tap="selectTabs(1)">产品</view>
  17. <view class="tui-menu-item" @tap="selectTabs(2)">供应商</view>
  18. <view class="tui-menu-item" @tap="selectTabs(3)">项目仪器</view>
  19. </tui-bubble-popup>
  20. </view>
  21. <view class="gosearch-btn" @click="this.$api.navigateTo(clickPath)">
  22. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  23. <input class="input" type="text" v-model="SearchText" value="" placeholder="你想要的这里都有"/>
  24. </view>
  25. <view class="search-service">
  26. <!-- #ifdef MP-WEIXIN -->
  27. <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
  28. <text class="iconfont icon-liuyan"></text>
  29. </button>
  30. <!-- #endif -->
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. var self;
  37. import btSearch from '@/components/uni-search/bt-search.vue'
  38. export default{
  39. name:'headerNavbar',
  40. components:{
  41. btSearch,
  42. },
  43. props:{
  44. navbarData: { // 由父页面传递的数据
  45. type: Object
  46. }
  47. },
  48. data() {
  49. return{
  50. show:false,
  51. clickPath:'/pages/search/search',
  52. SearchText:'',
  53. tabValue:'产品',
  54. CustomBar:this.CustomBar,// 顶部导航栏高度
  55. StatusBar: this.StatusBar,
  56. fontSizeSetting:this.fontSizeSetting,
  57. screenWidth:this.screenWidth,
  58. capsule:this.capsule,
  59. platformClass:this.platformClass,
  60. }
  61. },
  62. created() {
  63. if (getCurrentPages().length === 1) { // 当只有一个页面时
  64. this.navbarData.haveBack = false;
  65. } else {
  66. this.navbarData.haveBack = true;
  67. }
  68. },
  69. onLoad(){
  70. },
  71. methods:{
  72. handleContact(e){
  73. console.log(e.detail.path)
  74. console.log(e.detail.query)
  75. },
  76. topBubble() {
  77. this.show = !this.show;
  78. },
  79. selectTabs(index){
  80. this.show = false
  81. switch(index){
  82. case 1:
  83. this.tabValue='产品'
  84. break;
  85. case 2:
  86. this.tabValue='供应商'
  87. break;
  88. case 3:
  89. this.tabValue='项目仪器'
  90. break;
  91. }
  92. }
  93. },
  94. onShow(){
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .navbar-wrap {
  100. position: fixed;
  101. width: 100%;
  102. top: 0;
  103. z-index: 100000;
  104. box-sizing: border-box;
  105. background: url(https://img.caimei365.com/group1/M00/03/B0/Cmis217Z9LCAF_anAADHlsIu3aE475.png);
  106. background-size: cover;
  107. border-bottom:none;
  108. }
  109. .navbar-text {
  110. width: 476rpx;
  111. font-size: 30rpx;
  112. color: #000000;
  113. font-weight: 500;
  114. }
  115. .navbar-text.center{
  116. text-align: center;
  117. }
  118. .navbar-text.left{
  119. text-align: left;
  120. padding-left: 45px;
  121. }
  122. .navbar-icon {
  123. position: fixed;
  124. display: flex;
  125. box-sizing: border-box;
  126. }
  127. .navbar-icon .iconfont {
  128. display: inline-block;
  129. overflow: hidden;
  130. font-size: 44rpx;
  131. padding-right:40rpx;
  132. margin-top: 1px;
  133. }
  134. .navbar-icon .icon-iconfonticonfontsousuo1 {
  135. color: #000000;
  136. }
  137. .navbar-icon view {
  138. height: 18px;
  139. border-left: 0.5px solid rgba(0,0,0, 0.3);
  140. margin-top: 6px;
  141. }
  142. .navbar-loading {
  143. background: #fff;
  144. text-align: center;
  145. }
  146. .search-input{
  147. width: 100%;
  148. height: 70rpx;
  149. padding: 20rpx 0;
  150. .search-tab{
  151. width: 180rpx;
  152. height: 70rpx;
  153. line-height: 70rpx;
  154. color: #FFFFFF;
  155. font-size: $font-size-28;
  156. text-align: center;
  157. float: left;
  158. position: relative;
  159. .icon-xiangxiajiantou{
  160. margin-left: 10rpx;
  161. }
  162. }
  163. .gosearch-btn{
  164. width: 470rpx;
  165. height: 100%;
  166. float: left;
  167. border-radius: 40rpx;
  168. background: #F0F0F0;
  169. margin: 0 auto;
  170. padding:0 20rpx;
  171. font-size: 28rpx;
  172. line-height: 70rpx;
  173. padding-left: 70rpx;
  174. color: #8A8A8A;
  175. background: #FFFFFF;
  176. position: relative;
  177. box-sizing: border-box;
  178. .icon-iconfonticonfontsousuo1{
  179. width: 70rpx;
  180. height: 70rpx;
  181. line-height: 70rpx;
  182. text-align: center;
  183. display: block;
  184. position: absolute;
  185. left: 0;
  186. top: 0;
  187. font-size: 34rpx;
  188. color: #8A8A8A;
  189. z-index: 10;
  190. }
  191. .input{
  192. width: 400rpx;
  193. height: 100%;
  194. float: left;
  195. }
  196. }
  197. .search-service{
  198. width: 100rpx;
  199. height: 70rpx;
  200. line-height: 70rpx;
  201. float: right;
  202. text-align: center;
  203. color: #FFFFFF;
  204. .contact-btn{
  205. width: 100%;
  206. height: 70rpx;
  207. background-color: rgba(0,0,0,0);
  208. line-height: 70rpx;
  209. .icon-liuyan{
  210. font-size: 64rpx;
  211. color: #FFFFFF;
  212. }
  213. }
  214. }
  215. }
  216. </style>