diff --git a/components/lb_sear/lb_sear.js b/components/lb_sear/lb_sear.js new file mode 100644 index 0000000..7d3ac03 --- /dev/null +++ b/components/lb_sear/lb_sear.js @@ -0,0 +1,31 @@ +var t = getApp(), os = t.globalData.setting; +Component({ + properties: {}, + data: { + f_sear:0, + sear_key:'' + }, + + ready: function() {}, + methods: { + show_sear_inp(){ + this.setData({f_sear:1}); + }, + blur_sear(){ + if(!this.data.sear_key) + this.setData({f_sear:0}); + }, + + search_lb(){ + this.triggerEvent('search_lb'); + }, + + input_sear(e){ + let value = e.detail.value; + this.data.sear_key=value; + this.triggerEvent('input_sear',value); + } + + } + +}) \ No newline at end of file diff --git a/components/lb_sear/lb_sear.json b/components/lb_sear/lb_sear.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/lb_sear/lb_sear.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/lb_sear/lb_sear.wxml b/components/lb_sear/lb_sear.wxml new file mode 100644 index 0000000..5fdb94c --- /dev/null +++ b/components/lb_sear/lb_sear.wxml @@ -0,0 +1,4 @@ + + 搜索礼包 + + diff --git a/components/lb_sear/lb_sear.wxss b/components/lb_sear/lb_sear.wxss new file mode 100644 index 0000000..56fd335 --- /dev/null +++ b/components/lb_sear/lb_sear.wxss @@ -0,0 +1,4 @@ +@import '../../app.wxss'; +.t_search_box{ + border-radius:20rpx;bottom: 10rpx; width: 700rpx; left: 25rpx; height: 80rpx; background-color:rgba(255, 255, 255, 0.7); +} diff --git a/packageA/pages/myGift/myGift.js b/packageA/pages/myGift/myGift.js index 9ccc3f3..1ddfe8e 100644 --- a/packageA/pages/myGift/myGift.js +++ b/packageA/pages/myGift/myGift.js @@ -20,7 +20,8 @@ Page({ noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 pageNum: 1, // 当前页数 iurl: os.imghost, //图片前缀网址 - is_summit_ing:0 //是不是提交申请 + is_summit_ing:0, //是不是提交申请 + sear_key:'' //顶部搜索关键子 }, clickTab(e) { @@ -44,6 +45,10 @@ Page({ } else if(index == 1) { url = '/api/weshop/libao/libaoFormvip/page'; }; + + if(this.data.sear_key){ + data.key_str=this.data.sear_key; + } this.getData(true, url, data); @@ -161,7 +166,7 @@ Page({ if(index == 0) { url = '/api/weshop/libao/libaoForm/page'; - data.timetype=2; + data.timetype=1; } else if(index == 1) { url = '/api/weshop/libao/libaoFormvip/page'; }; @@ -205,6 +210,10 @@ Page({ user_id: app.globalData.user_id, } + if(this.data.sear_key){ + req_data.key_str=this.data.sear_key; + } + if(index == 0) { url = '/api/weshop/libao/libaoForm/page'; req_data.timetype=1; @@ -431,6 +440,38 @@ Page({ close_remark:function(){ this.setData({show_rem_pop:0,}) + }, + + search_lb(){ + + let index=this.data.currentIndex; + let url = ''; + let data = { + store_id: app.globalData.setting.stoid, + user_id: app.globalData.user_id, + }; + this.setData({ + list: null, + pageNum: 1, + noMore: false, + }); + + if(index == 0) { + url = '/api/weshop/libao/libaoForm/page'; + data.timetype=2; + } else if(index == 1) { + url = '/api/weshop/libao/libaoFormvip/page'; + }; + + if(this.data.sear_key){ + data.key_str=this.data.sear_key; + } + this.getData(true, url, data); + }, + + input_sear(e){ + let value = e.detail; + this.data.sear_key=value; } }) \ No newline at end of file diff --git a/packageA/pages/myGift/myGift.json b/packageA/pages/myGift/myGift.json index c52f0b2..79999dd 100644 --- a/packageA/pages/myGift/myGift.json +++ b/packageA/pages/myGift/myGift.json @@ -5,6 +5,7 @@ "warn": "/components/long_warn/long_warn", "nav_b": "/components/nav_b/nav_b", "my_confirm": "/components/my_confirm/my_confirm", - "nodata": "/components/nodata/nodata" + "nodata": "/components/nodata/nodata", + "lb_sear": "/components/lb_sear/lb_sear" } } \ No newline at end of file diff --git a/packageA/pages/myGift/myGift.wxml b/packageA/pages/myGift/myGift.wxml index 6d78e37..cf0656f 100644 --- a/packageA/pages/myGift/myGift.wxml +++ b/packageA/pages/myGift/myGift.wxml @@ -2,15 +2,16 @@ - + + - - + + diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js index 519ee16..e8442ad 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js @@ -439,10 +439,17 @@ Page({ }, getList: function (e) { + + if(this.data.ismore) return false; + if(this.data.searching) return false; + this.data.searching=1; + + wx.showLoading({ + title: '加载中.', + }) + var th = this; - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { - isShowLoading: true, - data: { + var r_q={ store_id: th.data.getStorageID, //商家ID user_id: th.data.getUserID, //用户ID page: th.data.curpage, @@ -450,8 +457,19 @@ Page({ is_end:0, timetype:1, is_act:0 - }, + } + + if(this.data.sear_key){ + r_q.key_str=this.data.sear_key; + } + + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { + isShowLoading: true, + data:r_q, success: function (res) { + + this.data.searching=0; + if (res.data.code == 0) { th.data.curpage++; var arr1 = th.data.wareCard; @@ -488,6 +506,9 @@ Page({ is_get:1 }) } + + wx.hideLoading(); + } }) @@ -852,5 +873,17 @@ Page({ buy_libao:function () { com.buy_libao(this) + }, + + search_lb(){ + this.data.curpage=0; + this.searching=0; + this.setData({ismore:0,is_get:0,wareCard:[]}); + this.getList(); + }, + + input_sear(e){ + let value = e.detail; + this.data.sear_key=value; } }) \ No newline at end of file diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json index 6acc1c4..2ea7afc 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.json @@ -2,6 +2,7 @@ "navigationBarTitleText": "礼包列表", "usingComponents": { "warn": "/components/long_warn/long_warn", - "my_confirm": "/components/my_confirm/my_confirm" + "my_confirm": "/components/my_confirm/my_confirm", + "lb_sear": "/components/lb_sear/lb_sear" } } \ No newline at end of file diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml index f3e7128..e4c76b6 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml @@ -1,13 +1,15 @@ - + + - + + diff --git a/packageE/pages/user/monthgiftbag/monthgiftbag.js b/packageE/pages/user/monthgiftbag/monthgiftbag.js index ce91e05..489a42c 100644 --- a/packageE/pages/user/monthgiftbag/monthgiftbag.js +++ b/packageE/pages/user/monthgiftbag/monthgiftbag.js @@ -27,6 +27,8 @@ Page({ total: 0, //总数量 ad_data: null, first_leader: e.globalData.first_leader || 0, // 推荐人ID + + sear_key:'' }, onLoad: function (options) { this.setData({ @@ -98,19 +100,38 @@ Page({ }, + getList: function () { + + if(this.data.ismore) return false; + if(this.data.searching) return false; + this.data.searching=1; + + wx.showLoading({ + title: '加载中.', + }) + var th = this; + let r_q={ + store_id: th.data.getStorageID, //商家ID + user_id: th.data.getUserID, //用户ID + page: th.data.curpage, + pageSize: th.data.pageSize, + pay_state:1 + }; + + if(this.data.sear_key){ + r_q.key_str=this.data.sear_key; + } + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagRecord/page', { isShowLoading: true, - data: { - store_id: th.data.getStorageID, //商家ID - user_id: th.data.getUserID, //用户ID - page: th.data.curpage, - pageSize: th.data.pageSize, - pay_state:1 - }, + data:r_q , success: function (res) { + + th.data.searching=0; + if (res.data.code == 0) { var arr1 = th.data.wareCard; @@ -156,6 +177,8 @@ Page({ }) } + wx.hideLoading(); + } }); @@ -226,5 +249,17 @@ Page({ } }, + search_lb(){ + this.data.curpage=0; + this.searching=0; + this.setData({ismore:0,is_get:0,wareCard:[]}); + this.getList(); + }, + + input_sear(e){ + let value = e.detail; + this.data.sear_key=value; + } + }); \ No newline at end of file diff --git a/packageE/pages/user/monthgiftbag/monthgiftbag.json b/packageE/pages/user/monthgiftbag/monthgiftbag.json index c5d51ee..80007bc 100644 --- a/packageE/pages/user/monthgiftbag/monthgiftbag.json +++ b/packageE/pages/user/monthgiftbag/monthgiftbag.json @@ -3,6 +3,7 @@ "enablePullDownRefresh": false, "usingComponents": { "warn": "/components/long_warn/long_warn", - "my_confirm": "/components/my_confirm/my_confirm" + "my_confirm": "/components/my_confirm/my_confirm", + "lb_sear": "/components/lb_sear/lb_sear" } } \ No newline at end of file diff --git a/packageE/pages/user/monthgiftbag/monthgiftbag.wxml b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml index ae95d7b..720fe7c 100644 --- a/packageE/pages/user/monthgiftbag/monthgiftbag.wxml +++ b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml @@ -1,13 +1,14 @@ - + + - - - + + + diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index c9cfaf6..0318e4a 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -71,6 +71,8 @@ Page({ keyword:'', //门店搜索 sec_i:-1,//选中分类门店 下标 + sear_key:'' + }, onLoad: function (options) { var th=this; @@ -431,17 +433,35 @@ Page({ }, getList: function (e) { + + if(this.data.ismore) return false; + if(this.data.searching) return false; + this.data.searching=1; + + wx.showLoading({ + title: '加载中.', + }) + var th = this; + let r_q={ + storeId: th.data.getStorageID, //商家ID + userId: th.data.getUserID, //用户ID + page: th.data.curpage, + pageSize: th.data.pageSize, + is_share:0 + }; + + if(this.data.sear_key){ + r_q.key_str=this.data.sear_key; + } + getApp().request.get('/api/weshop/marketing/giftbag/page', { isShowLoading: true, - data: { - storeId: th.data.getStorageID, //商家ID - userId: th.data.getUserID, //用户ID - page: th.data.curpage, - pageSize: th.data.pageSize, - is_share:0 - }, + data: r_q, success: function (res) { + + th.data.searching=0; + if (res.data.code == 0) { th.data.curpage++; var arr1 = th.data.wareCard; @@ -460,6 +480,7 @@ Page({ is_read: 1, is_get:1 }), wx.stopPullDownRefresh(); //停止下拉刷新 + } else { th.setData({ is_read: 1, @@ -467,6 +488,9 @@ Page({ is_get:1 }) } + + wx.hideLoading(); + } }) @@ -825,5 +849,18 @@ Page({ buy_libao:function () { com.buy_libao(this) + }, + + search_lb(){ + this.data.curpage=0; + this.searching=0; + this.setData({ismore:0,is_get:0,wareCard:[]}); + this.getList(); + }, + + input_sear(e){ + let value = e.detail; + this.data.sear_key=value; } + }) \ No newline at end of file diff --git a/pages/giftpack/buygiftpack/giftpackbuy.json b/pages/giftpack/buygiftpack/giftpackbuy.json index 6acc1c4..2ea7afc 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.json +++ b/pages/giftpack/buygiftpack/giftpackbuy.json @@ -2,6 +2,7 @@ "navigationBarTitleText": "礼包列表", "usingComponents": { "warn": "/components/long_warn/long_warn", - "my_confirm": "/components/my_confirm/my_confirm" + "my_confirm": "/components/my_confirm/my_confirm", + "lb_sear": "/components/lb_sear/lb_sear" } } \ No newline at end of file diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml index 0e45a25..db3772f 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxml +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml @@ -1,13 +1,15 @@ - + + - - + + + diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxss b/pages/giftpack/buygiftpack/giftpackbuy.wxss index 1102c60..7393c1c 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxss +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxss @@ -254,4 +254,4 @@ page { border-radius: 30rpx; border: 2rpx solid rgb(238, 238, 238); padding-left: 30rpx; -} \ No newline at end of file +} diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 01b0e44..4597bca 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -28,6 +28,8 @@ Page({ total: 0, //总数量 ad_data: null, first_leader: e.globalData.first_leader || 0, // 推荐人ID + + sear_key:'' //顶部搜索关键子 }, onLoad: function (options) { this.setData({ @@ -94,17 +96,34 @@ Page({ }, getList: function () { + + if(this.data.ismore) return false; + if(this.data.searching) return false; + this.data.searching=1; + + wx.showLoading({ + title: '加载中.', + }) + var th = this; + let r_q={ + storeId: th.data.getStorageID, //商家ID + userId: th.data.getUserID, //用户ID + page: th.data.curpage, + pageSize: th.data.pageSize + } + + if(this.data.sear_key){ + r_q.key_str=this.data.sear_key; + } getApp().request.get('/api/weshop/marketing/my/giftbag/page', { isShowLoading: true, - data: { - storeId: th.data.getStorageID, //商家ID - userId: th.data.getUserID, //用户ID - page: th.data.curpage, - pageSize: th.data.pageSize - }, + data: r_q, success: function (res) { + + th.data.searching=0; + if (res.data.code == 0) { th.data.curpage++; var arr1 = th.data.wareCard; @@ -155,6 +174,8 @@ Page({ }) } + wx.hideLoading(); + } }); @@ -203,7 +224,7 @@ Page({ //--- 分享设置 -- onShareAppMessage: function (e) { - getApp().globalData.no_clear=1; + getApp().globalData.no_clear=1; var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { @@ -216,14 +237,25 @@ Page({ } }, - onShareTimeline() { + onShareTimeline() { getApp().globalData.no_clear=1; return { title: '专享礼包', imageUrl: this.data.ad_data.ad_code, query: "first_leader=" + this.data.getUserID } - }, + }, + + search_lb(){ + this.data.curpage=0; + this.searching=0; + this.setData({ismore:0,is_get:0,wareCard:[]}); + this.getList(); + }, + input_sear(e){ + let value = e.detail; + this.data.sear_key=value; + } }); \ No newline at end of file diff --git a/pages/giftpack/mygiftpack/mygiftpack.json b/pages/giftpack/mygiftpack/mygiftpack.json index 1f07b7f..bd6784b 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.json +++ b/pages/giftpack/mygiftpack/mygiftpack.json @@ -3,6 +3,7 @@ "enablePullDownRefresh": false, "usingComponents": { "warn": "/components/long_warn/long_warn", - "my_confirm": "/components/my_confirm/my_confirm" + "my_confirm": "/components/my_confirm/my_confirm", + "lb_sear": "/components/lb_sear/lb_sear" } } \ No newline at end of file diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxml b/pages/giftpack/mygiftpack/mygiftpack.wxml index 55914d9..c4095d3 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxml +++ b/pages/giftpack/mygiftpack/mygiftpack.wxml @@ -1,13 +1,14 @@ - - + + + - - - + + + diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxss b/pages/giftpack/mygiftpack/mygiftpack.wxss index 518748d..74560e2 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxss +++ b/pages/giftpack/mygiftpack/mygiftpack.wxss @@ -261,7 +261,6 @@ button{ background-color: rgb(153,153,153) !important; } - button::after{ border: none; }