Authored by zhangxiaoru

shop

... ... @@ -41,7 +41,7 @@ const shopIndex = (req, res) => {
const shopNav = (req, res, next) => {
shopModel.shopNav().then((result) => {
console.log(result)
console.log(result);
res.json(result);
}).catch(next);
};
... ...
... ... @@ -46,11 +46,11 @@ const shopNav = () => {
code: 200
}).then((result) => {
if (result.data) {
if(result.data.length === 1 && result.data[0] === 'NULL') {
if (result.data.length === 1 && result.data[0] === 'NULL') {
return false;
} else {
return result.data;
}
}
}
});
};
... ...
... ... @@ -178,7 +178,7 @@ function shopNavData() {
navList: data
});
if(data === false) {
if (data === false) {
shopListData('null');
$('.shop-nav').hide();
return;
... ... @@ -206,7 +206,8 @@ function shopNavData() {
shopListData($('.shop-nav').find('li').eq(0).data('type'));
}
console.log($('.shop-nav').length)
console.log($('.shop-nav').length);
// 导航点击事件
$('.shop-nav').find('li').on('click', function() {
var $this = $(this),
... ... @@ -225,7 +226,8 @@ function shopNavData() {
},
error: function() {
console.log('123')
console.log('123');
// tip.show('网络断开连接了~');
$('.shop-nav').hide();
$('.shop-list').hide();
... ...