Authored by 阿达

添加设置参数 fix 价格显示不全bug

... ... @@ -31,7 +31,8 @@ var $subNav = $('.home-sub-nav'),
$pgc = $($goodsChildren.get(1)),
$dgc = $($goodsChildren.get(2)),
shopId = $('input[name="shop_id"]').val(),
appVersion = $('input[name="app_version"]').val();
appVersion = $('input[name="app_version"]').val(),
brand = $('input[name="brand"]').val();
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -143,6 +144,16 @@ function getPageGoods(info) {
});
}
function getParam(req) {
if (shopId) {
req.data.shop_id = shopId;
}
if (brand) {
req.data.brand = brand;
}
}
function newData(callback) {
var req = {};
... ... @@ -150,9 +161,11 @@ function newData(callback) {
req.data = {
type: 'newest',
order: '1',
page: navInfo.new.page,
shop_id: shopId
page: navInfo.new.page
};
getParam(req);
req.callBack = function(data) {
$('#new-arrival').append(data);
navInfo.new.page++;
... ... @@ -172,9 +185,11 @@ function hotData(callback) {
req.data = {
type: 'hot',
order: '1',
page: navInfo.hot.page,
shop_id: shopId
page: navInfo.hot.page
};
getParam(req);
req.callBack = function(data) {
$('#popularity').append(data);
navInfo.hot.page++;
... ... @@ -445,6 +460,7 @@ function search(opt) {
page: page
});
searching = true;
loading.showLoadingMask();
... ... @@ -512,7 +528,8 @@ $.ajax({
type: 'GET',
url: '/search/filter',
data: {
shop_id: shopId
shop_id: shopId,
brand: brand
},
success: function(data) {
$goodsContainer.append(data);
... ... @@ -658,6 +675,7 @@ $subNav.on('touchend touchcancel', function(e) {
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: '/index/search/search',
nextPage: false
});
... ... @@ -678,6 +696,7 @@ function scrollHandler() {
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: '/index/search/search',
nextPage: true
});
... ... @@ -695,6 +714,7 @@ $(window).scroll(function() {
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: '/index/search/search',
nextPage: false
});
... ...
... ... @@ -255,6 +255,9 @@
margin: 0;
line-height: 32px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
... ...
... ... @@ -15,6 +15,7 @@
<input type="text" placeholder="搜索店铺内潮品" name="query" class="buriedpoint">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="app_version" value="{{appVersion}}">
<input type="hidden" name="brand" value="{{brand}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search buriedpoint" type="submit">搜索</button>
</form>
... ...