From 2664cfe2b67cd8446d1a9fccec472e36999a1839 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 23 Nov 2018 18:30:49 +0800 Subject: [PATCH] search --- alipay/app.json | 4 +- alipay/pages/goods-search/goods-search.acss | 14 ++++--- alipay/pages/goods-search/goods-search.axml | 40 ++++++++++--------- alipay/pages/goods-search/goods-search.js | 2 +- .../Service/SearchService.class.php | 26 ++++++------ 5 files changed, 46 insertions(+), 40 deletions(-) diff --git a/alipay/app.json b/alipay/app.json index dd26eea6a..c851a018e 100755 --- a/alipay/app.json +++ b/alipay/app.json @@ -1,5 +1,5 @@ { - "pages": ["pages/goods-search/goods-search", + "pages": [ "pages/index/index", "pages/goods-category/goods-category", "pages/cart/cart", @@ -8,7 +8,7 @@ "pages/login/login", "pages/paytips/paytips", - + "pages/goods-search/goods-search", "pages/goods-detail/goods-detail", "pages/goods-attribute/goods-attribute", "pages/buy/buy", diff --git a/alipay/pages/goods-search/goods-search.acss b/alipay/pages/goods-search/goods-search.acss index 789f4205c..8c41ad68a 100755 --- a/alipay/pages/goods-search/goods-search.acss +++ b/alipay/pages/goods-search/goods-search.acss @@ -1,6 +1,9 @@ /** * 商品列表 */ + .scroll-box { + height: calc(100vh - 80rpx); + } .data-list { overflow: hidden; } @@ -72,19 +75,18 @@ * 排序导航 */ .nav-sort-content .item { - height: 60rpx; - line-height: 60rpx; + height: 80rpx; + line-height: 80rpx; width: 160rpx; } .nav-sort-content .item .icon { width: 30rpx; height: 30rpx; - vertical-align: middle; } .screening-submit { - width: 45rpx; - height: 45rpx; + width: 50rpx; + height: 50rpx; position: absolute; - top: 10rpx; + top: 15rpx; right: 20rpx; } \ No newline at end of file diff --git a/alipay/pages/goods-search/goods-search.axml b/alipay/pages/goods-search/goods-search.axml index 3bae675f3..354e06fd2 100755 --- a/alipay/pages/goods-search/goods-search.axml +++ b/alipay/pages/goods-search/goods-search.axml @@ -11,23 +11,6 @@ - - - - - @@ -53,4 +36,25 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/alipay/pages/goods-search/goods-search.js b/alipay/pages/goods-search/goods-search.js index 9f5dbaaf6..56f5efbbc 100755 --- a/alipay/pages/goods-search/goods-search.js +++ b/alipay/pages/goods-search/goods-search.js @@ -62,7 +62,7 @@ Page({ my.httpRequest({ url: app.get_request_url("Index", "Search"), method: "POST", - data: params, + data: this.data.post_data, dataType: "json", success: res => { my.hideLoading(); diff --git a/service/Application/Service/SearchService.class.php b/service/Application/Service/SearchService.class.php index ac4851eb5..b9362dd41 100755 --- a/service/Application/Service/SearchService.class.php +++ b/service/Application/Service/SearchService.class.php @@ -89,19 +89,19 @@ class SearchService $price = M('ScreeningPrice')->field('min_price,max_price')->where(['is_enable'=>1, 'id'=>intval($params['screening_price_id'])])->find(); $params['min_price'] = $price['min_price']; $params['max_price'] = $price['max_price']; - if(!empty($params['min_price']) && !empty($params['max_price'])) - { - $where['g.price'] = [ - ['EGT', $params['min_price']], - ['LT', $params['max_price']], - ]; - } else if(!empty($params['min_price'])) - { - $where['g.price'] = ['EGT', $params['min_price']]; - } else if(!empty($params['max_price'])) - { - $where['g.price'] = ['LT', $params['max_price']]; - } + } + if(!empty($params['min_price']) && !empty($params['max_price'])) + { + $where['g.price'] = [ + ['EGT', $params['min_price']], + ['LT', $params['max_price']], + ]; + } else if(!empty($params['min_price'])) + { + $where['g.price'] = ['EGT', $params['min_price']]; + } else if(!empty($params['max_price'])) + { + $where['g.price'] = ['LT', $params['max_price']]; } // 获取商品总数