Authored by zhangxiaoru

shop

... ... @@ -30,6 +30,7 @@ const shopIndex = (req, res) => {
page: 'shop-collect',
wechatShare: true,
title: '店铺收藏',
width750: true,
shopCollect: {
bannerTop: result
}
... ... @@ -40,6 +41,7 @@ const shopIndex = (req, res) => {
const shopNav = (req, res, next) => {
shopModel.shopNav().then((result) => {
console.log(result)
res.json(result);
}).catch(next);
};
... ...
... ... @@ -46,7 +46,11 @@ const shopNav = () => {
code: 200
}).then((result) => {
if (result.data) {
return result.data;
if(result.data.length === 1 && result.data[0] === 'NULL') {
return false;
} else {
return result.data;
}
}
});
};
... ...
... ... @@ -8,7 +8,7 @@
</div>
<div class="shop-tile">
<img class="lazy" data-original="{{image logoUrl 110 70}}"></img>
<img class="lazy" data-original="{{image logoUrl 110 65}}"></img>
<p>
<span class="shop-name">{{shopName}}</span><br>
<span class="giving">{{words}}</span>
... ...
<ul class="swiper-wrapper clearfix">
{{# navList}}
{{#if navList}}
<li class="swiper-slide" data-type={{.}}>{{.}}</li>
{{/ navList}}
{{/ if}}
</ul>
\ No newline at end of file
... ...
... ... @@ -178,6 +178,12 @@ function shopNavData() {
navList: data
});
if(data === false) {
shopListData('null');
$('.shop-nav').hide();
return;
}
$('.shop-nav').html(navString);
// 导航滑动效果
... ... @@ -200,6 +206,7 @@ function shopNavData() {
shopListData($('.shop-nav').find('li').eq(0).data('type'));
}
console.log($('.shop-nav').length)
// 导航点击事件
$('.shop-nav').find('li').on('click', function() {
var $this = $(this),
... ... @@ -218,6 +225,7 @@ function shopNavData() {
},
error: function() {
console.log('123')
// tip.show('网络断开连接了~');
$('.shop-nav').hide();
$('.shop-list').hide();
... ...
.shop-collect {
background: #f0f0f0;
.nav {
height: 90px;
background: #fff;
... ... @@ -6,6 +8,7 @@
overflow: hidden;
background: #fff;
border-bottom: 1px solid #e0e0e0;
margin-bottom: 30px;
li {
float: left;
... ... @@ -31,8 +34,7 @@
.shop-list {
width: 100%;
background: #f0f0f0;
padding-top: 30px;
/* padding-top: 30px;*/
.shop-info {
background: #fff;
... ...