From 205555cfe83ba9662d2a5024dd64fb6c6c44eafe Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Tue, 20 Jun 2023 11:09:16 +0800 Subject: [PATCH] 礼包门店搜索 --- packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml | 1 + packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss | 23 +++++++++++++++++++++++ packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml | 1 + packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss | 23 +++++++++++++++++++++++ packageE/pages/user/monthgiftbag/public/buy_com.wxml | 8 +++++++- pages/giftpack/buygiftpack/giftpackbuy.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/giftpack/giftpacklist/giftpacklist.js | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- pages/giftpack/giftpacklist/giftpacklist.wxml | 2 +- pages/giftpack/giftpacklist/giftpacklist.wxss | 24 +++++++++++++++++++++++- pages/giftpack/public/buy_com.wxml | 8 +++++++- pages/goods/goodsInfo/goodsInfo.js | 2 +- 13 files changed, 446 insertions(+), 7 deletions(-) diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js index ff8c348..9a10848 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js @@ -67,6 +67,8 @@ Page({ openSpecModal:0, is_get_guide:0, + keyword:'', //门店搜索 + sec_i:-1,//选中分类门店 下标 }, onLoad: function (options) { @@ -180,7 +182,93 @@ Page({ }) },1000) }, + //获取搜索门店输入的值 + input_store: function(e) { + this.setData({ + keyword: e.detail.value + }) + }, + //搜索门店 + searchfn(){ + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store==0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr=all_pick_list.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + if(this.data.is_show_sto_cat==1){ + this.setData({ + def_pickpu_list:arr + }) + }else{ + this.setData({ + only_pk:arr + }) + } + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if (this.data.is_show_sto_cat==1) { + this.setData({ + def_pickpu_list:all_pick_list.slice(0,10) + }) + }else{ + this.setData({ + only_pk:all_pick_list + }) + } + } + }else{ //分类下搜索 + let sec_i=this.data.sec_i + let all_sto = this.data.all_sto + let sec_sto= this.data.sec_sto + let sec_arr = sec_sto.s_arr + let keyword = this.data.keyword + let text='sec_sto.s_arr' + if (keyword) { + let arr=sec_arr.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + this.setData({ + [text]:arr + }) + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + this.setData({ + [text]:all_sto[sec_i].s_arr + }) + } + + + } + }, //购买礼包 GetBuyPrice: function (e) { @@ -579,6 +667,7 @@ Page({ region_name: region_name, sort_store: 0, choice_sort_store: 1, + sec_i:index, sec_sto: item, sec_pick_index: 0 }); diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml index b217dfe..91c0491 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml @@ -1,3 +1,4 @@ + diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss index b56fba2..660b7da 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss @@ -230,4 +230,27 @@ page { .After_all .end { margin: 0rpx 15rpx; +} +.searchbar { + height: 95rpx; + border-bottom: 2rpx solid rgb(238, 238, 238); +} +.storeListpadd { + padding: 0rpx 31rpx; +} +.search { + width: 125rpx; + height: 45rpx; + line-height: 45rpx; + background-color: rgb(219, 27, 52); + border-radius: 30rpx; + color: rgb(255, 255, 255); +} +.inputstore { + width: 510rpx; + height: 43rpx; + line-height: 43rpx; + border-radius: 30rpx; + border: 2rpx solid rgb(238, 238, 238); + padding-left: 30rpx; } \ No newline at end of file diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js index 5c5a652..6b65103 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js @@ -79,6 +79,8 @@ Page({ screenWidth: 0, monthgiftbag:{}, scene:"", + keyword:'', //门店搜索 + sec_i:-1,//选中分类门店 下标 }, onLoad: function (options) { @@ -958,7 +960,93 @@ Page({ }, + //获取搜索门店输入的值 + input_store: function(e) { + this.setData({ + keyword: e.detail.value + }) + }, + //搜索门店 + searchfn(){ + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store==0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr=all_pick_list.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + if(this.data.is_show_sto_cat==1){ + this.setData({ + def_pickpu_list:arr + }) + }else{ + this.setData({ + only_pk:arr + }) + } + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if (this.data.is_show_sto_cat==1) { + this.setData({ + def_pickpu_list:all_pick_list.slice(0,10) + }) + }else{ + this.setData({ + only_pk:all_pick_list + }) + } + + } + }else{ //分类下搜索 + let sec_i=this.data.sec_i + let all_sto = this.data.all_sto + let sec_sto= this.data.sec_sto + let sec_arr = sec_sto.s_arr + let keyword = this.data.keyword + let text='sec_sto.s_arr' + if (keyword) { + let arr=sec_arr.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + this.setData({ + [text]:arr + }) + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + this.setData({ + [text]:all_sto[sec_i].s_arr + }) + } + + } + }, getGift(){ var that=this; @@ -1167,6 +1255,7 @@ Page({ region_name: region_name, sort_store: 0, choice_sort_store: 1, + sec_i:index, sec_sto: item, sec_pick_index: 0 }); diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml index a852b38..fdbba35 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml @@ -1,3 +1,4 @@ + diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss index 0977920..124d3d6 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss @@ -250,4 +250,27 @@ page.data-v-3a5b7e36 { .xc-share-frame { position: absolute; right:0; top: -10rpx; } +.searchbar { + height: 95rpx; + border-bottom: 2rpx solid rgb(238, 238, 238); +} +.storeListpadd { + padding: 0rpx 31rpx; +} +.search { + width: 125rpx; + height: 45rpx; + line-height: 45rpx; + background-color: rgb(219, 27, 52); + border-radius: 30rpx; + color: rgb(255, 255, 255); +} +.inputstore { + width: 510rpx; + height: 43rpx; + line-height: 43rpx; + border-radius: 30rpx; + border: 2rpx solid rgb(238, 238, 238); + padding-left: 30rpx; +} diff --git a/packageE/pages/user/monthgiftbag/public/buy_com.wxml b/packageE/pages/user/monthgiftbag/public/buy_com.wxml index 189e7f6..ea69ed4 100644 --- a/packageE/pages/user/monthgiftbag/public/buy_com.wxml +++ b/packageE/pages/user/monthgiftbag/public/buy_com.wxml @@ -15,6 +15,12 @@ + + + + 搜索 + + @@ -37,7 +43,7 @@ - 距离:{{item.distance>1000?filter.toFix(item.distance/1000,2)+'km':filter.toFix(item.distance,0)+"m"}} + 距离:{{item.distance >1000 ? filter.toFix(item.distance/1000,2)+'km':filter.toFix(item.distance,0)+"m"}} diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index d807ed1..fa6341c 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -67,6 +67,8 @@ Page({ openSpecModal:0, is_get_guide:0, + keyword:'', //门店搜索 + sec_i:-1,//选中分类门店 下标 }, onLoad: function (options) { @@ -167,7 +169,93 @@ Page({ },2000) }, + //获取搜索门店输入的值 + input_store: function(e) { + this.setData({ + keyword: e.detail.value + }) + }, + //搜索门店 + searchfn(){ + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store==0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr=all_pick_list.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + if(this.data.is_show_sto_cat==1){ + this.setData({ + def_pickpu_list:arr + }) + }else{ + this.setData({ + only_pk:arr + }) + } + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if (this.data.is_show_sto_cat==1) { + this.setData({ + def_pickpu_list:all_pick_list.slice(0,10) + }) + }else{ + this.setData({ + only_pk:all_pick_list + }) + } + } + }else{ //分类下搜索 + let sec_i=this.data.sec_i + let all_sto = this.data.all_sto + let sec_sto= this.data.sec_sto + let sec_arr = sec_sto.s_arr + let keyword = this.data.keyword + let text='sec_sto.s_arr' + if (keyword) { + let arr=sec_arr.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + this.setData({ + [text]:arr + }) + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + this.setData({ + [text]:all_sto[sec_i].s_arr + }) + } + + + } + }, //购买礼包 GetBuyPrice: function (e) { @@ -551,6 +639,7 @@ Page({ sort_store: 0, choice_sort_store: 1, sec_sto: item, + sec_i:index, sec_pick_index: 0 }); }, diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index ccb8767..f1d41d8 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -5,7 +5,7 @@ var e = getApp(), d = e.globalData; var ut = require("../../../utils/util.js"); var com = require("../public/buy_com.js"); - + Page({ data: { url: a.url, //接口网址 @@ -75,7 +75,9 @@ Page({ canvasHidden:true, screenWidth: 0, - submit:0 + submit:0, + keyword:'', //门店搜索 + sec_i:-1,//选中分类门店 下标 }, onLoad: function (options) { @@ -181,6 +183,93 @@ Page({ }) this.setData({ submit:0}) }, + //获取搜索门店输入的值 + input_store: function(e) { + this.setData({ + keyword: e.detail.value + }) + }, + //搜索门店 + searchfn(){ + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store==0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr=all_pick_list.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + if(this.data.is_show_sto_cat==1){ + this.setData({ + def_pickpu_list:arr + }) + }else{ + this.setData({ + only_pk:arr + }) + } + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if (this.data.is_show_sto_cat==1) { + this.setData({ + def_pickpu_list:all_pick_list.slice(0,10) + }) + }else{ + this.setData({ + only_pk:all_pick_list + }) + } + + } + }else{ //分类下搜索 + let sec_i=this.data.sec_i + let all_sto = this.data.all_sto + let sec_sto= this.data.sec_sto + let sec_arr = sec_sto.s_arr + let keyword = this.data.keyword + let text='sec_sto.s_arr' + if (keyword) { + let arr=sec_arr.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + this.setData({ + [text]:arr + }) + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + this.setData({ + [text]:all_sto[sec_i].s_arr + }) + } + + + } + }, GetBuyPrice: function (e) { var that = this.data; var th = this; @@ -840,6 +929,7 @@ Page({ region_name: region_name, sort_store: 0, choice_sort_store: 1, + sec_i:index, sec_sto: item, sec_pick_index: 0 }); diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxml b/pages/giftpack/giftpacklist/giftpacklist.wxml index e79ba5b..bb13566 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.wxml +++ b/pages/giftpack/giftpacklist/giftpacklist.wxml @@ -12,7 +12,7 @@ {{giftTitle}} - + 分享 diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxss b/pages/giftpack/giftpacklist/giftpacklist.wxss index 68ce4b7..31032ef 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.wxss +++ b/pages/giftpack/giftpacklist/giftpacklist.wxss @@ -250,4 +250,26 @@ page.data-v-3a5b7e36 { .xc-share-frame { position: absolute; right:0; top: -10rpx; } - +.searchbar { + height: 95rpx; + border-bottom: 2rpx solid rgb(238, 238, 238); +} +.storeListpadd { + padding: 0rpx 31rpx; +} +.search { + width: 125rpx; + height: 45rpx; + line-height: 45rpx; + background-color: rgb(219, 27, 52); + border-radius: 30rpx; + color: rgb(255, 255, 255); +} +.inputstore { + width: 510rpx; + height: 43rpx; + line-height: 43rpx; + border-radius: 30rpx; + border: 2rpx solid rgb(238, 238, 238); + padding-left: 30rpx; +} diff --git a/pages/giftpack/public/buy_com.wxml b/pages/giftpack/public/buy_com.wxml index a9df9ba..95748af 100644 --- a/pages/giftpack/public/buy_com.wxml +++ b/pages/giftpack/public/buy_com.wxml @@ -15,7 +15,13 @@ - + + + + 搜索 + + + diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 12913d6..f013d18 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3720,7 +3720,7 @@ Page({ }, 200) }, - //获取搜索门店输入的值 + //获取搜索门店输入的值 input_store: function(e) { this.setData({ keyword: e.detail.value -- libgit2 0.21.4