Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -23,7 +23,7 @@ exports.fetchProducts = (req, res, next) => {
const params = {
page: req.query.page || 1,
order: req.query.order || 1,
query: req.query.query
query: (req.query.query || '').trim()
};
model.products(params)
... ...
... ... @@ -15,23 +15,17 @@ const search = {
method: 'app.search.li'
}, params);
delete data.client_type;
delete data.client_secret;
return api.post('', data, {
return api.get('', data, {
cache: true,
code: 200
})
.then(result => {
if (!result.hasOwnProperty('code')) {
result.code = 200;
}
if (result.code === 200) {
prettyFilter(result.data.filter);
result = camelCase(result);
result.data.productList = processProductList(result.data.productList, {gender: params.gender});
}
return result;
});
}).then(result => {
if (result.data) {
prettyFilter(result.data.filter);
result = camelCase(result);
result.data.productList = processProductList(result.data.productList, {gender: params.gender});
}
return result;
});
}
};
... ...
<template>
<div class="header-wrap" :class="class">
<div class="header">
<div class="header-left">
<div class="blk-header-wrap" :class="class">
<div class="blk-header">
<div class="blk-header-left">
<slot name="left">
<i class="icon icon-left" @click="goBack"></i>
</slot>
</div>
<div class="header-right">
<div class="blk-header-right">
<slot name="right"></slot>
</div>
<div class="header-main">
<span class="header-title">{{title}}</span>
<div class="blk-header-main">
<span class="blk-header-title">{{title}}</span>
</div>
</div>
<div class="header-gap"></div>
<div class="blk-header-gap"></div>
</div>
</template>
<script>
... ... @@ -29,7 +29,7 @@
};
</script>
<style>
.header {
.blk-header {
box-sizing: content-box;
position: fixed;
top: 0;
... ... @@ -47,12 +47,12 @@
color: #000;
.icon,
.header-title {
.blk-header-title {
vertical-align: middle;
}
}
.header-main {
.blk-header-main {
display: block;
text-align: center;
margin-left: auto;
... ... @@ -62,11 +62,11 @@
text-overflow: ellipsis;
}
.header-left {
.blk-header-left {
float: left;
}
.header-right {
.blk-header-right {
float: right;
.icon {
... ... @@ -74,17 +74,17 @@
}
}
.header-gap {
.blk-header-gap {
height: 100px;
background-color: transparent;
}
.app.ios {
.header {
.blk-header {
padding-top: 60px;
}
.header-gap {
.blk-header-gap {
height: calc(70 + 60 + 10)px;
}
}
... ...
... ... @@ -5,11 +5,11 @@
</template>
<style>
.top-nav {
.header {
.blk-header {
background-color: transparent;
}
.header-gap {
.blk-header-gap {
display: none;
}
}
... ...
... ... @@ -69,20 +69,20 @@
}
this.inSearching = true;
console.log(nextPage);
return $.get(this.url, {
order: this.order, // 排序 信息
query: this.query,
page: nextPage
})
.done(res => {
if (res.code === 200) {
if (res.data) {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
}
})
.fail(error => {
.fail(() => {
tip('网络出错~');
})
.always(() => {
... ... @@ -128,7 +128,4 @@
});
}
};
</script>
<style>
</style>
... ...
... ... @@ -11,23 +11,23 @@
<style>
.top-box {
.header {
.blk-header {
background-color: transparent;
color: #fff;
}
.header-gap {
.blk-header-gap {
display: none;
}
}
.top-change {
.header {
.blk-header {
background-color: #fff;
color: #000;
}
.header-gap {
.blk-header-gap {
display: block;
}
}
... ...