Commit 0a7321e71de5c4ea2805f11fa6d02d4fffca8e72

Authored by yvan.ni
1 parent 19e449b2

礼包搜索的优化 叉叉

components/lb_sear/lb_sear.js
@@ -22,10 +22,18 @@ Component({ @@ -22,10 +22,18 @@ Component({
22 22
23 input_sear(e){ 23 input_sear(e){
24 let value = e.detail.value; 24 let value = e.detail.value;
25 - this.data.sear_key=value; 25 + this.setData({sear_key:value});
26 this.triggerEvent('input_sear',value); 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 \ No newline at end of file 40 \ No newline at end of file
components/lb_sear/lb_sear.wxml
1 <view class="flex jc-center ai-center abs c-9 t_search_box"> 1 <view class="flex jc-center ai-center abs c-9 t_search_box">
2 <view bindtap="show_sear_inp" wx:if="{{f_sear==0}}"><text class="iconfont icon-search_fd"></text>搜索礼包</view> 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 </view> 8 </view>
components/lb_sear/lb_sear.wxss
@@ -2,3 +2,7 @@ @@ -2,3 +2,7 @@
2 .t_search_box{ 2 .t_search_box{
3 border-radius:20rpx;bottom: 10rpx; width: 700rpx; left: 25rpx; height: 80rpx; background-color:rgba(255, 255, 255, 0.7); 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 \ No newline at end of file 9 \ No newline at end of file
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
@@ -468,8 +468,7 @@ Page({ @@ -468,8 +468,7 @@ Page({
468 data:r_q, 468 data:r_q,
469 success: function (res) { 469 success: function (res) {
470 470
471 - this.data.searching=0;  
472 - 471 + th.data.searching=0;
473 if (res.data.code == 0) { 472 if (res.data.code == 0) {
474 th.data.curpage++; 473 th.data.curpage++;
475 var arr1 = th.data.wareCard; 474 var arr1 = th.data.wareCard;