Commit 205555cfe83ba9662d2a5024dd64fb6c6c44eafe
1 parent
021c9e8b
礼包门店搜索
Showing
13 changed files
with
446 additions
and
7 deletions
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
@@ -67,6 +67,8 @@ Page({ | @@ -67,6 +67,8 @@ Page({ | ||
67 | openSpecModal:0, | 67 | openSpecModal:0, |
68 | 68 | ||
69 | is_get_guide:0, | 69 | is_get_guide:0, |
70 | + keyword:'', //门店搜索 | ||
71 | + sec_i:-1,//选中分类门店 下标 | ||
70 | 72 | ||
71 | }, | 73 | }, |
72 | onLoad: function (options) { | 74 | onLoad: function (options) { |
@@ -180,7 +182,93 @@ Page({ | @@ -180,7 +182,93 @@ Page({ | ||
180 | }) | 182 | }) |
181 | },1000) | 183 | },1000) |
182 | }, | 184 | }, |
185 | + //获取搜索门店输入的值 | ||
186 | + input_store: function(e) { | ||
187 | + this.setData({ | ||
188 | + keyword: e.detail.value | ||
189 | + }) | ||
190 | + }, | ||
191 | + //搜索门店 | ||
192 | + searchfn(){ | ||
193 | + let choice_sort_store = this.data.choice_sort_store | ||
194 | + if (choice_sort_store==0) { //全局搜索 | ||
195 | + let all_pick_list = this.data.all_pick_list | ||
196 | + let def_pickpu_list = this.data.def_pickpu_list | ||
197 | + let keyword = this.data.keyword | ||
198 | + if (keyword) { | ||
199 | + let arr=all_pick_list.filter( item =>{ | ||
200 | + let i = item.pickup_name.indexOf(keyword) | ||
201 | + if (i > -1) { | ||
202 | + return true | ||
203 | + }else{ | ||
204 | + return false | ||
205 | + } | ||
206 | + }) | ||
207 | + if (arr && arr.length>0) { | ||
208 | + if(this.data.is_show_sto_cat==1){ | ||
209 | + this.setData({ | ||
210 | + def_pickpu_list:arr | ||
211 | + }) | ||
212 | + }else{ | ||
213 | + this.setData({ | ||
214 | + only_pk:arr | ||
215 | + }) | ||
216 | + } | ||
217 | + }else{ | ||
218 | + wx.showToast({ | ||
219 | + title: '没有搜索到门店', | ||
220 | + icon: 'none', | ||
221 | + duration: 2000 | ||
222 | + }) | ||
223 | + } | ||
224 | + }else{ | ||
225 | + if (this.data.is_show_sto_cat==1) { | ||
226 | + this.setData({ | ||
227 | + def_pickpu_list:all_pick_list.slice(0,10) | ||
228 | + }) | ||
229 | + }else{ | ||
230 | + this.setData({ | ||
231 | + only_pk:all_pick_list | ||
232 | + }) | ||
233 | + } | ||
183 | 234 | ||
235 | + } | ||
236 | + }else{ //分类下搜索 | ||
237 | + let sec_i=this.data.sec_i | ||
238 | + let all_sto = this.data.all_sto | ||
239 | + let sec_sto= this.data.sec_sto | ||
240 | + let sec_arr = sec_sto.s_arr | ||
241 | + let keyword = this.data.keyword | ||
242 | + let text='sec_sto.s_arr' | ||
243 | + if (keyword) { | ||
244 | + let arr=sec_arr.filter( item =>{ | ||
245 | + let i = item.pickup_name.indexOf(keyword) | ||
246 | + if (i > -1) { | ||
247 | + return true | ||
248 | + }else{ | ||
249 | + return false | ||
250 | + } | ||
251 | + }) | ||
252 | + if (arr && arr.length>0) { | ||
253 | + this.setData({ | ||
254 | + [text]:arr | ||
255 | + }) | ||
256 | + }else{ | ||
257 | + wx.showToast({ | ||
258 | + title: '没有搜索到门店', | ||
259 | + icon: 'none', | ||
260 | + duration: 2000 | ||
261 | + }) | ||
262 | + } | ||
263 | + }else{ | ||
264 | + this.setData({ | ||
265 | + [text]:all_sto[sec_i].s_arr | ||
266 | + }) | ||
267 | + } | ||
268 | + | ||
269 | + | ||
270 | + } | ||
271 | + }, | ||
184 | //购买礼包 | 272 | //购买礼包 |
185 | GetBuyPrice: function (e) { | 273 | GetBuyPrice: function (e) { |
186 | 274 | ||
@@ -579,6 +667,7 @@ Page({ | @@ -579,6 +667,7 @@ Page({ | ||
579 | region_name: region_name, | 667 | region_name: region_name, |
580 | sort_store: 0, | 668 | sort_store: 0, |
581 | choice_sort_store: 1, | 669 | choice_sort_store: 1, |
670 | + sec_i:index, | ||
582 | sec_sto: item, | 671 | sec_sto: item, |
583 | sec_pick_index: 0 | 672 | sec_pick_index: 0 |
584 | }); | 673 | }); |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml
1 | +<wxs module="filter" src="../../../../../utils/filter.wxs"></wxs> | ||
1 | <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;"> |
2 | <block wx:if="{{ad_data}}"> | 3 | <block wx:if="{{ad_data}}"> |
3 | <view class="top_img"> | 4 | <view class="top_img"> |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss
@@ -230,4 +230,27 @@ page { | @@ -230,4 +230,27 @@ page { | ||
230 | 230 | ||
231 | .After_all .end { | 231 | .After_all .end { |
232 | margin: 0rpx 15rpx; | 232 | margin: 0rpx 15rpx; |
233 | +} | ||
234 | +.searchbar { | ||
235 | + height: 95rpx; | ||
236 | + border-bottom: 2rpx solid rgb(238, 238, 238); | ||
237 | +} | ||
238 | +.storeListpadd { | ||
239 | + padding: 0rpx 31rpx; | ||
240 | +} | ||
241 | +.search { | ||
242 | + width: 125rpx; | ||
243 | + height: 45rpx; | ||
244 | + line-height: 45rpx; | ||
245 | + background-color: rgb(219, 27, 52); | ||
246 | + border-radius: 30rpx; | ||
247 | + color: rgb(255, 255, 255); | ||
248 | +} | ||
249 | +.inputstore { | ||
250 | + width: 510rpx; | ||
251 | + height: 43rpx; | ||
252 | + line-height: 43rpx; | ||
253 | + border-radius: 30rpx; | ||
254 | + border: 2rpx solid rgb(238, 238, 238); | ||
255 | + padding-left: 30rpx; | ||
233 | } | 256 | } |
234 | \ No newline at end of file | 257 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -79,6 +79,8 @@ Page({ | @@ -79,6 +79,8 @@ Page({ | ||
79 | screenWidth: 0, | 79 | screenWidth: 0, |
80 | monthgiftbag:{}, | 80 | monthgiftbag:{}, |
81 | scene:"", | 81 | scene:"", |
82 | + keyword:'', //门店搜索 | ||
83 | + sec_i:-1,//选中分类门店 下标 | ||
82 | }, | 84 | }, |
83 | onLoad: function (options) { | 85 | onLoad: function (options) { |
84 | 86 | ||
@@ -958,7 +960,93 @@ Page({ | @@ -958,7 +960,93 @@ Page({ | ||
958 | 960 | ||
959 | 961 | ||
960 | }, | 962 | }, |
963 | + //获取搜索门店输入的值 | ||
964 | + input_store: function(e) { | ||
965 | + this.setData({ | ||
966 | + keyword: e.detail.value | ||
967 | + }) | ||
968 | + }, | ||
969 | + //搜索门店 | ||
970 | + searchfn(){ | ||
971 | + let choice_sort_store = this.data.choice_sort_store | ||
972 | + if (choice_sort_store==0) { //全局搜索 | ||
973 | + let all_pick_list = this.data.all_pick_list | ||
974 | + let def_pickpu_list = this.data.def_pickpu_list | ||
975 | + let keyword = this.data.keyword | ||
976 | + if (keyword) { | ||
977 | + let arr=all_pick_list.filter( item =>{ | ||
978 | + let i = item.pickup_name.indexOf(keyword) | ||
979 | + if (i > -1) { | ||
980 | + return true | ||
981 | + }else{ | ||
982 | + return false | ||
983 | + } | ||
984 | + }) | ||
985 | + if (arr && arr.length>0) { | ||
986 | + if(this.data.is_show_sto_cat==1){ | ||
987 | + this.setData({ | ||
988 | + def_pickpu_list:arr | ||
989 | + }) | ||
990 | + }else{ | ||
991 | + this.setData({ | ||
992 | + only_pk:arr | ||
993 | + }) | ||
994 | + } | ||
995 | + }else{ | ||
996 | + wx.showToast({ | ||
997 | + title: '没有搜索到门店', | ||
998 | + icon: 'none', | ||
999 | + duration: 2000 | ||
1000 | + }) | ||
1001 | + } | ||
1002 | + }else{ | ||
1003 | + if (this.data.is_show_sto_cat==1) { | ||
1004 | + this.setData({ | ||
1005 | + def_pickpu_list:all_pick_list.slice(0,10) | ||
1006 | + }) | ||
1007 | + }else{ | ||
1008 | + this.setData({ | ||
1009 | + only_pk:all_pick_list | ||
1010 | + }) | ||
1011 | + } | ||
1012 | + | ||
1013 | + } | ||
1014 | + }else{ //分类下搜索 | ||
1015 | + let sec_i=this.data.sec_i | ||
1016 | + let all_sto = this.data.all_sto | ||
1017 | + let sec_sto= this.data.sec_sto | ||
1018 | + let sec_arr = sec_sto.s_arr | ||
1019 | + let keyword = this.data.keyword | ||
1020 | + let text='sec_sto.s_arr' | ||
1021 | + if (keyword) { | ||
1022 | + let arr=sec_arr.filter( item =>{ | ||
1023 | + let i = item.pickup_name.indexOf(keyword) | ||
1024 | + if (i > -1) { | ||
1025 | + return true | ||
1026 | + }else{ | ||
1027 | + return false | ||
1028 | + } | ||
1029 | + }) | ||
1030 | + if (arr && arr.length>0) { | ||
1031 | + this.setData({ | ||
1032 | + [text]:arr | ||
1033 | + }) | ||
1034 | + }else{ | ||
1035 | + wx.showToast({ | ||
1036 | + title: '没有搜索到门店', | ||
1037 | + icon: 'none', | ||
1038 | + duration: 2000 | ||
1039 | + }) | ||
1040 | + } | ||
1041 | + }else{ | ||
1042 | + this.setData({ | ||
1043 | + [text]:all_sto[sec_i].s_arr | ||
1044 | + }) | ||
1045 | + } | ||
1046 | + | ||
961 | 1047 | ||
1048 | + } | ||
1049 | + }, | ||
962 | 1050 | ||
963 | getGift(){ | 1051 | getGift(){ |
964 | var that=this; | 1052 | var that=this; |
@@ -1167,6 +1255,7 @@ Page({ | @@ -1167,6 +1255,7 @@ Page({ | ||
1167 | region_name: region_name, | 1255 | region_name: region_name, |
1168 | sort_store: 0, | 1256 | sort_store: 0, |
1169 | choice_sort_store: 1, | 1257 | choice_sort_store: 1, |
1258 | + sec_i:index, | ||
1170 | sec_sto: item, | 1259 | sec_sto: item, |
1171 | sec_pick_index: 0 | 1260 | sec_pick_index: 0 |
1172 | }); | 1261 | }); |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
1 | +<wxs module="filter" src="../../../../../utils/filter.wxs"></wxs> | ||
1 | <view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}};min-height: 100vh;"> | 2 | <view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}};min-height: 100vh;"> |
2 | <view class="box_top data-v-3a5b7e36"> | 3 | <view class="box_top data-v-3a5b7e36"> |
3 | <image src="{{iurl}}{{monthgiftbag.cover_img}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> | 4 | <image src="{{iurl}}{{monthgiftbag.cover_img}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss
@@ -250,4 +250,27 @@ page.data-v-3a5b7e36 { | @@ -250,4 +250,27 @@ page.data-v-3a5b7e36 { | ||
250 | .xc-share-frame { | 250 | .xc-share-frame { |
251 | position: absolute; right:0; top: -10rpx; | 251 | position: absolute; right:0; top: -10rpx; |
252 | } | 252 | } |
253 | +.searchbar { | ||
254 | + height: 95rpx; | ||
255 | + border-bottom: 2rpx solid rgb(238, 238, 238); | ||
256 | +} | ||
257 | +.storeListpadd { | ||
258 | + padding: 0rpx 31rpx; | ||
259 | +} | ||
260 | +.search { | ||
261 | + width: 125rpx; | ||
262 | + height: 45rpx; | ||
263 | + line-height: 45rpx; | ||
264 | + background-color: rgb(219, 27, 52); | ||
265 | + border-radius: 30rpx; | ||
266 | + color: rgb(255, 255, 255); | ||
267 | +} | ||
268 | +.inputstore { | ||
269 | + width: 510rpx; | ||
270 | + height: 43rpx; | ||
271 | + line-height: 43rpx; | ||
272 | + border-radius: 30rpx; | ||
273 | + border: 2rpx solid rgb(238, 238, 238); | ||
274 | + padding-left: 30rpx; | ||
275 | +} | ||
253 | 276 |
packageE/pages/user/monthgiftbag/public/buy_com.wxml
@@ -15,6 +15,12 @@ | @@ -15,6 +15,12 @@ | ||
15 | </view> | 15 | </view> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | + <view class="searchbar flex-vertical-between storeListpadd"> | ||
19 | + <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" /> | ||
20 | + <view class="search flex-center" bindtap="searchfn"> | ||
21 | + <view class="fs28">搜索</view> | ||
22 | + </view> | ||
23 | + </view> | ||
18 | <!-- 门店列表,最外层的门店列表,一开始 --> | 24 | <!-- 门店列表,最外层的门店列表,一开始 --> |
19 | <view class="store-list"> | 25 | <view class="store-list"> |
20 | <!-- 如果还没有点击更多门店的时候 --> | 26 | <!-- 如果还没有点击更多门店的时候 --> |
@@ -37,7 +43,7 @@ | @@ -37,7 +43,7 @@ | ||
37 | </view> | 43 | </view> |
38 | <view> | 44 | <view> |
39 | <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | 45 | <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> |
40 | - 距离:{{item.distance>1000?filter.toFix(item.distance/1000,2)+'km':filter.toFix(item.distance,0)+"m"}} | 46 | + 距离:{{item.distance >1000 ? filter.toFix(item.distance/1000,2)+'km':filter.toFix(item.distance,0)+"m"}} |
41 | </view> | 47 | </view> |
42 | </view> | 48 | </view> |
43 | </view> | 49 | </view> |
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -67,6 +67,8 @@ Page({ | @@ -67,6 +67,8 @@ Page({ | ||
67 | openSpecModal:0, | 67 | openSpecModal:0, |
68 | 68 | ||
69 | is_get_guide:0, | 69 | is_get_guide:0, |
70 | + keyword:'', //门店搜索 | ||
71 | + sec_i:-1,//选中分类门店 下标 | ||
70 | 72 | ||
71 | }, | 73 | }, |
72 | onLoad: function (options) { | 74 | onLoad: function (options) { |
@@ -167,7 +169,93 @@ Page({ | @@ -167,7 +169,93 @@ Page({ | ||
167 | },2000) | 169 | },2000) |
168 | 170 | ||
169 | }, | 171 | }, |
172 | + //获取搜索门店输入的值 | ||
173 | + input_store: function(e) { | ||
174 | + this.setData({ | ||
175 | + keyword: e.detail.value | ||
176 | + }) | ||
177 | + }, | ||
178 | + //搜索门店 | ||
179 | + searchfn(){ | ||
180 | + let choice_sort_store = this.data.choice_sort_store | ||
181 | + if (choice_sort_store==0) { //全局搜索 | ||
182 | + let all_pick_list = this.data.all_pick_list | ||
183 | + let def_pickpu_list = this.data.def_pickpu_list | ||
184 | + let keyword = this.data.keyword | ||
185 | + if (keyword) { | ||
186 | + let arr=all_pick_list.filter( item =>{ | ||
187 | + let i = item.pickup_name.indexOf(keyword) | ||
188 | + if (i > -1) { | ||
189 | + return true | ||
190 | + }else{ | ||
191 | + return false | ||
192 | + } | ||
193 | + }) | ||
194 | + if (arr && arr.length>0) { | ||
195 | + if(this.data.is_show_sto_cat==1){ | ||
196 | + this.setData({ | ||
197 | + def_pickpu_list:arr | ||
198 | + }) | ||
199 | + }else{ | ||
200 | + this.setData({ | ||
201 | + only_pk:arr | ||
202 | + }) | ||
203 | + } | ||
204 | + }else{ | ||
205 | + wx.showToast({ | ||
206 | + title: '没有搜索到门店', | ||
207 | + icon: 'none', | ||
208 | + duration: 2000 | ||
209 | + }) | ||
210 | + } | ||
211 | + }else{ | ||
212 | + if (this.data.is_show_sto_cat==1) { | ||
213 | + this.setData({ | ||
214 | + def_pickpu_list:all_pick_list.slice(0,10) | ||
215 | + }) | ||
216 | + }else{ | ||
217 | + this.setData({ | ||
218 | + only_pk:all_pick_list | ||
219 | + }) | ||
220 | + } | ||
170 | 221 | ||
222 | + } | ||
223 | + }else{ //分类下搜索 | ||
224 | + let sec_i=this.data.sec_i | ||
225 | + let all_sto = this.data.all_sto | ||
226 | + let sec_sto= this.data.sec_sto | ||
227 | + let sec_arr = sec_sto.s_arr | ||
228 | + let keyword = this.data.keyword | ||
229 | + let text='sec_sto.s_arr' | ||
230 | + if (keyword) { | ||
231 | + let arr=sec_arr.filter( item =>{ | ||
232 | + let i = item.pickup_name.indexOf(keyword) | ||
233 | + if (i > -1) { | ||
234 | + return true | ||
235 | + }else{ | ||
236 | + return false | ||
237 | + } | ||
238 | + }) | ||
239 | + if (arr && arr.length>0) { | ||
240 | + this.setData({ | ||
241 | + [text]:arr | ||
242 | + }) | ||
243 | + }else{ | ||
244 | + wx.showToast({ | ||
245 | + title: '没有搜索到门店', | ||
246 | + icon: 'none', | ||
247 | + duration: 2000 | ||
248 | + }) | ||
249 | + } | ||
250 | + }else{ | ||
251 | + this.setData({ | ||
252 | + [text]:all_sto[sec_i].s_arr | ||
253 | + }) | ||
254 | + } | ||
255 | + | ||
256 | + | ||
257 | + } | ||
258 | + }, | ||
171 | //购买礼包 | 259 | //购买礼包 |
172 | GetBuyPrice: function (e) { | 260 | GetBuyPrice: function (e) { |
173 | 261 | ||
@@ -551,6 +639,7 @@ Page({ | @@ -551,6 +639,7 @@ Page({ | ||
551 | sort_store: 0, | 639 | sort_store: 0, |
552 | choice_sort_store: 1, | 640 | choice_sort_store: 1, |
553 | sec_sto: item, | 641 | sec_sto: item, |
642 | + sec_i:index, | ||
554 | sec_pick_index: 0 | 643 | sec_pick_index: 0 |
555 | }); | 644 | }); |
556 | }, | 645 | }, |
pages/giftpack/giftpacklist/giftpacklist.js
@@ -5,7 +5,7 @@ var e = getApp(), | @@ -5,7 +5,7 @@ var e = getApp(), | ||
5 | d = e.globalData; | 5 | d = e.globalData; |
6 | var ut = require("../../../utils/util.js"); | 6 | var ut = require("../../../utils/util.js"); |
7 | var com = require("../public/buy_com.js"); | 7 | var com = require("../public/buy_com.js"); |
8 | - | 8 | + |
9 | Page({ | 9 | Page({ |
10 | data: { | 10 | data: { |
11 | url: a.url, //接口网址 | 11 | url: a.url, //接口网址 |
@@ -75,7 +75,9 @@ Page({ | @@ -75,7 +75,9 @@ Page({ | ||
75 | canvasHidden:true, | 75 | canvasHidden:true, |
76 | 76 | ||
77 | screenWidth: 0, | 77 | screenWidth: 0, |
78 | - submit:0 | 78 | + submit:0, |
79 | + keyword:'', //门店搜索 | ||
80 | + sec_i:-1,//选中分类门店 下标 | ||
79 | }, | 81 | }, |
80 | onLoad: function (options) { | 82 | onLoad: function (options) { |
81 | 83 | ||
@@ -181,6 +183,93 @@ Page({ | @@ -181,6 +183,93 @@ Page({ | ||
181 | }) | 183 | }) |
182 | this.setData({ submit:0}) | 184 | this.setData({ submit:0}) |
183 | }, | 185 | }, |
186 | + //获取搜索门店输入的值 | ||
187 | + input_store: function(e) { | ||
188 | + this.setData({ | ||
189 | + keyword: e.detail.value | ||
190 | + }) | ||
191 | + }, | ||
192 | + //搜索门店 | ||
193 | + searchfn(){ | ||
194 | + let choice_sort_store = this.data.choice_sort_store | ||
195 | + if (choice_sort_store==0) { //全局搜索 | ||
196 | + let all_pick_list = this.data.all_pick_list | ||
197 | + let def_pickpu_list = this.data.def_pickpu_list | ||
198 | + let keyword = this.data.keyword | ||
199 | + if (keyword) { | ||
200 | + let arr=all_pick_list.filter( item =>{ | ||
201 | + let i = item.pickup_name.indexOf(keyword) | ||
202 | + if (i > -1) { | ||
203 | + return true | ||
204 | + }else{ | ||
205 | + return false | ||
206 | + } | ||
207 | + }) | ||
208 | + if (arr && arr.length>0) { | ||
209 | + if(this.data.is_show_sto_cat==1){ | ||
210 | + this.setData({ | ||
211 | + def_pickpu_list:arr | ||
212 | + }) | ||
213 | + }else{ | ||
214 | + this.setData({ | ||
215 | + only_pk:arr | ||
216 | + }) | ||
217 | + } | ||
218 | + }else{ | ||
219 | + wx.showToast({ | ||
220 | + title: '没有搜索到门店', | ||
221 | + icon: 'none', | ||
222 | + duration: 2000 | ||
223 | + }) | ||
224 | + } | ||
225 | + }else{ | ||
226 | + if (this.data.is_show_sto_cat==1) { | ||
227 | + this.setData({ | ||
228 | + def_pickpu_list:all_pick_list.slice(0,10) | ||
229 | + }) | ||
230 | + }else{ | ||
231 | + this.setData({ | ||
232 | + only_pk:all_pick_list | ||
233 | + }) | ||
234 | + } | ||
235 | + | ||
236 | + } | ||
237 | + }else{ //分类下搜索 | ||
238 | + let sec_i=this.data.sec_i | ||
239 | + let all_sto = this.data.all_sto | ||
240 | + let sec_sto= this.data.sec_sto | ||
241 | + let sec_arr = sec_sto.s_arr | ||
242 | + let keyword = this.data.keyword | ||
243 | + let text='sec_sto.s_arr' | ||
244 | + if (keyword) { | ||
245 | + let arr=sec_arr.filter( item =>{ | ||
246 | + let i = item.pickup_name.indexOf(keyword) | ||
247 | + if (i > -1) { | ||
248 | + return true | ||
249 | + }else{ | ||
250 | + return false | ||
251 | + } | ||
252 | + }) | ||
253 | + if (arr && arr.length>0) { | ||
254 | + this.setData({ | ||
255 | + [text]:arr | ||
256 | + }) | ||
257 | + }else{ | ||
258 | + wx.showToast({ | ||
259 | + title: '没有搜索到门店', | ||
260 | + icon: 'none', | ||
261 | + duration: 2000 | ||
262 | + }) | ||
263 | + } | ||
264 | + }else{ | ||
265 | + this.setData({ | ||
266 | + [text]:all_sto[sec_i].s_arr | ||
267 | + }) | ||
268 | + } | ||
269 | + | ||
270 | + | ||
271 | + } | ||
272 | + }, | ||
184 | GetBuyPrice: function (e) { | 273 | GetBuyPrice: function (e) { |
185 | var that = this.data; | 274 | var that = this.data; |
186 | var th = this; | 275 | var th = this; |
@@ -840,6 +929,7 @@ Page({ | @@ -840,6 +929,7 @@ Page({ | ||
840 | region_name: region_name, | 929 | region_name: region_name, |
841 | sort_store: 0, | 930 | sort_store: 0, |
842 | choice_sort_store: 1, | 931 | choice_sort_store: 1, |
932 | + sec_i:index, | ||
843 | sec_sto: item, | 933 | sec_sto: item, |
844 | sec_pick_index: 0 | 934 | sec_pick_index: 0 |
845 | }); | 935 | }); |
pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <view class="top_title data-v-3a5b7e36"> | 12 | <view class="top_title data-v-3a5b7e36"> |
13 | <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{giftTitle}}</text> | 13 | <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{giftTitle}}</text> |
14 | 14 | ||
15 | - <!-- 这个是分享按钮 --> | 15 | + <!-- 这个是分享按钮 --> |
16 | <view wx:if="{{c_state<2 && isLogin}}" class="xc-share-frame t-c" bindtap="clickShare"> | 16 | <view wx:if="{{c_state<2 && isLogin}}" class="xc-share-frame t-c" bindtap="clickShare"> |
17 | <view class="iconfont icon-share fs40" ></view> | 17 | <view class="iconfont icon-share fs40" ></view> |
18 | <view class="fs22 c-7b">分享</view> | 18 | <view class="fs22 c-7b">分享</view> |
pages/giftpack/giftpacklist/giftpacklist.wxss
@@ -250,4 +250,26 @@ page.data-v-3a5b7e36 { | @@ -250,4 +250,26 @@ page.data-v-3a5b7e36 { | ||
250 | .xc-share-frame { | 250 | .xc-share-frame { |
251 | position: absolute; right:0; top: -10rpx; | 251 | position: absolute; right:0; top: -10rpx; |
252 | } | 252 | } |
253 | - | 253 | +.searchbar { |
254 | + height: 95rpx; | ||
255 | + border-bottom: 2rpx solid rgb(238, 238, 238); | ||
256 | +} | ||
257 | +.storeListpadd { | ||
258 | + padding: 0rpx 31rpx; | ||
259 | +} | ||
260 | +.search { | ||
261 | + width: 125rpx; | ||
262 | + height: 45rpx; | ||
263 | + line-height: 45rpx; | ||
264 | + background-color: rgb(219, 27, 52); | ||
265 | + border-radius: 30rpx; | ||
266 | + color: rgb(255, 255, 255); | ||
267 | +} | ||
268 | +.inputstore { | ||
269 | + width: 510rpx; | ||
270 | + height: 43rpx; | ||
271 | + line-height: 43rpx; | ||
272 | + border-radius: 30rpx; | ||
273 | + border: 2rpx solid rgb(238, 238, 238); | ||
274 | + padding-left: 30rpx; | ||
275 | +} |
pages/giftpack/public/buy_com.wxml
@@ -15,7 +15,13 @@ | @@ -15,7 +15,13 @@ | ||
15 | </view> | 15 | </view> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | - <!-- 门店列表,最外层的门店列表,一开始 --> | 18 | + <view class="searchbar flex-vertical-between storeListpadd"> |
19 | + <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" /> | ||
20 | + <view class="search flex-center" bindtap="searchfn"> | ||
21 | + <view class="fs28">搜索</view> | ||
22 | + </view> | ||
23 | + </view> | ||
24 | + <!-- 门店列表,最外层的门店列表,一开始 --> | ||
19 | <view class="store-list"> | 25 | <view class="store-list"> |
20 | <!-- 如果还没有点击更多门店的时候 --> | 26 | <!-- 如果还没有点击更多门店的时候 --> |
21 | <block wx:if="{{choice_sort_store==0}}"> | 27 | <block wx:if="{{choice_sort_store==0}}"> |
pages/goods/goodsInfo/goodsInfo.js
@@ -3720,7 +3720,7 @@ Page({ | @@ -3720,7 +3720,7 @@ Page({ | ||
3720 | }, 200) | 3720 | }, 200) |
3721 | 3721 | ||
3722 | }, | 3722 | }, |
3723 | - //获取搜索门店输入的值 | 3723 | + //获取搜索门店输入的值 |
3724 | input_store: function(e) { | 3724 | input_store: function(e) { |
3725 | this.setData({ | 3725 | this.setData({ |
3726 | keyword: e.detail.value | 3726 | keyword: e.detail.value |