Commit 0a9bc8f50b0c7882f49f265aa70a598bc5899f8a

Authored by vking
1 parent e9ddd1b7

search

@@ -266,4 +266,10 @@ Page({ @@ -266,4 +266,10 @@ Page({
266 }) 266 })
267 }) 267 })
268 }, 268 },
  269 + clearKeyword(){
  270 + this.setData({
  271 + keyword:'',
  272 + suggestion:[],
  273 + })
  274 + }
269 }) 275 })
@@ -7,7 +7,10 @@ @@ -7,7 +7,10 @@
7 <input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间" 7 <input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
8 type="text" confirm-type="done" 8 type="text" confirm-type="done"
9 focus 9 focus
10 - bindinput="getsuggest" value="{{backfill}}"/> 10 + bindinput="getsuggest" value="{{keyword}}"/>
  11 + <image class="icon icon-del" wx:if="{{keyword.length>0}}"
  12 + catchtap="clearKeyword"
  13 + src="https://qn.colorcun.com/reserve/images/del.png"></image>
11 </view> 14 </view>
12 </view> 15 </view>
13 <view class="res-view"> 16 <view class="res-view">
@@ -33,6 +33,11 @@ @@ -33,6 +33,11 @@
33 height: 26rpx; 33 height: 26rpx;
34 margin: 0 20rpx; 34 margin: 0 20rpx;
35 } 35 }
  36 +.searchAddr .icon-del{
  37 + min-width: 28rpx;
  38 + width: 28rpx;
  39 + height: 28rpx;
  40 +}
36 .res-view{ 41 .res-view{
37 margin-top: 110rpx; 42 margin-top: 110rpx;
38 } 43 }