diff --git a/package1/group/groupBuyList.vue b/package1/group/groupBuyList.vue index 1886ce0..ead4311 100644 --- a/package1/group/groupBuyList.vue +++ b/package1/group/groupBuyList.vue @@ -23,13 +23,13 @@ - + {{item.name}} - + {{item.name}} @@ -78,7 +78,7 @@ - {{item.shopTakeaway.type}} + {{item.shopTypeTitle == undefined ? '美食' : item.shopTypeTitle}} @@ -95,7 +95,7 @@ - + @@ -141,6 +141,7 @@ shopType:'', shopArea:'', pageNumber: 1, + keyWord:'', pageSize: '10', sort: "shoprank", order: "desc", @@ -154,43 +155,53 @@ shopList:[], menuBtn:[{ name:'美食', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/d6b53eb217644e74bbf957ff7462c27b.png', index:1 },{ name:'甜点饮品', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/b43aea98962b402f900eca84b2c171ae.png', index:2 },{ name:'超市便利', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/e082a4c10b9a47f0bdb588fb91bc9afb.png', index:3 },{ name:'蔬菜水果', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/e6adc80518c24c488522ab19f036af27.png', index:4 },{ name:'看病买药', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/766761af471a4f9f90e9a137f9c4f701.png', index:5 }], menuBtn1:[{ name:'米粉面馆', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8d2f7ffb67a4477ebe663f562b3bd018.png', index:6 },{ - name:'烤肉拌饭', + name:'早点', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/5e4fa14df92942eeb62254c8eb82f122.png', index:7 },{ name:'快餐', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/05d2286ac1be4ae784858409889690d5.png', index:8 },{ name:'麻辣烫冒菜', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0ac5e0095a5d4097b338ec450df8d3dd.png', index:9 },{ name:'汉堡披萨', + value:'', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/14b93d4bce134b3db4b42b13b6993e6c.png', index:10 }], @@ -245,6 +256,7 @@ }, methods: { searchShop(type,value){ + this.searchForm.pageNumber = 1 if(type == 'area'){ this.searchForm.shopArea = value }else if(type == 'score'){ @@ -279,12 +291,12 @@ for(let i = 0;i page { width: 100%; - height: 100%; + min-height: 100%; font-size: 24rpx; background: #F5F8F5; color: #00231C; @@ -384,14 +403,16 @@ .page1 { width: 100%; - height: 100%; + min-height: 100vh; font-size: 24rpx; position: relative; } .title{ background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat; + background-size: 100% 100%; width: 100%; - height: 54%; + height: auto; + padding-bottom: 20rpx; } .swiper { width: 100%; @@ -499,7 +520,7 @@ } .shop-member{ width: 100%; - height: 480rpx; + height: auto; border-radius: 20rpx; background: #fff; margin-bottom: 20rpx; diff --git a/package1/group/searchGroup.vue b/package1/group/searchGroup.vue index 900ad39..0d9117f 100644 --- a/package1/group/searchGroup.vue +++ b/package1/group/searchGroup.vue @@ -11,28 +11,17 @@ - + - - - 历史搜索 + + + 历史搜索 + - - - 麻辣 - - - 牛肉 - - - 雪 - - - 面 - - - 茶 + + + {{item}} @@ -80,7 +69,7 @@ - {{item.shopTakeaway.type}} + {{item.shopTakeaway && item.shopTakeaway.type ? item.shopTakeaway.type : '美食'}} @@ -97,7 +86,7 @@ - + @@ -131,9 +120,12 @@ searchSale: false, shopArea:[], totalPages:1, + historyList: [], searchForm:{ regionId:JSON.parse(uni.getStorageSync('area')).id, + shopName:'', shopType:'', + keyWord:'', shopArea:'', pageNumber: 1, pageSize: '10', @@ -181,19 +173,54 @@ this.getShopList(); }, - onLoad() { + onLoad(option) { + if (option && option.shopType && option.shopType !== 'undefined') { + this.searchForm.shopType = option.shopType; + this.getShopList(); + } + let history = uni.getStorageSync('searchHistoryGroup'); + if (history) { + this.historyList = JSON.parse(history); + } this.getShopArea(); - // this.getShopList(); + //this.getShopList(); }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() - uni.showLoading({ - title: '加载中...', - mask: true - }) }, methods: { + goSearch() { + if (this.searchForm.keyWord && this.searchForm.keyWord.trim()) { + let list = this.historyList; + let index = list.indexOf(this.searchForm.keyWord.trim()); + if (index !== -1) list.splice(index, 1); + list.unshift(this.searchForm.keyWord.trim()); + if (list.length > 10) list.pop(); + this.historyList = list; + uni.setStorageSync('searchHistoryGroup', JSON.stringify(list)); + } + this.searchForm.pageNumber = 1; + this.getShopList(); + }, + clickHistory(item) { + this.searchForm.keyWord = item; + this.goSearch(); + this.$forceUpdate() + }, + clearHistory() { + uni.showModal({ + title: '提示', + content: '确定清空历史搜索吗?', + success: (res) => { + if (res.confirm) { + this.historyList = []; + uni.setStorageSync('searchHistoryGroup', '[]'); + } + } + }); + }, searchShop(type,value){ + this.searchForm.pageNumber = 1 if(type == 'area'){ this.searchForm.shopArea = value }else if(type == 'score'){ @@ -299,7 +326,7 @@