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 | \ No newline at end of file | 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,7 +20,8 @@ Page({ | ||
| 20 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 | 20 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
| 21 | pageNum: 1, // 当前页数 | 21 | pageNum: 1, // 当前页数 |
| 22 | iurl: os.imghost, //图片前缀网址 | 22 | iurl: os.imghost, //图片前缀网址 |
| 23 | - is_summit_ing:0 //是不是提交申请 | 23 | + is_summit_ing:0, //是不是提交申请 |
| 24 | + sear_key:'' //顶部搜索关键子 | ||
| 24 | }, | 25 | }, |
| 25 | 26 | ||
| 26 | clickTab(e) { | 27 | clickTab(e) { |
| @@ -44,6 +45,10 @@ Page({ | @@ -44,6 +45,10 @@ Page({ | ||
| 44 | } else if(index == 1) { | 45 | } else if(index == 1) { |
| 45 | url = '/api/weshop/libao/libaoFormvip/page'; | 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 | this.getData(true, url, data); | 53 | this.getData(true, url, data); |
| 49 | 54 | ||
| @@ -161,7 +166,7 @@ Page({ | @@ -161,7 +166,7 @@ Page({ | ||
| 161 | 166 | ||
| 162 | if(index == 0) { | 167 | if(index == 0) { |
| 163 | url = '/api/weshop/libao/libaoForm/page'; | 168 | url = '/api/weshop/libao/libaoForm/page'; |
| 164 | - data.timetype=2; | 169 | + data.timetype=1; |
| 165 | } else if(index == 1) { | 170 | } else if(index == 1) { |
| 166 | url = '/api/weshop/libao/libaoFormvip/page'; | 171 | url = '/api/weshop/libao/libaoFormvip/page'; |
| 167 | }; | 172 | }; |
| @@ -205,6 +210,10 @@ Page({ | @@ -205,6 +210,10 @@ Page({ | ||
| 205 | user_id: app.globalData.user_id, | 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 | if(index == 0) { | 217 | if(index == 0) { |
| 209 | url = '/api/weshop/libao/libaoForm/page'; | 218 | url = '/api/weshop/libao/libaoForm/page'; |
| 210 | req_data.timetype=1; | 219 | req_data.timetype=1; |
| @@ -431,6 +440,38 @@ Page({ | @@ -431,6 +440,38 @@ Page({ | ||
| 431 | 440 | ||
| 432 | close_remark:function(){ | 441 | close_remark:function(){ |
| 433 | this.setData({show_rem_pop:0,}) | 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 | \ No newline at end of file | 478 | \ No newline at end of file |
packageA/pages/myGift/myGift.json
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | "warn": "/components/long_warn/long_warn", | 5 | "warn": "/components/long_warn/long_warn", |
| 6 | "nav_b": "/components/nav_b/nav_b", | 6 | "nav_b": "/components/nav_b/nav_b", |
| 7 | "my_confirm": "/components/my_confirm/my_confirm", | 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 | \ No newline at end of file | 12 | \ No newline at end of file |
packageA/pages/myGift/myGift.wxml
| @@ -2,15 +2,16 @@ | @@ -2,15 +2,16 @@ | ||
| 2 | <view> | 2 | <view> |
| 3 | 3 | ||
| 4 | <block wx:if="{{ad_data}}"> | 4 | <block wx:if="{{ad_data}}"> |
| 5 | - <view class="top_img"> | 5 | + <view class="top_img rel"> |
| 6 | <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" | 6 | <image mode="widthFix" src="{{ad_data.ad_code}}" lazy-load="true" |
| 7 | binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | 7 | binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
| 8 | + <lb_sear bindinput_sear="input_sear" bindsearch_lb="search_lb"></lb_sear> | ||
| 8 | </view> | 9 | </view> |
| 9 | </block> | 10 | </block> |
| 10 | <block wx:else> | 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 | <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true"></image> | 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 | </view> | 15 | </view> |
| 15 | </block> | 16 | </block> |
| 16 | 17 |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
| @@ -439,10 +439,17 @@ Page({ | @@ -439,10 +439,17 @@ Page({ | ||
| 439 | }, | 439 | }, |
| 440 | 440 | ||
| 441 | getList: function (e) { | 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 | var th = this; | 451 | var th = this; |
| 443 | - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { | ||
| 444 | - isShowLoading: true, | ||
| 445 | - data: { | 452 | + var r_q={ |
| 446 | store_id: th.data.getStorageID, //商家ID | 453 | store_id: th.data.getStorageID, //商家ID |
| 447 | user_id: th.data.getUserID, //用户ID | 454 | user_id: th.data.getUserID, //用户ID |
| 448 | page: th.data.curpage, | 455 | page: th.data.curpage, |
| @@ -450,8 +457,19 @@ Page({ | @@ -450,8 +457,19 @@ Page({ | ||
| 450 | is_end:0, | 457 | is_end:0, |
| 451 | timetype:1, | 458 | timetype:1, |
| 452 | is_act:0 | 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 | success: function (res) { | 469 | success: function (res) { |
| 470 | + | ||
| 471 | + this.data.searching=0; | ||
| 472 | + | ||
| 455 | if (res.data.code == 0) { | 473 | if (res.data.code == 0) { |
| 456 | th.data.curpage++; | 474 | th.data.curpage++; |
| 457 | var arr1 = th.data.wareCard; | 475 | var arr1 = th.data.wareCard; |
| @@ -488,6 +506,9 @@ Page({ | @@ -488,6 +506,9 @@ Page({ | ||
| 488 | is_get:1 | 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,5 +873,17 @@ Page({ | ||
| 852 | 873 | ||
| 853 | buy_libao:function () { | 874 | buy_libao:function () { |
| 854 | com.buy_libao(this) | 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 | \ No newline at end of file | 890 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | "navigationBarTitleText": "礼包列表", | 2 | "navigationBarTitleText": "礼包列表", |
| 3 | "usingComponents": { | 3 | "usingComponents": { |
| 4 | "warn": "/components/long_warn/long_warn", | 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 | \ No newline at end of file | 9 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml
| 1 | <wxs module="filter" src="../../../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filter" src="../../../../../utils/filter.wxs"></wxs> |
| 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> | 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> |
| 3 | <block wx:if="{{ad_data}}"> | 3 | <block wx:if="{{ad_data}}"> |
| 4 | - <view class="top_img"> | 4 | + <view class="top_img rel"> |
| 5 | <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | 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 | </view> | 7 | </view> |
| 7 | </block> | 8 | </block> |
| 8 | <block wx:else> | 9 | <block wx:else> |
| 9 | - <view class="top_img"> | 10 | + <view class="top_img rel"> |
| 10 | <image src="{{iurl+'/miniapp/images/monthgiftbagtop.png?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | 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 | </view> | 13 | </view> |
| 12 | </block> | 14 | </block> |
| 13 | 15 |
packageE/pages/user/monthgiftbag/monthgiftbag.js
| @@ -27,6 +27,8 @@ Page({ | @@ -27,6 +27,8 @@ Page({ | ||
| 27 | total: 0, //总数量 | 27 | total: 0, //总数量 |
| 28 | ad_data: null, | 28 | ad_data: null, |
| 29 | first_leader: e.globalData.first_leader || 0, // 推荐人ID | 29 | first_leader: e.globalData.first_leader || 0, // 推荐人ID |
| 30 | + | ||
| 31 | + sear_key:'' | ||
| 30 | }, | 32 | }, |
| 31 | onLoad: function (options) { | 33 | onLoad: function (options) { |
| 32 | this.setData({ | 34 | this.setData({ |
| @@ -98,19 +100,38 @@ Page({ | @@ -98,19 +100,38 @@ Page({ | ||
| 98 | 100 | ||
| 99 | 101 | ||
| 100 | }, | 102 | }, |
| 103 | + | ||
| 101 | getList: function () { | 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 | var th = this; | 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 | getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagRecord/page', { | 128 | getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagRecord/page', { |
| 105 | isShowLoading: true, | 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 | success: function (res) { | 131 | success: function (res) { |
| 132 | + | ||
| 133 | + th.data.searching=0; | ||
| 134 | + | ||
| 114 | if (res.data.code == 0) { | 135 | if (res.data.code == 0) { |
| 115 | 136 | ||
| 116 | var arr1 = th.data.wareCard; | 137 | var arr1 = th.data.wareCard; |
| @@ -156,6 +177,8 @@ Page({ | @@ -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,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 | \ No newline at end of file | 266 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/monthgiftbag.json
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "enablePullDownRefresh": false, | 3 | "enablePullDownRefresh": false, |
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "warn": "/components/long_warn/long_warn", | 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 | \ No newline at end of file | 10 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
| 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> | 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;"> |
| 2 | <block wx:if="{{ad_data}}"> | 2 | <block wx:if="{{ad_data}}"> |
| 3 | - <view class="top_img"> | 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> | 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 | </view> | 6 | </view> |
| 6 | </block> | 7 | </block> |
| 7 | <block wx:else> | 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 | </view> | 12 | </view> |
| 12 | </block> | 13 | </block> |
| 13 | 14 |
pages/giftpack/buygiftpack/giftpackbuy.js
| @@ -71,6 +71,8 @@ Page({ | @@ -71,6 +71,8 @@ Page({ | ||
| 71 | keyword:'', //门店搜索 | 71 | keyword:'', //门店搜索 |
| 72 | sec_i:-1,//选中分类门店 下标 | 72 | sec_i:-1,//选中分类门店 下标 |
| 73 | 73 | ||
| 74 | + sear_key:'' | ||
| 75 | + | ||
| 74 | }, | 76 | }, |
| 75 | onLoad: function (options) { | 77 | onLoad: function (options) { |
| 76 | var th=this; | 78 | var th=this; |
| @@ -431,17 +433,35 @@ Page({ | @@ -431,17 +433,35 @@ Page({ | ||
| 431 | }, | 433 | }, |
| 432 | 434 | ||
| 433 | getList: function (e) { | 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 | var th = this; | 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 | getApp().request.get('/api/weshop/marketing/giftbag/page', { | 458 | getApp().request.get('/api/weshop/marketing/giftbag/page', { |
| 436 | isShowLoading: true, | 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 | success: function (res) { | 461 | success: function (res) { |
| 462 | + | ||
| 463 | + th.data.searching=0; | ||
| 464 | + | ||
| 445 | if (res.data.code == 0) { | 465 | if (res.data.code == 0) { |
| 446 | th.data.curpage++; | 466 | th.data.curpage++; |
| 447 | var arr1 = th.data.wareCard; | 467 | var arr1 = th.data.wareCard; |
| @@ -460,6 +480,7 @@ Page({ | @@ -460,6 +480,7 @@ Page({ | ||
| 460 | is_read: 1, | 480 | is_read: 1, |
| 461 | is_get:1 | 481 | is_get:1 |
| 462 | }), wx.stopPullDownRefresh(); //停止下拉刷新 | 482 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
| 483 | + | ||
| 463 | } else { | 484 | } else { |
| 464 | th.setData({ | 485 | th.setData({ |
| 465 | is_read: 1, | 486 | is_read: 1, |
| @@ -467,6 +488,9 @@ Page({ | @@ -467,6 +488,9 @@ Page({ | ||
| 467 | is_get:1 | 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,5 +849,18 @@ Page({ | ||
| 825 | 849 | ||
| 826 | buy_libao:function () { | 850 | buy_libao:function () { |
| 827 | com.buy_libao(this) | 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 | \ No newline at end of file | 867 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.json
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | "navigationBarTitleText": "礼包列表", | 2 | "navigationBarTitleText": "礼包列表", |
| 3 | "usingComponents": { | 3 | "usingComponents": { |
| 4 | "warn": "/components/long_warn/long_warn", | 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 | \ No newline at end of file | 9 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.wxml
| 1 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
| 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> | 2 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> |
| 3 | <block wx:if="{{ad_data}}"> | 3 | <block wx:if="{{ad_data}}"> |
| 4 | - <view class="top_img"> | 4 | + <view class="top_img rel"> |
| 5 | <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> | 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 | </view> | 7 | </view> |
| 7 | </block> | 8 | </block> |
| 8 | <block wx:else> | 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 | </view> | 13 | </view> |
| 12 | </block> | 14 | </block> |
| 13 | 15 |
pages/giftpack/buygiftpack/giftpackbuy.wxss
| @@ -254,4 +254,4 @@ page { | @@ -254,4 +254,4 @@ page { | ||
| 254 | border-radius: 30rpx; | 254 | border-radius: 30rpx; |
| 255 | border: 2rpx solid rgb(238, 238, 238); | 255 | border: 2rpx solid rgb(238, 238, 238); |
| 256 | padding-left: 30rpx; | 256 | padding-left: 30rpx; |
| 257 | -} | ||
| 258 | \ No newline at end of file | 257 | \ No newline at end of file |
| 258 | +} |
pages/giftpack/mygiftpack/mygiftpack.js
| @@ -28,6 +28,8 @@ Page({ | @@ -28,6 +28,8 @@ Page({ | ||
| 28 | total: 0, //总数量 | 28 | total: 0, //总数量 |
| 29 | ad_data: null, | 29 | ad_data: null, |
| 30 | first_leader: e.globalData.first_leader || 0, // 推荐人ID | 30 | first_leader: e.globalData.first_leader || 0, // 推荐人ID |
| 31 | + | ||
| 32 | + sear_key:'' //顶部搜索关键子 | ||
| 31 | }, | 33 | }, |
| 32 | onLoad: function (options) { | 34 | onLoad: function (options) { |
| 33 | this.setData({ | 35 | this.setData({ |
| @@ -94,17 +96,34 @@ Page({ | @@ -94,17 +96,34 @@ Page({ | ||
| 94 | 96 | ||
| 95 | }, | 97 | }, |
| 96 | getList: function () { | 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 | var th = this; | 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 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | 120 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
| 100 | isShowLoading: true, | 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 | success: function (res) { | 123 | success: function (res) { |
| 124 | + | ||
| 125 | + th.data.searching=0; | ||
| 126 | + | ||
| 108 | if (res.data.code == 0) { | 127 | if (res.data.code == 0) { |
| 109 | th.data.curpage++; | 128 | th.data.curpage++; |
| 110 | var arr1 = th.data.wareCard; | 129 | var arr1 = th.data.wareCard; |
| @@ -155,6 +174,8 @@ Page({ | @@ -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,7 +224,7 @@ Page({ | ||
| 203 | 224 | ||
| 204 | //--- 分享设置 -- | 225 | //--- 分享设置 -- |
| 205 | onShareAppMessage: function (e) { | 226 | onShareAppMessage: function (e) { |
| 206 | - getApp().globalData.no_clear=1; | 227 | + getApp().globalData.no_clear=1; |
| 207 | var curPage = this; | 228 | var curPage = this; |
| 208 | var pagePath = curPage.route; //当前页面url | 229 | var pagePath = curPage.route; //当前页面url |
| 209 | if (pagePath.indexOf('/') != 0) { | 230 | if (pagePath.indexOf('/') != 0) { |
| @@ -216,14 +237,25 @@ Page({ | @@ -216,14 +237,25 @@ Page({ | ||
| 216 | } | 237 | } |
| 217 | }, | 238 | }, |
| 218 | 239 | ||
| 219 | - onShareTimeline() { | 240 | + onShareTimeline() { |
| 220 | getApp().globalData.no_clear=1; | 241 | getApp().globalData.no_clear=1; |
| 221 | return { | 242 | return { |
| 222 | title: '专享礼包', | 243 | title: '专享礼包', |
| 223 | imageUrl: this.data.ad_data.ad_code, | 244 | imageUrl: this.data.ad_data.ad_code, |
| 224 | query: "first_leader=" + this.data.getUserID | 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 | \ No newline at end of file | 262 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.json
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "enablePullDownRefresh": false, | 3 | "enablePullDownRefresh": false, |
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "warn": "/components/long_warn/long_warn", | 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 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.wxml
| 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> | 1 | <view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};min-height: 100vh;padding-bottom: 10rpx;"> |
| 2 | <block wx:if="{{ad_data}}"> | 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 | </view> | 6 | </view> |
| 6 | </block> | 7 | </block> |
| 7 | <block wx:else> | 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 | </view> | 12 | </view> |
| 12 | </block> | 13 | </block> |
| 13 | 14 |
pages/giftpack/mygiftpack/mygiftpack.wxss