Commit 0a7321e71de5c4ea2805f11fa6d02d4fffca8e72
1 parent
19e449b2
礼包搜索的优化 叉叉
Showing
4 changed files
with
19 additions
and
4 deletions
components/lb_sear/lb_sear.js
... | ... | @@ -22,10 +22,18 @@ Component({ |
22 | 22 | |
23 | 23 | input_sear(e){ |
24 | 24 | let value = e.detail.value; |
25 | - this.data.sear_key=value; | |
25 | + this.setData({sear_key:value}); | |
26 | 26 | this.triggerEvent('input_sear',value); |
27 | + }, | |
28 | + | |
29 | + //-- 置空文本输入 -- | |
30 | + close_txt(e){ | |
31 | + this.setData({sear_key:'',f_sear:1}); | |
32 | + this.triggerEvent('input_sear',''); | |
27 | 33 | } |
28 | 34 | |
35 | + | |
36 | + | |
29 | 37 | } |
30 | 38 | |
31 | 39 | }) |
32 | 40 | \ No newline at end of file | ... | ... |
components/lb_sear/lb_sear.wxml
1 | 1 | <view class="flex jc-center ai-center abs c-9 t_search_box"> |
2 | 2 | <view bindtap="show_sear_inp" wx:if="{{f_sear==0}}"><text class="iconfont icon-search_fd"></text>搜索礼包</view> |
3 | - <view wx:else><input bindinput="input_sear" bindconfirm="search_lb" bindblur="blur_sear" focus="{{f_sear==1}}" style="width: 660rpx;"/> </view> | |
3 | + <view class="rel inp_box0" wx:else> | |
4 | + <input bindinput="input_sear" bindconfirm="search_lb" value="{{sear_key}}" | |
5 | + bindblur="blur_sear" focus="{{f_sear==1}}" style="width: 660rpx;"/> | |
6 | + <view hidden="{{!sear_key}}" catchtap="close_txt" class="abs close_box fs30"><text class="iconfont icon-guan"></text></view> | |
7 | + </view> | |
4 | 8 | </view> | ... | ... |
components/lb_sear/lb_sear.wxss
... | ... | @@ -2,3 +2,7 @@ |
2 | 2 | .t_search_box{ |
3 | 3 | border-radius:20rpx;bottom: 10rpx; width: 700rpx; left: 25rpx; height: 80rpx; background-color:rgba(255, 255, 255, 0.7); |
4 | 4 | } |
5 | + | |
6 | +.inp_box0{ display: flex; align-items: center; height: 80rpx;} | |
7 | + | |
8 | +.close_box{top: 0;right: 0; width: 50rpx; height: 80rpx; text-align: right; z-index: 1000;line-height: 80rpx } | |
5 | 9 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js