Commit 64dad502366e692e3e21a75b43acfd2e90aeb106
1 parent
5d869d2c
搜索框的优化
Showing
21 changed files
with
285 additions
and
53 deletions
components/lb_sear/lb_sear.js
0 → 100644
1 | +var t = getApp(), os = t.globalData.setting; | |
2 | +Component({ | |
3 | + properties: {}, | |
4 | + data: { | |
5 | + f_sear:0, | |
6 | + sear_key:'' | |
7 | + }, | |
8 | + | |
9 | + ready: function() {}, | |
10 | + methods: { | |
11 | + show_sear_inp(){ | |
12 | + this.setData({f_sear:1}); | |
13 | + }, | |
14 | + blur_sear(){ | |
15 | + if(!this.data.sear_key) | |
16 | + this.setData({f_sear:0}); | |
17 | + }, | |
18 | + | |
19 | + search_lb(){ | |
20 | + this.triggerEvent('search_lb'); | |
21 | + }, | |
22 | + | |
23 | + input_sear(e){ | |
24 | + let value = e.detail.value; | |
25 | + this.data.sear_key=value; | |
26 | + this.triggerEvent('input_sear',value); | |
27 | + } | |
28 | + | |
29 | + } | |
30 | + | |
31 | +}) | |
0 | 32 | \ No newline at end of file | ... | ... |
components/lb_sear/lb_sear.json
0 → 100644
components/lb_sear/lb_sear.wxml
0 → 100644
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> | |
3 | + <view wx:else><input bindinput="input_sear" bindconfirm="search_lb" bindblur="blur_sear" focus="{{f_sear==1}}" style="width: 660rpx;"/> </view> | |
4 | +</view> | ... | ... |
components/lb_sear/lb_sear.wxss
0 → 100644
packageA/pages/myGift/myGift.js
... | ... | @@ -20,7 +20,8 @@ Page({ |
20 | 20 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
21 | 21 | pageNum: 1, // 当前页数 |
22 | 22 | iurl: os.imghost, //图片前缀网址 |
23 | - is_summit_ing:0 //是不是提交申请 | |
23 | + is_summit_ing:0, //是不是提交申请 | |
24 | + sear_key:'' //顶部搜索关键子 | |
24 | 25 | }, |
25 | 26 | |
26 | 27 | clickTab(e) { |
... | ... | @@ -44,6 +45,10 @@ Page({ |
44 | 45 | } else if(index == 1) { |
45 | 46 | url = '/api/weshop/libao/libaoFormvip/page'; |
46 | 47 | }; |
48 | + | |
49 | + if(this.data.sear_key){ | |
50 | + data.key_str=this.data.sear_key; | |
51 | + } | |
47 | 52 | |
48 | 53 | this.getData(true, url, data); |
49 | 54 | |
... | ... | @@ -161,7 +166,7 @@ Page({ |
161 | 166 | |
162 | 167 | if(index == 0) { |
163 | 168 | url = '/api/weshop/libao/libaoForm/page'; |
164 | - data.timetype=2; | |
169 | + data.timetype=1; | |
165 | 170 | } else if(index == 1) { |
166 | 171 | url = '/api/weshop/libao/libaoFormvip/page'; |
167 | 172 | }; |
... | ... | @@ -205,6 +210,10 @@ Page({ |
205 | 210 | user_id: app.globalData.user_id, |
206 | 211 | } |
207 | 212 | |
213 | + if(this.data.sear_key){ | |
214 | + req_data.key_str=this.data.sear_key; | |
215 | + } | |
216 | + | |
208 | 217 | if(index == 0) { |
209 | 218 | url = '/api/weshop/libao/libaoForm/page'; |
210 | 219 | req_data.timetype=1; |
... | ... | @@ -431,6 +440,38 @@ Page({ |
431 | 440 | |
432 | 441 | close_remark:function(){ |
433 | 442 | this.setData({show_rem_pop:0,}) |
443 | + }, | |
444 | + | |
445 | + search_lb(){ | |
446 | + | |
447 | + let index=this.data.currentIndex; | |
448 | + let url = ''; | |
449 | + let data = { | |
450 | + store_id: app.globalData.setting.stoid, | |
451 | + user_id: app.globalData.user_id, | |
452 | + }; | |
453 | + this.setData({ | |
454 | + list: null, | |
455 | + pageNum: 1, | |
456 | + noMore: false, | |
457 | + }); | |
458 | + | |
459 | + if(index == 0) { | |
460 | + url = '/api/weshop/libao/libaoForm/page'; | |
461 | + data.timetype=2; | |
462 | + } else if(index == 1) { | |
463 | + url = '/api/weshop/libao/libaoFormvip/page'; | |
464 | + }; | |
465 | + | |
466 | + if(this.data.sear_key){ | |
467 | + data.key_str=this.data.sear_key; | |
468 | + } | |
469 | + this.getData(true, url, data); | |
470 | + }, | |
471 | + | |
472 | + input_sear(e){ | |
473 | + let value = e.detail; | |
474 | + this.data.sear_key=value; | |
434 | 475 | } |
435 | 476 | |
436 | 477 | }) |
437 | 478 | \ No newline at end of file | ... | ... |
packageA/pages/myGift/myGift.json
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | "warn": "/components/long_warn/long_warn", |
6 | 6 | "nav_b": "/components/nav_b/nav_b", |
7 | 7 | "my_confirm": "/components/my_confirm/my_confirm", |
8 | - "nodata": "/components/nodata/nodata" | |
8 | + "nodata": "/components/nodata/nodata", | |
9 | + "lb_sear": "/components/lb_sear/lb_sear" | |
9 | 10 | } |
10 | 11 | } |
11 | 12 | \ No newline at end of file | ... | ... |
packageA/pages/myGift/myGift.wxml
... | ... | @@ -2,15 +2,16 @@ |
2 | 2 | <view> |
3 | 3 | |
4 | 4 | <block wx:if="{{ad_data}}"> |
5 | - <view class="top_img"> | |
5 | + <view class="top_img rel"> | |
6 | 6 | <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" |
7 | 7 | binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
8 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
8 | 9 | </view> |
9 | 10 | </block> |
10 | 11 | <block wx:else> |
11 | - <view class="top_img"> | |
12 | - <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> | |
12 | + <view class="top_img rel"> | |
13 | 13 | <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true"></image> |
14 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
14 | 15 | </view> |
15 | 16 | </block> |
16 | 17 | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
... | ... | @@ -439,10 +439,17 @@ Page({ |
439 | 439 | }, |
440 | 440 | |
441 | 441 | getList: function (e) { |
442 | + | |
443 | + if(this.data.ismore) return false; | |
444 | + if(this.data.searching) return false; | |
445 | + this.data.searching=1; | |
446 | + | |
447 | + wx.showLoading({ | |
448 | + title: '加载中.', | |
449 | + }) | |
450 | + | |
442 | 451 | var th = this; |
443 | - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { | |
444 | - isShowLoading: true, | |
445 | - data: { | |
452 | + var r_q={ | |
446 | 453 | store_id: th.data.getStorageID, //商家ID |
447 | 454 | user_id: th.data.getUserID, //用户ID |
448 | 455 | page: th.data.curpage, |
... | ... | @@ -450,8 +457,19 @@ Page({ |
450 | 457 | is_end:0, |
451 | 458 | timetype:1, |
452 | 459 | is_act:0 |
453 | - }, | |
460 | + } | |
461 | + | |
462 | + if(this.data.sear_key){ | |
463 | + r_q.key_str=this.data.sear_key; | |
464 | + } | |
465 | + | |
466 | + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { | |
467 | + isShowLoading: true, | |
468 | + data:r_q, | |
454 | 469 | success: function (res) { |
470 | + | |
471 | + this.data.searching=0; | |
472 | + | |
455 | 473 | if (res.data.code == 0) { |
456 | 474 | th.data.curpage++; |
457 | 475 | var arr1 = th.data.wareCard; |
... | ... | @@ -488,6 +506,9 @@ Page({ |
488 | 506 | is_get:1 |
489 | 507 | }) |
490 | 508 | } |
509 | + | |
510 | + wx.hideLoading(); | |
511 | + | |
491 | 512 | } |
492 | 513 | }) |
493 | 514 | |
... | ... | @@ -852,5 +873,17 @@ Page({ |
852 | 873 | |
853 | 874 | buy_libao:function () { |
854 | 875 | com.buy_libao(this) |
876 | + }, | |
877 | + | |
878 | + search_lb(){ | |
879 | + this.data.curpage=0; | |
880 | + this.searching=0; | |
881 | + this.setData({ismore:0,is_get:0,wareCard:[]}); | |
882 | + this.getList(); | |
883 | + }, | |
884 | + | |
885 | + input_sear(e){ | |
886 | + let value = e.detail; | |
887 | + this.data.sear_key=value; | |
855 | 888 | } |
856 | 889 | }) |
857 | 890 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | "navigationBarTitleText": "礼包列表", |
3 | 3 | "usingComponents": { |
4 | 4 | "warn": "/components/long_warn/long_warn", |
5 | - "my_confirm": "/components/my_confirm/my_confirm" | |
5 | + "my_confirm": "/components/my_confirm/my_confirm", | |
6 | + "lb_sear": "/components/lb_sear/lb_sear" | |
6 | 7 | } |
7 | 8 | } |
8 | 9 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml
1 | 1 | <wxs module="filter" src="../../../../../utils/filter.wxs"></wxs> |
2 | 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> |
3 | 3 | <block wx:if="{{ad_data}}"> |
4 | - <view class="top_img"> | |
4 | + <view class="top_img rel"> | |
5 | 5 | <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
6 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
6 | 7 | </view> |
7 | 8 | </block> |
8 | 9 | <block wx:else> |
9 | - <view class="top_img"> | |
10 | + <view class="top_img rel"> | |
10 | 11 | <image src="{{iurl+'/miniapp/images/monthgiftbagtop.png?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
12 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
11 | 13 | </view> |
12 | 14 | </block> |
13 | 15 | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.js
... | ... | @@ -27,6 +27,8 @@ Page({ |
27 | 27 | total: 0, //总数量 |
28 | 28 | ad_data: null, |
29 | 29 | first_leader: e.globalData.first_leader || 0, // 推荐人ID |
30 | + | |
31 | + sear_key:'' | |
30 | 32 | }, |
31 | 33 | onLoad: function (options) { |
32 | 34 | this.setData({ |
... | ... | @@ -98,19 +100,38 @@ Page({ |
98 | 100 | |
99 | 101 | |
100 | 102 | }, |
103 | + | |
101 | 104 | getList: function () { |
105 | + | |
106 | + if(this.data.ismore) return false; | |
107 | + if(this.data.searching) return false; | |
108 | + this.data.searching=1; | |
109 | + | |
110 | + wx.showLoading({ | |
111 | + title: '加载中.', | |
112 | + }) | |
113 | + | |
102 | 114 | var th = this; |
115 | + let r_q={ | |
116 | + store_id: th.data.getStorageID, //商家ID | |
117 | + user_id: th.data.getUserID, //用户ID | |
118 | + page: th.data.curpage, | |
119 | + pageSize: th.data.pageSize, | |
120 | + pay_state:1 | |
121 | + }; | |
122 | + | |
123 | + if(this.data.sear_key){ | |
124 | + r_q.key_str=this.data.sear_key; | |
125 | + } | |
126 | + | |
103 | 127 | |
104 | 128 | getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagRecord/page', { |
105 | 129 | isShowLoading: true, |
106 | - data: { | |
107 | - store_id: th.data.getStorageID, //商家ID | |
108 | - user_id: th.data.getUserID, //用户ID | |
109 | - page: th.data.curpage, | |
110 | - pageSize: th.data.pageSize, | |
111 | - pay_state:1 | |
112 | - }, | |
130 | + data:r_q , | |
113 | 131 | success: function (res) { |
132 | + | |
133 | + th.data.searching=0; | |
134 | + | |
114 | 135 | if (res.data.code == 0) { |
115 | 136 | |
116 | 137 | var arr1 = th.data.wareCard; |
... | ... | @@ -156,6 +177,8 @@ Page({ |
156 | 177 | }) |
157 | 178 | } |
158 | 179 | |
180 | + wx.hideLoading(); | |
181 | + | |
159 | 182 | } |
160 | 183 | |
161 | 184 | }); |
... | ... | @@ -226,5 +249,17 @@ Page({ |
226 | 249 | } |
227 | 250 | }, |
228 | 251 | |
252 | + search_lb(){ | |
253 | + this.data.curpage=0; | |
254 | + this.searching=0; | |
255 | + this.setData({ismore:0,is_get:0,wareCard:[]}); | |
256 | + this.getList(); | |
257 | + }, | |
258 | + | |
259 | + input_sear(e){ | |
260 | + let value = e.detail; | |
261 | + this.data.sear_key=value; | |
262 | + } | |
263 | + | |
229 | 264 | |
230 | 265 | }); |
231 | 266 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.json
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | "enablePullDownRefresh": false, |
4 | 4 | "usingComponents": { |
5 | 5 | "warn": "/components/long_warn/long_warn", |
6 | - "my_confirm": "/components/my_confirm/my_confirm" | |
6 | + "my_confirm": "/components/my_confirm/my_confirm", | |
7 | + "lb_sear": "/components/lb_sear/lb_sear" | |
7 | 8 | } |
8 | 9 | } |
9 | 10 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
1 | 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> |
2 | 2 | <block wx:if="{{ad_data}}"> |
3 | - <view class="top_img"> | |
3 | + <view class="top_img rel"> | |
4 | 4 | <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
5 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
5 | 6 | </view> |
6 | 7 | </block> |
7 | 8 | <block wx:else> |
8 | - <view class="top_img"> | |
9 | - <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> | |
10 | - <image mode="widthFix" src="{{iurl+'/miniapp/images/monthgiftbagtop.png?v=2019'}}" lazy-load="true"></image> | |
9 | + <view class="top_img rel"> | |
10 | + <image mode="widthFix" src="{{iurl+'/miniapp/images/monthgiftbagtop.png?v=2019'}}" lazy-load="true"></image> | |
11 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
11 | 12 | </view> |
12 | 13 | </block> |
13 | 14 | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
... | ... | @@ -71,6 +71,8 @@ Page({ |
71 | 71 | keyword:'', //门店搜索 |
72 | 72 | sec_i:-1,//选中分类门店 下标 |
73 | 73 | |
74 | + sear_key:'' | |
75 | + | |
74 | 76 | }, |
75 | 77 | onLoad: function (options) { |
76 | 78 | var th=this; |
... | ... | @@ -431,17 +433,35 @@ Page({ |
431 | 433 | }, |
432 | 434 | |
433 | 435 | getList: function (e) { |
436 | + | |
437 | + if(this.data.ismore) return false; | |
438 | + if(this.data.searching) return false; | |
439 | + this.data.searching=1; | |
440 | + | |
441 | + wx.showLoading({ | |
442 | + title: '加载中.', | |
443 | + }) | |
444 | + | |
434 | 445 | var th = this; |
446 | + let r_q={ | |
447 | + storeId: th.data.getStorageID, //商家ID | |
448 | + userId: th.data.getUserID, //用户ID | |
449 | + page: th.data.curpage, | |
450 | + pageSize: th.data.pageSize, | |
451 | + is_share:0 | |
452 | + }; | |
453 | + | |
454 | + if(this.data.sear_key){ | |
455 | + r_q.key_str=this.data.sear_key; | |
456 | + } | |
457 | + | |
435 | 458 | getApp().request.get('/api/weshop/marketing/giftbag/page', { |
436 | 459 | isShowLoading: true, |
437 | - data: { | |
438 | - storeId: th.data.getStorageID, //商家ID | |
439 | - userId: th.data.getUserID, //用户ID | |
440 | - page: th.data.curpage, | |
441 | - pageSize: th.data.pageSize, | |
442 | - is_share:0 | |
443 | - }, | |
460 | + data: r_q, | |
444 | 461 | success: function (res) { |
462 | + | |
463 | + th.data.searching=0; | |
464 | + | |
445 | 465 | if (res.data.code == 0) { |
446 | 466 | th.data.curpage++; |
447 | 467 | var arr1 = th.data.wareCard; |
... | ... | @@ -460,6 +480,7 @@ Page({ |
460 | 480 | is_read: 1, |
461 | 481 | is_get:1 |
462 | 482 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
483 | + | |
463 | 484 | } else { |
464 | 485 | th.setData({ |
465 | 486 | is_read: 1, |
... | ... | @@ -467,6 +488,9 @@ Page({ |
467 | 488 | is_get:1 |
468 | 489 | }) |
469 | 490 | } |
491 | + | |
492 | + wx.hideLoading(); | |
493 | + | |
470 | 494 | } |
471 | 495 | }) |
472 | 496 | |
... | ... | @@ -825,5 +849,18 @@ Page({ |
825 | 849 | |
826 | 850 | buy_libao:function () { |
827 | 851 | com.buy_libao(this) |
852 | + }, | |
853 | + | |
854 | + search_lb(){ | |
855 | + this.data.curpage=0; | |
856 | + this.searching=0; | |
857 | + this.setData({ismore:0,is_get:0,wareCard:[]}); | |
858 | + this.getList(); | |
859 | + }, | |
860 | + | |
861 | + input_sear(e){ | |
862 | + let value = e.detail; | |
863 | + this.data.sear_key=value; | |
828 | 864 | } |
865 | + | |
829 | 866 | }) |
830 | 867 | \ No newline at end of file | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.json
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | "navigationBarTitleText": "礼包列表", |
3 | 3 | "usingComponents": { |
4 | 4 | "warn": "/components/long_warn/long_warn", |
5 | - "my_confirm": "/components/my_confirm/my_confirm" | |
5 | + "my_confirm": "/components/my_confirm/my_confirm", | |
6 | + "lb_sear": "/components/lb_sear/lb_sear" | |
6 | 7 | } |
7 | 8 | } |
8 | 9 | \ No newline at end of file | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.wxml
1 | 1 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
2 | 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> |
3 | 3 | <block wx:if="{{ad_data}}"> |
4 | - <view class="top_img"> | |
4 | + <view class="top_img rel"> | |
5 | 5 | <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
6 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
6 | 7 | </view> |
7 | 8 | </block> |
8 | 9 | <block wx:else> |
9 | - <view class="top_img"> | |
10 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | |
10 | + <view class="top_img rel"> | |
11 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | |
12 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
11 | 13 | </view> |
12 | 14 | </block> |
13 | 15 | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.wxss
pages/giftpack/mygiftpack/mygiftpack.js
... | ... | @@ -28,6 +28,8 @@ Page({ |
28 | 28 | total: 0, //总数量 |
29 | 29 | ad_data: null, |
30 | 30 | first_leader: e.globalData.first_leader || 0, // 推荐人ID |
31 | + | |
32 | + sear_key:'' //顶部搜索关键子 | |
31 | 33 | }, |
32 | 34 | onLoad: function (options) { |
33 | 35 | this.setData({ |
... | ... | @@ -94,17 +96,34 @@ Page({ |
94 | 96 | |
95 | 97 | }, |
96 | 98 | getList: function () { |
99 | + | |
100 | + if(this.data.ismore) return false; | |
101 | + if(this.data.searching) return false; | |
102 | + this.data.searching=1; | |
103 | + | |
104 | + wx.showLoading({ | |
105 | + title: '加载中.', | |
106 | + }) | |
107 | + | |
97 | 108 | var th = this; |
109 | + let r_q={ | |
110 | + storeId: th.data.getStorageID, //商家ID | |
111 | + userId: th.data.getUserID, //用户ID | |
112 | + page: th.data.curpage, | |
113 | + pageSize: th.data.pageSize | |
114 | + } | |
115 | + | |
116 | + if(this.data.sear_key){ | |
117 | + r_q.key_str=this.data.sear_key; | |
118 | + } | |
98 | 119 | |
99 | 120 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
100 | 121 | isShowLoading: true, |
101 | - data: { | |
102 | - storeId: th.data.getStorageID, //商家ID | |
103 | - userId: th.data.getUserID, //用户ID | |
104 | - page: th.data.curpage, | |
105 | - pageSize: th.data.pageSize | |
106 | - }, | |
122 | + data: r_q, | |
107 | 123 | success: function (res) { |
124 | + | |
125 | + th.data.searching=0; | |
126 | + | |
108 | 127 | if (res.data.code == 0) { |
109 | 128 | th.data.curpage++; |
110 | 129 | var arr1 = th.data.wareCard; |
... | ... | @@ -155,6 +174,8 @@ Page({ |
155 | 174 | }) |
156 | 175 | } |
157 | 176 | |
177 | + wx.hideLoading(); | |
178 | + | |
158 | 179 | } |
159 | 180 | |
160 | 181 | }); |
... | ... | @@ -203,7 +224,7 @@ Page({ |
203 | 224 | |
204 | 225 | //--- 分享设置 -- |
205 | 226 | onShareAppMessage: function (e) { |
206 | - getApp().globalData.no_clear=1; | |
227 | + getApp().globalData.no_clear=1; | |
207 | 228 | var curPage = this; |
208 | 229 | var pagePath = curPage.route; //当前页面url |
209 | 230 | if (pagePath.indexOf('/') != 0) { |
... | ... | @@ -216,14 +237,25 @@ Page({ |
216 | 237 | } |
217 | 238 | }, |
218 | 239 | |
219 | - onShareTimeline() { | |
240 | + onShareTimeline() { | |
220 | 241 | getApp().globalData.no_clear=1; |
221 | 242 | return { |
222 | 243 | title: '专享礼包', |
223 | 244 | imageUrl: this.data.ad_data.ad_code, |
224 | 245 | query: "first_leader=" + this.data.getUserID |
225 | 246 | } |
226 | - }, | |
247 | + }, | |
248 | + | |
249 | + search_lb(){ | |
250 | + this.data.curpage=0; | |
251 | + this.searching=0; | |
252 | + this.setData({ismore:0,is_get:0,wareCard:[]}); | |
253 | + this.getList(); | |
254 | + }, | |
227 | 255 | |
256 | + input_sear(e){ | |
257 | + let value = e.detail; | |
258 | + this.data.sear_key=value; | |
259 | + } | |
228 | 260 | |
229 | 261 | }); |
230 | 262 | \ No newline at end of file | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.json
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | "enablePullDownRefresh": false, |
4 | 4 | "usingComponents": { |
5 | 5 | "warn": "/components/long_warn/long_warn", |
6 | - "my_confirm": "/components/my_confirm/my_confirm" | |
6 | + "my_confirm": "/components/my_confirm/my_confirm", | |
7 | + "lb_sear": "/components/lb_sear/lb_sear" | |
7 | 8 | } |
8 | 9 | } |
9 | 10 | \ No newline at end of file | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxml
1 | 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> |
2 | 2 | <block wx:if="{{ad_data}}"> |
3 | - <view class="top_img"> | |
4 | - <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | |
3 | + <view class="top_img rel"> | |
4 | + <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | |
5 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
5 | 6 | </view> |
6 | 7 | </block> |
7 | 8 | <block wx:else> |
8 | - <view class="top_img"> | |
9 | - <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> | |
10 | - <image mode="widthFix" src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true"></image> | |
9 | + <view class="top_img rel"> | |
10 | + <image mode="widthFix" src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true"></image> | |
11 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | |
11 | 12 | </view> |
12 | 13 | </block> |
13 | 14 | ... | ... |