Commit 58e9d4a8660ee7e85fe880aa99919f1ec2a6d645
合并27
Showing
26 changed files
with
463 additions
and
122 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/cart/cart2/cart2.js
@@ -8254,13 +8254,13 @@ Page({ | @@ -8254,13 +8254,13 @@ Page({ | ||
8254 | buyed=zbuy.data.data.userbuynum; | 8254 | buyed=zbuy.data.data.userbuynum; |
8255 | } | 8255 | } |
8256 | if (zh['zh_num'] > 0 && zh['zh_buy_num'] + num0 > zh['zh_num']) { | 8256 | if (zh['zh_num'] > 0 && zh['zh_buy_num'] + num0 > zh['zh_num']) { |
8257 | - func({'code': -1, 'msg': '超出组合购活动总数量'}); | ||
8258 | - return false; | 8257 | + //func({'code': -1, 'msg': '超出组合购活动总数量'}); |
8258 | + //return false; | ||
8259 | } | 8259 | } |
8260 | 8260 | ||
8261 | if (zh && zh['buy_limit'] > 0 && num0+buyed > zh['buy_limit']) { | 8261 | if (zh && zh['buy_limit'] > 0 && num0+buyed > zh['buy_limit']) { |
8262 | - func({'code': -1, 'msg': '超出超出组合购活动的限购'}); | ||
8263 | - return false; | 8262 | + //func({'code': -1, 'msg': '超出超出组合购活动的限购'}); |
8263 | + //return false; | ||
8264 | } | 8264 | } |
8265 | 8265 | ||
8266 | } | 8266 | } |
@@ -8292,8 +8292,8 @@ Page({ | @@ -8292,8 +8292,8 @@ Page({ | ||
8292 | return e.goods_id == gid; | 8292 | return e.goods_id == gid; |
8293 | }) | 8293 | }) |
8294 | if (gdlist['buyqty'] > 0 && num1 + promgoodsbuynum > gdlist['buyqty']) { | 8294 | if (gdlist['buyqty'] > 0 && num1 + promgoodsbuynum > gdlist['buyqty']) { |
8295 | - func({'code': -1, 'msg': '超出组合购商品的限购'}); | ||
8296 | - return false; | 8295 | + //func({'code': -1, 'msg': '超出组合购商品的限购'}); |
8296 | + //return false; | ||
8297 | } | 8297 | } |
8298 | } | 8298 | } |
8299 | } | 8299 | } |
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/activity/pind_list/pind_list.js
@@ -187,6 +187,8 @@ Page({ | @@ -187,6 +187,8 @@ Page({ | ||
187 | 187 | ||
188 | wx.hideLoading(); | 188 | wx.hideLoading(); |
189 | if(th.data.b_plist){ | 189 | if(th.data.b_plist){ |
190 | + //让秒杀跳转后能下拉加载 | ||
191 | + th.data.ismore = 1; | ||
190 | //组件的id | 192 | //组件的id |
191 | var auto_go = th.selectComponent("#auto_go"); | 193 | var auto_go = th.selectComponent("#auto_go"); |
192 | auto_go.show(); | 194 | auto_go.show(); |
pages/activity/seckill_list/seckill_list.js
@@ -203,6 +203,8 @@ Page({ | @@ -203,6 +203,8 @@ Page({ | ||
203 | 203 | ||
204 | wx.hideLoading(); | 204 | wx.hideLoading(); |
205 | if(th.data.b_plist){ | 205 | if(th.data.b_plist){ |
206 | + //让秒杀跳转后能下拉加载 | ||
207 | + th.data.ismore = 1; | ||
206 | //组件的id | 208 | //组件的id |
207 | var auto_go = th.selectComponent("#auto_go"); | 209 | var auto_go = th.selectComponent("#auto_go"); |
208 | auto_go.show(); | 210 | auto_go.show(); |
pages/cart/cart/cart.js
@@ -3488,7 +3488,7 @@ Page({ | @@ -3488,7 +3488,7 @@ Page({ | ||
3488 | 3488 | ||
3489 | console.log('活动次数:' + userbuynum); | 3489 | console.log('活动次数:' + userbuynum); |
3490 | 3490 | ||
3491 | - if(userbuynum >= i_arr[j].act.zh_num && i_arr[j].act.zh_num>0){ | 3491 | + if(0 >= i_arr[j].act.zh_num-i_arr[j].act.zh_buy_num && i_arr[j].act.zh_num>0){ |
3492 | i_arr[j].out_all_num=1; | 3492 | i_arr[j].out_all_num=1; |
3493 | checkArr7.push(i_arr[j]) | 3493 | checkArr7.push(i_arr[j]) |
3494 | }else if (userbuynum >= i_arr[j].act.buy_limit && i_arr[j].act.buy_limit>0) { | 3494 | }else if (userbuynum >= i_arr[j].act.buy_limit && i_arr[j].act.buy_limit>0) { |
@@ -4034,11 +4034,13 @@ Page({ | @@ -4034,11 +4034,13 @@ Page({ | ||
4034 | prom_type: g_arr[i].prom_type, | 4034 | prom_type: g_arr[i].prom_type, |
4035 | prom_id: g_arr[i].prom_id, | 4035 | prom_id: g_arr[i].prom_id, |
4036 | }; | 4036 | }; |
4037 | - let gitem = checkArr7.find(item => item.goods_id == g_arr[i].goods_id) | ||
4038 | - if (gitem) { | ||
4039 | - data.prom_type = 0 | ||
4040 | - data.prom_id = 0 | ||
4041 | - } | 4037 | + |
4038 | + // let gitem = checkArr7.find(item => item.goods_id == g_arr[i].goods_id) | ||
4039 | + // if (gitem) { | ||
4040 | + // data.prom_type = 0 | ||
4041 | + // data.prom_id = 0 | ||
4042 | + // } | ||
4043 | + | ||
4042 | //-- 如果有线下取价的时候 -- | 4044 | //-- 如果有线下取价的时候 -- |
4043 | if (g_arr[i].is_offline) { | 4045 | if (g_arr[i].is_offline) { |
4044 | data.pricing_type = g_arr[i].pricing_type; | 4046 | data.pricing_type = g_arr[i].pricing_type; |
@@ -5065,6 +5067,7 @@ Page({ | @@ -5065,6 +5067,7 @@ Page({ | ||
5065 | else cx_prom_group[dx].sele = 1; | 5067 | else cx_prom_group[dx].sele = 1; |
5066 | } | 5068 | } |
5067 | 5069 | ||
5070 | + let the_rs={code:0}; | ||
5068 | // -- 判断 -- | 5071 | // -- 判断 -- |
5069 | this.cx_check_ok2(async function (the_rs) { | 5072 | this.cx_check_ok2(async function (the_rs) { |
5070 | if (the_rs.code == 0) { | 5073 | if (the_rs.code == 0) { |
@@ -5204,11 +5207,11 @@ Page({ | @@ -5204,11 +5207,11 @@ Page({ | ||
5204 | buyed = zbuy.data.data.userbuynum; | 5207 | buyed = zbuy.data.data.userbuynum; |
5205 | } | 5208 | } |
5206 | if (zh['zh_num'] > 0 && zh['zh_buy_num'] + num0 > zh['zh_num']) { | 5209 | if (zh['zh_num'] > 0 && zh['zh_buy_num'] + num0 > zh['zh_num']) { |
5207 | - func({ | ||
5208 | - 'code': -1, | ||
5209 | - 'msg': '超出组合购活动总数量' | ||
5210 | - }); | ||
5211 | - return false; | 5210 | + // func({ |
5211 | + // 'code': -1, | ||
5212 | + // 'msg': '超出组合购活动总数量' | ||
5213 | + // }); | ||
5214 | + // return false; | ||
5212 | } | 5215 | } |
5213 | } | 5216 | } |
5214 | } | 5217 | } |
@@ -5244,11 +5247,11 @@ Page({ | @@ -5244,11 +5247,11 @@ Page({ | ||
5244 | return e.goods_id == gid; | 5247 | return e.goods_id == gid; |
5245 | }) | 5248 | }) |
5246 | if (gdlist['buyqty'] > 0 && num1 + promgoodsbuynum > gdlist['buyqty']) { | 5249 | if (gdlist['buyqty'] > 0 && num1 + promgoodsbuynum > gdlist['buyqty']) { |
5247 | - func({ | ||
5248 | - 'code': -1, | ||
5249 | - 'msg': '超出组合购商品的限购' | ||
5250 | - }); | ||
5251 | - return false; | 5250 | + // func({ |
5251 | + // 'code': -1, | ||
5252 | + // 'msg': '超出组合购商品的限购' | ||
5253 | + // }); | ||
5254 | + // return false; | ||
5252 | } | 5255 | } |
5253 | } | 5256 | } |
5254 | } | 5257 | } |
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
pages/goods/goodsInfo/goodsInfo.js
@@ -1598,7 +1598,7 @@ Page({ | @@ -1598,7 +1598,7 @@ Page({ | ||
1598 | 1598 | ||
1599 | }) | 1599 | }) |
1600 | }, | 1600 | }, |
1601 | - async getUserBuyPromNum(prom_id) { | 1601 | + async getUserBuyPromNum(prom_id,is_zh) { |
1602 | var userInfo = getApp().globalData.userInfo; | 1602 | var userInfo = getApp().globalData.userInfo; |
1603 | var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`; | 1603 | var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`; |
1604 | let res = await getApp().request.promiseGet(url, { | 1604 | let res = await getApp().request.promiseGet(url, { |
@@ -1611,6 +1611,7 @@ Page({ | @@ -1611,6 +1611,7 @@ Page({ | ||
1611 | this.setData({ | 1611 | this.setData({ |
1612 | userbuynum | 1612 | userbuynum |
1613 | }) | 1613 | }) |
1614 | + if(is_zh) this.data.user_zh_buy_num=userbuynum; | ||
1614 | // return userbuynum | 1615 | // return userbuynum |
1615 | }, | 1616 | }, |
1616 | 1617 | ||
@@ -2183,6 +2184,7 @@ Page({ | @@ -2183,6 +2184,7 @@ Page({ | ||
2183 | newd['pick_name'] = th.data.sto_sele_name; | 2184 | newd['pick_name'] = th.data.sto_sele_name; |
2184 | newd['pick_dis'] = th.data.sto_sele_distr; | 2185 | newd['pick_dis'] = th.data.sto_sele_distr; |
2185 | th.buyNow(newd); | 2186 | th.buyNow(newd); |
2187 | + | ||
2186 | } | 2188 | } |
2187 | }, | 2189 | }, |
2188 | 2190 | ||
@@ -2249,46 +2251,82 @@ Page({ | @@ -2249,46 +2251,82 @@ Page({ | ||
2249 | s.set_b_now(e); | 2251 | s.set_b_now(e); |
2250 | getApp().goto("/packageE/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id) | 2252 | getApp().goto("/packageE/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id) |
2251 | } else { | 2253 | } else { |
2252 | - | ||
2253 | - //----其他就按照公众号的购物车立即购买形式来修改,先看会员在购物车中是否加入了该商品,立即购买的----- | ||
2254 | - getApp().request.get("/api/weshop/cart/page", { | ||
2255 | - data: { | ||
2256 | - store_id: os.stoid, | ||
2257 | - user_id: oo.user_id, | ||
2258 | - state: 1 | ||
2259 | - }, | ||
2260 | - success: function (res) { | ||
2261 | - //-------如果购物车中有相关的数据--------- | ||
2262 | - if (res.data.code == 0 && res.data.data.total > 0) { | ||
2263 | - for (let j in res.data.data.pageData) { | ||
2264 | - let item_j = res.data.data.pageData[j]; | ||
2265 | - var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; | ||
2266 | - getApp().request.delete(url, {}); | ||
2267 | - } | 2254 | + //-- 如果是第一顺序是组合购的时候 -- |
2255 | + if(th.data.cx_prom_group && th.data.cx_prom_group.length && th.data.cx_prom_group[0].prom_type==7){ | ||
2256 | + if(!th.data.is_has_zh_num){ | ||
2257 | + th.data.adding=0; | ||
2258 | + wx.hideLoading(); | ||
2259 | + wx.showModal({ | ||
2260 | + title: '提示', | ||
2261 | + content: '超出组合购总数,将以普通商品购买', | ||
2262 | + success (res) { | ||
2263 | + if (res.confirm) { | ||
2264 | + th.cart_next_next(e); | ||
2265 | + } | ||
2266 | + } | ||
2267 | + }) | ||
2268 | + }else if(th.data.user_zh_buy_num>=th.data.zh_act.buy_limit && th.data.zh_act.buy_limit>0){ | ||
2269 | + th.data.adding=0; | ||
2270 | + wx.hideLoading(); | ||
2271 | + wx.showModal({ | ||
2272 | + title: '提示', | ||
2273 | + content: '超出组合购限购次数,将以普通商品购买', | ||
2274 | + success (res) { | ||
2275 | + if (res.confirm) { | ||
2276 | + th.cart_next_next(e); | ||
2277 | + } | ||
2278 | + } | ||
2279 | + }) | ||
2280 | + }else{ | ||
2281 | + th.cart_next_next(e); | ||
2268 | } | 2282 | } |
2283 | + } | ||
2284 | + else{ | ||
2285 | + th.cart_next_next(e); | ||
2286 | + } | ||
2287 | + } | ||
2269 | 2288 | ||
2270 | - //-- 推迟一下,因为删除没有那么快 -- | ||
2271 | - setTimeout(() => { | ||
2272 | - e.state = 1; | ||
2273 | - e.prom_type = 0; | ||
2274 | - e.prom_id = 0 | ||
2275 | - getApp().request.post("/api/weshop/cart/save", { | ||
2276 | - data: e, | ||
2277 | - success: function (t) { | ||
2278 | - th.closeSpecModal(); | ||
2279 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | ||
2280 | - } | ||
2281 | - }); | ||
2282 | - }, 500) | ||
2283 | 2289 | ||
2284 | - } | ||
2285 | - }) | ||
2286 | - } | 2290 | + } |
2291 | + }, | ||
2292 | + | ||
2287 | 2293 | ||
2288 | 2294 | ||
2295 | + cart_next_next(e){ | ||
2296 | + var th=this; | ||
2297 | + //----其他就按照公众号的购物车立即购买形式来修改,先看会员在购物车中是否加入了该商品,立即购买的----- | ||
2298 | + getApp().request.get("/api/weshop/cart/page", { | ||
2299 | + data: { | ||
2300 | + store_id: os.stoid, | ||
2301 | + user_id: oo.user_id, | ||
2302 | + state: 1 | ||
2303 | + }, | ||
2304 | + success: function (res) { | ||
2305 | + //-------如果购物车中有相关的数据--------- | ||
2306 | + if (res.data.code == 0 && res.data.data.total > 0) { | ||
2307 | + for (let j in res.data.data.pageData) { | ||
2308 | + let item_j = res.data.data.pageData[j]; | ||
2309 | + var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; | ||
2310 | + getApp().request.delete(url, {}); | ||
2311 | + } | ||
2312 | + } | ||
2289 | 2313 | ||
2314 | + //-- 推迟一下,因为删除没有那么快 -- | ||
2315 | + setTimeout(() => { | ||
2316 | + e.state = 1; | ||
2317 | + e.prom_type = 0; | ||
2318 | + e.prom_id = 0 | ||
2319 | + getApp().request.post("/api/weshop/cart/save", { | ||
2320 | + data: e, | ||
2321 | + success: function (t) { | ||
2322 | + th.closeSpecModal(); | ||
2323 | + getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | ||
2324 | + } | ||
2325 | + }); | ||
2326 | + }, 500) | ||
2290 | 2327 | ||
2291 | - } | 2328 | + } |
2329 | + }) | ||
2292 | }, | 2330 | }, |
2293 | 2331 | ||
2294 | //----------增加购买数量----------- | 2332 | //----------增加购买数量----------- |
@@ -3401,7 +3439,7 @@ Page({ | @@ -3401,7 +3439,7 @@ Page({ | ||
3401 | } | 3439 | } |
3402 | else that.get_sto(null,()=>{ | 3440 | else that.get_sto(null,()=>{ |
3403 | that.sele_spec_next(that,item,gid,nor); | 3441 | that.sele_spec_next(that,item,gid,nor); |
3404 | - }); | 3442 | + },item); |
3405 | 3443 | ||
3406 | }, | 3444 | }, |
3407 | 3445 | ||
@@ -3436,7 +3474,11 @@ Page({ | @@ -3436,7 +3474,11 @@ Page({ | ||
3436 | var req_d = { | 3474 | var req_d = { |
3437 | "store_id": os.stoid, | 3475 | "store_id": os.stoid, |
3438 | "goods_id": that.data.gid, | 3476 | "goods_id": that.data.gid, |
3477 | +<<<<<<< HEAD | ||
3439 | "user_id": getApp().globalData.user_id, | 3478 | "user_id": getApp().globalData.user_id, |
3479 | +======= | ||
3480 | + "user_id": getApp().globalData.user_id | ||
3481 | +>>>>>>> dev_oa_fu27 | ||
3440 | } | 3482 | } |
3441 | getApp().request.get(url, { | 3483 | getApp().request.get(url, { |
3442 | data: req_d, | 3484 | data: req_d, |
@@ -3633,7 +3675,7 @@ Page({ | @@ -3633,7 +3675,7 @@ Page({ | ||
3633 | 3675 | ||
3634 | 3676 | ||
3635 | //---------拿出门店分类和门店------------ | 3677 | //---------拿出门店分类和门店------------ |
3636 | - get_sto(e,func) { | 3678 | + get_sto(e,func,item) { |
3637 | console.log('get_sto') | 3679 | console.log('get_sto') |
3638 | var th = this, | 3680 | var th = this, |
3639 | that = this; | 3681 | that = this; |
@@ -3706,9 +3748,15 @@ Page({ | @@ -3706,9 +3748,15 @@ Page({ | ||
3706 | if(!is_normal && py>0 && [3,5,7,10].indexOf(py)<0 ){ | 3748 | if(!is_normal && py>0 && [3,5,7,10].indexOf(py)<0 ){ |
3707 | pickup_ids=null; | 3749 | pickup_ids=null; |
3708 | } | 3750 | } |
3751 | + //-- 把秒杀的指定对象带入 -- | ||
3752 | + if(item){ | ||
3753 | + if(item.is_pickup && item.pick_up_lists){ | ||
3754 | + pickup_ids=item.pick_up_lists | ||
3755 | + }else{ | ||
3756 | + pickup_ids=null; | ||
3757 | + } | ||
3709 | 3758 | ||
3710 | - //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 | ||
3711 | - if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ | 3759 | + }else if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 |
3712 | pickup_ids=th.data.prom_act.pick_up_lists | 3760 | pickup_ids=th.data.prom_act.pick_up_lists |
3713 | } | 3761 | } |
3714 | 3762 | ||
@@ -3829,18 +3877,26 @@ Page({ | @@ -3829,18 +3877,26 @@ Page({ | ||
3829 | } | 3877 | } |
3830 | if(func) func(); | 3878 | if(func) func(); |
3831 | }else{ | 3879 | }else{ |
3880 | + | ||
3881 | + if(func) func(); | ||
3882 | + th.setData({sp_seleing:0}) | ||
3832 | wx.hideLoading(); | 3883 | wx.hideLoading(); |
3833 | } | 3884 | } |
3834 | } else { | 3885 | } else { |
3886 | + if(func) func(); | ||
3887 | + th.setData({sp_seleing:0}) | ||
3835 | wx.hideLoading(); | 3888 | wx.hideLoading(); |
3836 | } | 3889 | } |
3837 | },err=>{ | 3890 | },err=>{ |
3838 | ut.m_toast('网络繁忙,请稍后重试'); | 3891 | ut.m_toast('网络繁忙,请稍后重试'); |
3892 | + if(func) func(); | ||
3893 | + th.setData({sp_seleing:0}) | ||
3839 | wx.hideLoading(); | 3894 | wx.hideLoading(); |
3840 | }) | 3895 | }) |
3841 | }, 200) | 3896 | }, 200) |
3842 | 3897 | ||
3843 | }, | 3898 | }, |
3899 | + | ||
3844 | //获取搜索门店输入的值 | 3900 | //获取搜索门店输入的值 |
3845 | input_store: function (e) { | 3901 | input_store: function (e) { |
3846 | this.setData({ | 3902 | this.setData({ |
@@ -3951,7 +4007,32 @@ Page({ | @@ -3951,7 +4007,32 @@ Page({ | ||
3951 | } | 4007 | } |
3952 | 4008 | ||
3953 | var g_distr_type = th.data.sele_g.distr_type; | 4009 | var g_distr_type = th.data.sele_g.distr_type; |
3954 | - wx.hideLoading(); | 4010 | + wx.hideLoading() |
4011 | + | ||
4012 | + | ||
4013 | + /*--- 判断初始的用户的默认门店要不要弄进去 ---*/ | ||
4014 | + var fid=-1; | ||
4015 | + if(th.data.fir_def_store){ | ||
4016 | + var fid=e.data.data.pageData.findIndex((e)=>{ | ||
4017 | + return e.pickup_id==th.data.fir_def_store.pickup_id; | ||
4018 | + }) | ||
4019 | + } | ||
4020 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | ||
4021 | + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid<0 && | ||
4022 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | ||
4023 | + th.data.fir_def_store.CanOutQty = 0; | ||
4024 | + //--当选择的门店是客户默认的门店的时候-- | ||
4025 | + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { | ||
4026 | + th.setData({ | ||
4027 | + def_pick_store: th.data.fir_def_store | ||
4028 | + }); | ||
4029 | + e.data.data.pageData.unshift(th.data.def_pick_store); | ||
4030 | + } else { | ||
4031 | + e.data.data.pageData.splice(1, 0, th.data.fir_def_store); | ||
4032 | + } | ||
4033 | + } | ||
4034 | + | ||
4035 | + | ||
3955 | 4036 | ||
3956 | //单总量超出10个的时候,同时门店有分类 | 4037 | //单总量超出10个的时候,同时门店有分类 |
3957 | if (e.data.data.total > 10 && e.his_cate_num) { | 4038 | if (e.data.data.total > 10 && e.his_cate_num) { |
@@ -4302,6 +4383,8 @@ Page({ | @@ -4302,6 +4383,8 @@ Page({ | ||
4302 | 4383 | ||
4303 | } | 4384 | } |
4304 | 4385 | ||
4386 | + | ||
4387 | + | ||
4305 | //数据组装下 | 4388 | //数据组装下 |
4306 | var em = {}; | 4389 | var em = {}; |
4307 | em.data = {}; | 4390 | em.data = {}; |
@@ -4311,8 +4394,14 @@ Page({ | @@ -4311,8 +4394,14 @@ Page({ | ||
4311 | em.his_cate_num=e.his_cate_num; | 4394 | em.his_cate_num=e.his_cate_num; |
4312 | 4395 | ||
4313 | 4396 | ||
4397 | + var fid=-1; | ||
4398 | + if(th.data.fir_def_store){ | ||
4399 | + var fid=em.data.data.pageData.findIndex((e)=>{ | ||
4400 | + return e.pickup_id==th.data.fir_def_store.pickup_id; | ||
4401 | + }) | ||
4402 | + } | ||
4314 | //--如果找到默认门店,同时也应该判断配送方式对不对-- | 4403 | //--如果找到默认门店,同时也应该判断配送方式对不对-- |
4315 | - if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && | 4404 | + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid<0 && |
4316 | (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | 4405 | (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { |
4317 | th.data.fir_def_store.CanOutQty = 0; | 4406 | th.data.fir_def_store.CanOutQty = 0; |
4318 | //--当选择的门店是客户默认的门店的时候-- | 4407 | //--当选择的门店是客户默认的门店的时候-- |
@@ -4336,6 +4425,7 @@ Page({ | @@ -4336,6 +4425,7 @@ Page({ | ||
4336 | th.deal_pickup(em); | 4425 | th.deal_pickup(em); |
4337 | 4426 | ||
4338 | } else { | 4427 | } else { |
4428 | + | ||
4339 | th.setData({ | 4429 | th.setData({ |
4340 | all_sto: null, | 4430 | all_sto: null, |
4341 | only_pk: null, | 4431 | only_pk: null, |
@@ -4344,6 +4434,7 @@ Page({ | @@ -4344,6 +4434,7 @@ Page({ | ||
4344 | } | 4434 | } |
4345 | 4435 | ||
4346 | } else { | 4436 | } else { |
4437 | + | ||
4347 | th.setData({ | 4438 | th.setData({ |
4348 | all_sto: null, | 4439 | all_sto: null, |
4349 | only_pk: null, | 4440 | only_pk: null, |
@@ -7267,6 +7358,7 @@ Page({ | @@ -7267,6 +7358,7 @@ Page({ | ||
7267 | }) | 7358 | }) |
7268 | } | 7359 | } |
7269 | }, | 7360 | }, |
7361 | + | ||
7270 | //关闭选择门店 | 7362 | //关闭选择门店 |
7271 | close_popup: function (e) { | 7363 | close_popup: function (e) { |
7272 | var th = this; | 7364 | var th = this; |
@@ -7472,12 +7564,22 @@ Page({ | @@ -7472,12 +7564,22 @@ Page({ | ||
7472 | 7564 | ||
7473 | if (!item) return false; | 7565 | if (!item) return false; |
7474 | 7566 | ||
7567 | + if (item.is_no_dis_nor || (item.is_no_dis_act && !th.data.is_normal)){ | ||
7568 | + wx.showToast({ | ||
7569 | + title: "该门店不可售,请选择其他门店", | ||
7570 | + icon: 'none', | ||
7571 | + duration: 2000 | ||
7572 | + }); | ||
7573 | + return false; | ||
7574 | + } | ||
7575 | + | ||
7576 | + | ||
7475 | if (!th.data.sele_g) return false; | 7577 | if (!th.data.sele_g) return false; |
7476 | //判断门店的配送方式是不是匹配 | 7578 | //判断门店的配送方式是不是匹配 |
7477 | var g_distr_type = th.data.sele_g.distr_type; | 7579 | var g_distr_type = th.data.sele_g.distr_type; |
7478 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | 7580 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { |
7479 | wx.showToast({ | 7581 | wx.showToast({ |
7480 | - title: "门店配送方式不匹配", | 7582 | + title: "门店配送方式不匹配,请选择其他门店", |
7481 | icon: 'none', | 7583 | icon: 'none', |
7482 | duration: 2000 | 7584 | duration: 2000 |
7483 | }); | 7585 | }); |
@@ -8485,14 +8587,13 @@ Page({ | @@ -8485,14 +8587,13 @@ Page({ | ||
8485 | let item = f_more[i]; | 8587 | let item = f_more[i]; |
8486 | f_more[i].prom_id = item.act_id; | 8588 | f_more[i].prom_id = item.act_id; |
8487 | f_more[i].prom_type = 1; | 8589 | f_more[i].prom_type = 1; |
8488 | - if (item.goods_id == this.data.data.goods_id) { | ||
8489 | - continue; | ||
8490 | - } | 8590 | + |
8491 | var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; | 8591 | var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; |
8492 | await getApp().request.promiseGet(url, {}).then(rs => { | 8592 | await getApp().request.promiseGet(url, {}).then(rs => { |
8493 | if (rs.data.code == 0 && rs.data.data) { | 8593 | if (rs.data.code == 0 && rs.data.data) { |
8494 | f_more[i].price = rs.data.data.user_price; | 8594 | f_more[i].price = rs.data.data.user_price; |
8495 | - | 8595 | + f_more[i].is_pickup = rs.data.data.is_pickup; |
8596 | + f_more[i].pick_up_lists = rs.data.data.pick_up_lists; | ||
8496 | } | 8597 | } |
8497 | }) | 8598 | }) |
8498 | } | 8599 | } |
@@ -8724,12 +8825,13 @@ Page({ | @@ -8724,12 +8825,13 @@ Page({ | ||
8724 | 8825 | ||
8725 | //判断组合购总数够不够 | 8826 | //判断组合购总数够不够 |
8726 | var is_has_zh_num = (!e.data.data.zh_num || e.data.data.zh_buy_num < e.data.data.zh_num); | 8827 | var is_has_zh_num = (!e.data.data.zh_num || e.data.data.zh_buy_num < e.data.data.zh_num); |
8727 | - if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time && is_has_zh_num) { | 8828 | + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time ) { |
8728 | //-- 获取商品列表 -- | 8829 | //-- 获取商品列表 -- |
8729 | th.setData({ | 8830 | th.setData({ |
8730 | zh_act: e.data.data | 8831 | zh_act: e.data.data |
8731 | }); | 8832 | }); |
8732 | - th.getUserBuyPromNum(e.data.data.id) | 8833 | + th.data.is_has_zh_num= is_has_zh_num; |
8834 | + th.getUserBuyPromNum(e.data.data.id,1) | ||
8733 | } | 8835 | } |
8734 | } | 8836 | } |
8735 | 8837 |