Authored by 郭成尧

'fav-cors'

... ... @@ -233,7 +233,7 @@ const shopIntro = (req, res, next) => {
* opt 操作标识("ok":表示收藏,"cancel":表示取消收藏)
*/
const favoriteBrand = (req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', req.protocol + '://' + req.headers.host);
res.setHeader('Access-Control-Allow-Origin', req.protocol + '://' + req.headers.origin);
res.setHeader('Access-Control-Allow-Credentials', 'true');
let id = req.query.id;
... ...
... ... @@ -397,9 +397,11 @@ const getBaseShopData = (params, shopInfo) => {
cartUrl: helpers.urlFormat('/cart/index/index')
};
let shopId = params.shop_id || shopInfo.shopsId;
return api.all([
_getShopDecorator(params.shop_id),
getShopBrands(params.shop_id)
_getShopDecorator(shopId),
getShopBrands(shopId)
]).then(result => {
if (result[0] && _.has(result[0], 'list')) {
... ... @@ -411,7 +413,7 @@ const getBaseShopData = (params, shopInfo) => {
baseShopHome: {
appVersion: _.get(params, 'app_version', ''),
isBaseShop: true,
id: params.shop_id,
id: shopId,
intro: shopInfo.shopIntro,
collected: shopInfo.isFavorite === 'Y',
banner: _.get(banner[0], 'shopSrc', '')
... ... @@ -423,7 +425,7 @@ const getBaseShopData = (params, shopInfo) => {
if (params.multBrandShopType === '2') {
// 转义店铺
finalResult.shop_id = params.shop_id;
finalResult.shop_id = shopId;
} else {
finalResult.brand = result[1];
}
... ...

38.5 KB | W: | H:

29.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -186,7 +186,7 @@ function getParam(req) {
function newData(callback) {
var req = {};
req.url = location.protocol + '//m.yohobuy.com/index/search/search';
req.url = location.protocol + '//m.yohobuy.com/product/search/search';
req.data = {
type: 'new',
order: '1',
... ... @@ -199,7 +199,7 @@ function newData(callback) {
req.callBack = function(data) {
$('#new-arrival').append(data);
navInfo.new.page++;
myScroll.refresh();
myScroll && myScroll.refresh();
lazyLoad($('#new-arrival .lazy'));
scH = $('#scroller').outerHeight();
searching = false;
... ... @@ -211,7 +211,7 @@ function newData(callback) {
function hotData(callback) {
var req = {};
req.url = location.protocol + '//m.yohobuy.com/index/search/search';
req.url = location.protocol + '//m.yohobuy.com/product/search/search';
req.data = {
type: 'hot',
order: '1',
... ... @@ -224,8 +224,7 @@ function hotData(callback) {
req.callBack = function(data) {
$('#popularity').append(data);
navInfo.hot.page++;
// myScroll.refresh();
myScroll && myScroll.refresh();
lazyLoad($('#popularity .lazy'));
scH = $('#scroller').outerHeight();
searching = false;
... ... @@ -271,8 +270,7 @@ function tabChange(dom, index) {
$nav1.removeClass('fixed-top absolute');
$nav2.removeClass('fixed-top absolute');
}
// myScroll && myScroll.refresh();
myScroll && myScroll.refresh();
scH = $('#scroller').outerHeight();
if (!$nav1.hasClass('hide')) {
myScroll && myScroll.scrollTo(0, 0 - imgH);
... ... @@ -339,7 +337,7 @@ function scrollHandler() {
type: 'shop_id',
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
url: location.protocol + '//m.yohobuy.com/product/search/search',
nextPage: true
});
}
... ... @@ -434,6 +432,8 @@ function scrollHandler() {
});
}
}
$('#scroller').trigger('scroll');
}
document.addEventListener('touchmove', function(e) {
... ... @@ -454,9 +454,9 @@ $(window).ready(function() {
imgH = $('#nav-top').outerHeight();
nav1H = $('#nav').outerHeight();
main1H = $('#nav-main').height();
main1oH = $('#nav-main').outerHeight();
nav2H = $('#list-nav').outerHeight();
main2oH = $('#goods-container').outerHeight();
main1oH = $('#nav-main').outerHeight(true);
nav2H = $('#list-nav').outerHeight(true);
main2oH = $('#goods-container').outerHeight(true);
myScroll = new IScroll('#wrapper', {
... ... @@ -487,7 +487,7 @@ $(window).ready(function() {
multiSwiper && multiSwiper.startAutoplay();
$('#scroller').trigger('scroll');
//$('#scroller').trigger('scroll');
scrollHandler.bind(this)();
});
lazyLoad($('img.lazy'));
... ... @@ -509,7 +509,7 @@ function search(opt) {
}
if (!opt.url) {
opt.url = location.protocol + '//m.yohobuy.com/index/search/search';
opt.url = location.protocol + '//m.yohobuy.com/product/search/search';
}
$pre = $listNav.find('.active').eq(0);
... ... @@ -707,10 +707,11 @@ $subNav.on('touchend touchcancel', function(e) {
// 筛选面板切换状态
if ($this.hasClass('active')) {
$this.removeClass('active');
filter.hideFilter();
myScroll && myScroll.enable();
} else {
$this.addClass('active');
myScroll && myScroll.scrollTo(0, -(imgH + main1oH + nav1H));
theY = imgH + main1oH + nav1H;
... ... @@ -728,6 +729,9 @@ $subNav.on('touchend touchcancel', function(e) {
myScroll && myScroll.disable();
}
} else {
filter.hideFilter();//隐藏面板
if ($this.hasClass('new')) {
cname = '.new';
navType = 'newest';
... ... @@ -818,7 +822,7 @@ $subNav.on('touchend touchcancel', function(e) {
type: 'shop_id',
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
url: location.protocol + '//m.yohobuy.com/product/search/search',
nextPage: false
});
}
... ... @@ -876,7 +880,7 @@ function stopPropagation(e) {
}
}
$(document).bind('touchstart', function(e) {
$(document).bind('touchstart', function() {
$('.sub-group').addClass('hide');
});
... ... @@ -933,7 +937,7 @@ $collect.on('touchstart', function() {
}
setTimeout(function() {
// myScroll.refresh();
myScroll && myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 500);
searching = false;
... ...
.hot-category {
margin: 30px 0 0;
border-bottom: 1px solid #e0e0e0;
.category-banner {
height: 198px;
img {
display: block;
width: 100%;
height: 198px;
}
}
.category-list {
background: #fff;
li {
float: left;
width: 158px;
height: 158px;
border-top: 1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
overflow: hidden;
position: relative;
.img-box {
width: 100%;
height: 100%;
line-height: 154px;
text-align: center;
overflow: hidden;
font-size: 0;
position: relative;
img {
vertical-align: middle;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
}
}
.category-title {
line-height: 22px;
color: #aaa;
font-size: 18px;
text-align: center;
}
.img-cover {
position: absolute;
height: 42px;
line-height: 42px;
text-align: center;
width: 100%;
bottom: 0;
color: #000;
font-size: 22px;
}
}
}
}
... ...
... ... @@ -6,6 +6,10 @@
right: 0;
overflow: hidden;
.nav-main {
margin-bottom: 30px;
}
.branner-top {
width: 100%;
height: 200px;
... ... @@ -76,33 +80,33 @@
background: #fff;
overflow: hidden;
border-sizing: border-box;
border-bottom: 1px solid #e1e1e1;
li {
color: #b1b1b1;
border-bottom: 1px solid #e0e0e0;
z-index: 2;
li{
display: block;
height: 28px;
float: left;
line-height: 28px;
width: 24.7%;
text-align: center;
border-left: 1px solid #e1e1e1;
border-left: 1px solid #e0e0e0;
margin-top: 30px;
border-sizing: border-box;
color: #b1b1b1;
color: #b0b0b0;
&:first-child {
border-left: none;
}
a {
color: #b1b1b1;
color: #b0b0b0;
}
}
.color {
color: #000;
}
color: #444;
}
}
.main {
... ... @@ -116,10 +120,6 @@
margin-bottom: 30px;
}
.hide {
display: hidden;
}
.coupon {
width: 100%;
padding: 30px 0;
... ... @@ -138,7 +138,7 @@
width: 100%;
height: 270px;
background: #fff;
border: 1px solid #e1e1e1;
border: 1px solid #e0e0e0;
border-top: none;
font-size: 20px;
text-align: center;
... ... @@ -157,15 +157,15 @@
.brand-img {
margin-left: 30px;
width: 30%;
width: 140px;
height: 150px;
overflow: hidden;
padding-bottom: 20px;
float: left;
p {
font-size: 25px;
color: #b1b1b1;
font-size: 18px;
color: #b0b0b0;
padding-top: 10px;
height: 30px;
white-space: nowrap;
... ... @@ -174,40 +174,52 @@
}
img {
height: 70%;
height: 120px;
}
}
.spring {
margin: 0;
margin: 0 15px;
overflow: hidden;
li {
width: 50%;
height: 168px;
height: 160px;
float: left;
text-align: center;
list-style: none;
display: list-item;
img {
width: 90%;
width: 275px;
height: inherit;
border-radius: 10px;
vertical-align: top;
}
}
}
.popularity-title {
.hot-category .floor-header {
margin: 0;
}
.popularity-title, .hot-category .floor-header {
background: #fff;
border-bottom: 1px solid #e8e8e8;
border-bottom: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
color: #444;
text-align: center;
line-height: 98px;
font-size: 32px;
margin-top: 40px;
height: 100px;
line-height: 100px;
font-size: 30px;
margin-top: 30px;
position: relative;
}
.hot-category .floor-header {
border-bottom: none;
}
.more {
position: absolute;
right: 30px;
... ... @@ -272,7 +284,7 @@
.icon {
position: relative;
color: #b1b1b1;
color: #b0b0b0;
i {
position: absolute;
... ... @@ -319,7 +331,7 @@
.discount:after {
height: 28px;
content: '';
border-left: 1px solid #e1e1e1;
border-left: 1px solid #e0e0e0;
position: absolute;
top: 25px;
left: 163px;
... ... @@ -329,11 +341,16 @@
.discount-area {
@extend .sale-page;
#list-nav {
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}
.list-nav li {
display: block;
height: 78px;
height: 80px;
float: left;
line-height: 78px;
line-height: 80px;
width: 24.8%;
text-align: center;
border-sizing: border-box;
... ... @@ -349,7 +366,7 @@
&.discount:after {
height: 28px;
content: '';
border-left: 1px solid #e1e1e1;
border-left: 1px solid #e0e0e0;
position: absolute;
top: 25px;
left: 163px;
... ... @@ -358,8 +375,8 @@
.active {
.cur {
color: #000;
}
color: #444;
}
}
.list-nav .icon .up {
... ... @@ -393,7 +410,7 @@
line-height: 88px;
font-size: 28px;
background: #fff;
border-top: 1px solid #eaeaea;
border-top: 1px solid #e0e0e0;
z-index: 2;
... ... @@ -410,7 +427,7 @@
height: 28px;
margin-top: 30px;
float: right;
border-right: 1px solid #eaeaea;
border-right: 1px solid #e0e0e0;
display: inline-block;
}
}
... ... @@ -418,24 +435,28 @@
.sub-group {
position: absolute;
background: #fff;
border: 1px solid #eaeaea;
border: 1px solid #e0e0e0;
border-radius: 12px;
bottom: 104px;
width: 40%;
margin-left: 5%;
dl {
width: 80%;
padding: 0 30px;
margin: 0 auto;
}
dd {
line-height: 80px;
text-align: center;
border-top: 1px solid #eaeaea;
border-top: 1px solid #e0e0e0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a {
color: #444;
}
}
dd:first-child {
... ... @@ -446,8 +467,8 @@
.sharp {
position: absolute;
width: 100%;
height: 14px;
background: resolve("product/sharp.png") no-repeat center center;
height: 10px;
background: resolve('product/sharp.png') no-repeat center center;
}
.foot-list-3 .sub-group {
... ... @@ -501,11 +522,11 @@
text-align: center;
width: 100%;
height: 100%;
color: #999;
color: #b0b0b0;
/*b {
height: 28px;
border-left: 1px solid #e1e1e1;
border-left: 1px solid #e0e0e0;
float: right;
margin-top: 25px;
}*/
... ... @@ -513,11 +534,11 @@
}
.active .cur {
color: #000;
color: #444;
}
.active a {
color: #000;
color: #444;
}
... ... @@ -551,7 +572,6 @@
.category-list-top-board {
border-top: 1px solid #e0e0e0;
min-height: 160px;
}
.category-list-last-li {
... ... @@ -564,6 +584,8 @@
}
.shop-index + .filter-mask {
margin-top: 1px;
.filter-body {
overflow: auto;
}
... ...
... ... @@ -10,5 +10,7 @@
@import "layout/utils";
/* page */
@import "channel/index";
@import "common/index";
@import "product/index";
@import "home/hot-category";
... ...