Authored by 李奇

检索页修改

... ... @@ -2,15 +2,15 @@ import api from '../../common/api';
export default {
/**
* 模糊搜索商品列表
* @param params
* @returns {*}
*/
* 搜索店铺商品列表
* @param params
* @returns {*}
*/
productList(params) {
return api.get({
url: '',
data: Object.assign({
method: 'app.search.fuzzy.distribution'
method: 'app.search.shop.productList'
}, params)
});
}
... ...
... ... @@ -124,9 +124,28 @@ Page({
});
},
// 筛选变更
filterChange: function(e) {
let params;
let {curSort, gender} = e.detail;
this.data.order = curSort;
this.data.gender = gender;
params = {
gender,
order: curSort,
page: 1,
limit: 20
};
this.data.productList = [];
params.setScrollPos = true;
this._productList(params);
},
// 商品列表
_productList: function(params) {
params = params || {page: 1, pageNo: 20};
params.shop_id = app.getShopId();
... ...
... ... @@ -19,9 +19,9 @@
bindclickreport="resourceClickReport">
</resources>
<view class="product-list">
<view class="list-head">
<view class="header-filter">
<view class="filter {{floatFilter ? 'float' : ''}}">
<product-list-filter bind:sortchange="sortChange"></product-list-filter>
<product-list-filter bind:sortchange="filterChange"></product-list-filter>
</view>
</view>
<view class="list">
... ...
... ... @@ -97,3 +97,7 @@
background-color: #fff;
padding-bottom: 30rpx;
}
.header-filter {
border-bottom: 1px solid #eee;
}
... ...
... ... @@ -3,6 +3,7 @@ import Yas from '../../../common/yas';
import searchModel from '../../../models/product/search';
const {windowHeight} = getApp().getSystemInfo();
const app = getApp();
let yas;
... ... @@ -95,6 +96,7 @@ Page({
this.data.isLoading = true;
wx.showLoading({title: '加载中'});
params.shop_id = app.getShopId();
searchModel.productList(params).then(res => {
if (res.code === 200) {
const keyAdapter = {
... ...
<view class="search-container" style="min-height:{{windowHeight}}px;">
<view class="top-search">
<view class="input-bg"></view>
<input class="search-input" value="{{query}}" confirm-type="search" placeholder="潮流单品搜一下"
<input class="search-input" value="{{query}}" confirm-type="search" placeholder="店内潮品搜一下"
bindconfirm="confirmQuery" bindinput="bindQueryInput"
placeholder-class="placeholder" auto-focus/>
<image wx:if="{{query}}" catchtap="clearQuery" class="clear-query" src="../../../static/images/clear@2x.png"></image>
<image class="icon" src="../../../static/images/search@2x.png"></image>
</view>
<view hidden="{{!searched}}">
<view class="fixed-filter">
... ...
... ... @@ -16,9 +16,10 @@
top: 0;
left: 0;
right: 0;
height: 72rpx;
height: 88rpx;
padding: 18rpx 30rpx;
background-color: #fff;
box-sizing: border-box;
background-color: #f0f0f0;
z-index: 10001;
}
... ... @@ -27,27 +28,26 @@
top: 18rpx;
right: 30rpx;
left: 30rpx;
height: 72rpx;
background: #f7f7f7;
border-radius: 20px;
height: 56rpx;
padding-left: 40rpx;
}
.top-search .clear-query {
position: absolute;
right: 29rpx;
top: 18rpx;
width: 34rpx;
height: 34rpx;
padding: 19rpx 19rpx 19rpx 30rpx;
z-index: 10003;
background: #fff;
border-radius: 10rpx;
}
.search-input {
height: 72rpx;
padding-left: 40rpx;
box-sizing: border-box;
height: 56rpx;
padding-left: 48rpx;
margin-right: 80rpx;
font-size: 24rpx;
box-sizing: border-box;
}
.top-search .icon {
position: absolute;
top: 32rpx;
left: 40rpx;
width: 26rpx;
height: 26rpx;
}
.placeholder {
... ... @@ -58,7 +58,7 @@
.fixed-filter {
position: fixed;
top: 105rpx;
top: 88rpx;
left: 0;
right: 0;
width: 100%;
... ... @@ -74,7 +74,7 @@
left: 0;
right: 0;
bottom: 0;
padding-top: 220rpx;
padding-top: 203rpx;
text-align: center;
background-color: #fff;
z-index: -1;
... ... @@ -94,6 +94,6 @@
}
.product-list {
padding-top: 196rpx;
padding-top: 179rpx;
padding-bottom: 60rpx;
}
... ...