Commit 89f5a9693f0e84cf8dc8e0f6134750d98bfeb08b

Authored by taiyuan
1 parent 8555acb0

搜索框

components/diy_searchbox/diy_searchbox.wxml
@@ -11,22 +11,17 @@ @@ -11,22 +11,17 @@
11 <view class="s1_gk_a1" wx:else> 11 <view class="s1_gk_a1" wx:else>
12 <view class='s_ge flex'> 12 <view class='s_ge flex'>
13 <image class="find_img" src='{{imghost}}/miniapp/images/search.png' bindtap='sear'></image> 13 <image class="find_img" src='{{imghost}}/miniapp/images/search.png' bindtap='sear'></image>
14 - <input id="find_inp" class="find_inp" value=""  
15 - bindconfirm="sear" bindinput='set_input' focus="{{inputShowed}}" bindblur="onblur" /> 14 + <input id="find_inp" class="find_inp" value=""
  15 + bindconfirm="sear" bindinput='set_input' focus="{{inputShowed}}" bindblur="onblur" />
16 </view> 16 </view>
17 </view> 17 </view>
18 18
19 - <view class="his_str" wx:if="{{inputShowed}}">  
20 - <view class="h_title">历史搜索</view>  
21 - <view class="item">2121</view>  
22 - <view class="item">2121</view>  
23 - <view class="item">2121</view>  
24 - </view> 19 +
25 </view> 20 </view>
26 </block> 21 </block>
27 22
28 <block wx:if="{{object.style==2}}"> 23 <block wx:if="{{object.style==2}}">
29 -<view style='background-color:{{object.top_bgcolor}}; display: flex; align-items: center; justify-content: space-around; height: 100rpx;position: relative;' > 24 +<view style='background-color:{{object.top_bgcolor}}; display: flex; align-items: center; justify-content: space-around;padding:16rpx 0;'>
30 <view class='s2_left'> 25 <view class='s2_left'>
31 <navigator open-type="switchTab" url="/pages/goods/categoryList/categoryList" class="s1_gk_a1"> 26 <navigator open-type="switchTab" url="/pages/goods/categoryList/categoryList" class="s1_gk_a1">
32 <image src='{{imghost}}/miniapp/images/model/nav.png' style="margin:0;position: relative;left: 6rpx"></image> 27 <image src='{{imghost}}/miniapp/images/model/nav.png' style="margin:0;position: relative;left: 6rpx"></image>
@@ -37,23 +32,40 @@ @@ -37,23 +32,40 @@
37 <text class="iconfont icon-search" style="font-size: 40rpx;"></text> 32 <text class="iconfont icon-search" style="font-size: 40rpx;"></text>
38 <text>在店铺内搜索</text> 33 <text>在店铺内搜索</text>
39 </navigator> 34 </navigator>
40 - <navigator wx:else class="s1_gk_a2 flex" style='height: 100%;color:{{object.word_color?object.word_color:"#fff"}}'>  
41 - <text style="font-size: 40rpx;" class="iconfont icon-search" bindtap='sear'></text>  
42 - <input id="find_inp" class="find_inp2" value=""  
43 - bindconfirm="sear" bindinput='set_input' focus="{{inputShowed}}" />  
44 - </navigator> 35 + <view wx:else class="s1_gk_a2" style='color:{{object.word_color?object.word_color:"#fff"}}'>
  36 + <!-- <view class="pr"> -->
  37 + <view class="flex ali-c">
  38 + <text style="font-size: 40rpx;" class="iconfont icon-search" bindtap='sear'></text>
  39 + <input id="find_inp" class="find_inp2" value=""
  40 + bindconfirm="sear" bindinput='set_input' focus="{{inputShowed}}"/>
  41 + </view>
  42 + <view class="his_str">
  43 + <view class="item">历史搜索</view>
  44 + <view class="item">2121</view>
  45 + <view class="item">2121</view>
  46 + <view class="item">2121</view>
  47 + <view class="clear">清除</view>
  48 + </view>
  49 + <!-- wx:if="{{inputShowed}}" -->
  50 +
  51 + <!-- </view> -->
  52 +
  53 +
  54 + </view>
45 </view> 55 </view>
46 <view class='s2_right'> 56 <view class='s2_right'>
47 <navigator open-type="switchTab" url="/pages/cart/cart/cart" class="s1_gk_a1"> 57 <navigator open-type="switchTab" url="/pages/cart/cart/cart" class="s1_gk_a1">
48 <image src='{{imghost}}/miniapp/images/model/car.png' style="margin:0;;"></image> 58 <image src='{{imghost}}/miniapp/images/model/car.png' style="margin:0;;"></image>
49 </navigator> 59 </navigator>
50 </view> 60 </view>
  61 +
  62 +
51 63
52 - <view class="his_str" style="bottom: -190rpx;" wx:if="{{inputShowed}}"> 64 + <!-- <view class="his_str" style="bottom: -190rpx;" wx:if="{{inputShowed}}">
53 <view>历史搜索</view> 65 <view>历史搜索</view>
54 <view>2121</view> 66 <view>2121</view>
55 <view>2121</view> 67 <view>2121</view>
56 <view>2121</view> 68 <view>2121</view>
57 - </view> 69 + </view> -->
58 </view> 70 </view>
59 </block> 71 </block>
60 \ No newline at end of file 72 \ No newline at end of file
components/diy_searchbox/diy_searchbox.wxss
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 42
43 .s2_cen{ 43 .s2_cen{
44 width: 80%; 44 width: 80%;
45 - height: 70rpx; 45 + /* height: 70rpx; */
46 color: #fff; 46 color: #fff;
47 text-align: left; 47 text-align: left;
48 font-size: 28rpx; 48 font-size: 28rpx;
@@ -110,10 +110,33 @@ @@ -110,10 +110,33 @@
110 } 110 }
111 111
112 .his_str{ 112 .his_str{
113 - text-align: left;  
114 position: absolute; 113 position: absolute;
115 - bottom: -110%;  
116 - z-index: 100;  
117 - background-color: #fff;  
118 - width: 94%; 114 + width: 600rpx;
  115 + top: 76rpx;
  116 + z-index: 999;
  117 + color: black;
  118 + background-color: white;
  119 + border: 2rpx solid #f0f0f0;
  120 + box-sizing: border-box;
  121 +}
  122 +
  123 +.pr {
  124 + position: relative;
  125 +}
  126 +
  127 +.ali-c {
  128 + align-items: center;
  129 +}
  130 +
  131 +.item {
  132 + padding: 0 20rpx;
  133 + border-bottom: 2rpx solid #f0f0f0;
  134 +}
  135 +/* .item ~ .item {
  136 + border-top: 2rpx solid #f0f0f0;
  137 +} */
  138 +
  139 +.clear {
  140 + text-align: right;
  141 + padding: 0 20rpx;
119 } 142 }
120 \ No newline at end of file 143 \ No newline at end of file