小程序搜索优化
parent
e321219b2d
commit
4386878535
|
|
@ -167,9 +167,11 @@ class SearchService
|
|||
{
|
||||
$params['category_ids'] = (substr($params['category_ids'], 0, 1) == '{') ? json_decode(htmlspecialchars_decode($params['category_ids']), true) : explode(',', $params['category_ids']);
|
||||
}
|
||||
$ids = GoodsService::GoodsCategoryItemsIds($params['category_ids'], 1);
|
||||
$ids[] = $params['category_id'];
|
||||
$category_ids = array_merge($category_ids, $ids);
|
||||
if(!empty($params['category_ids']))
|
||||
{
|
||||
$ids = GoodsService::GoodsCategoryItemsIds($params['category_ids'], 1);
|
||||
$category_ids = array_merge($category_ids, $ids);
|
||||
}
|
||||
}
|
||||
if(!empty($category_ids))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ App({
|
|||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
request_url: 'http://shopxo.com/',
|
||||
// request_url: 'https://dev.shopxo.net/',
|
||||
request_url: 'https://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages": ["pages/goods-search/goods-search",
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"pages/web-view/web-view",
|
||||
"pages/login/login",
|
||||
"pages/paytips/paytips",
|
||||
"pages/goods-search/goods-search",
|
||||
|
||||
"pages/goods-detail/goods-detail",
|
||||
"pages/goods-comment/goods-comment",
|
||||
"pages/user-address/user-address",
|
||||
|
|
|
|||
|
|
@ -230,10 +230,7 @@ Page({
|
|||
index++;
|
||||
}
|
||||
}
|
||||
if(app.get_length(temp) > 0)
|
||||
{
|
||||
post_data[data.map_fields_list[i]['form_key']] = JSON.stringify(temp);
|
||||
}
|
||||
post_data[data.map_fields_list[i]['form_key']] = (app.get_length(temp) > 0) ? JSON.stringify(temp) : '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -323,6 +320,33 @@ Page({
|
|||
this.setData(data);
|
||||
}
|
||||
},
|
||||
|
||||
// 条件-清空
|
||||
map_remove_event(e) {
|
||||
var data = this.data;
|
||||
// 关键字
|
||||
data['post_data']['wd'] = '';
|
||||
|
||||
// 品牌、分类、价格、属性、规格
|
||||
for(var i in data.map_fields_list)
|
||||
{
|
||||
if((data[i] != null) != null && data[i].length > 0)
|
||||
{
|
||||
for(var k in data[i])
|
||||
{
|
||||
data[i][k]['active'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭条件弹层
|
||||
this.popup_form_event_close();
|
||||
|
||||
// 分页恢复1页、重新获取数据
|
||||
data['data_page'] = 1;
|
||||
this.setData(data);
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<text>筛选出</text>
|
||||
<text class="cr-main"> {{data_total}} </text>
|
||||
<text>条数据</text>
|
||||
<text class="map-remove-submit fr" bindtap="map_remove_event">清除</text>
|
||||
</view>
|
||||
|
||||
<!-- 搜索关键字 -->
|
||||
|
|
|
|||
|
|
@ -133,6 +133,10 @@
|
|||
bottom: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.map-remove-submit {
|
||||
color: #e23f36;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌基础信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue