Authored by zhangxiaoru

shop

@@ -41,7 +41,7 @@ const shopIndex = (req, res) => { @@ -41,7 +41,7 @@ const shopIndex = (req, res) => {
41 const shopNav = (req, res, next) => { 41 const shopNav = (req, res, next) => {
42 42
43 shopModel.shopNav().then((result) => { 43 shopModel.shopNav().then((result) => {
44 - console.log(result) 44 + console.log(result);
45 res.json(result); 45 res.json(result);
46 }).catch(next); 46 }).catch(next);
47 }; 47 };
@@ -46,11 +46,11 @@ const shopNav = () => { @@ -46,11 +46,11 @@ const shopNav = () => {
46 code: 200 46 code: 200
47 }).then((result) => { 47 }).then((result) => {
48 if (result.data) { 48 if (result.data) {
49 - if(result.data.length === 1 && result.data[0] === 'NULL') { 49 + if (result.data.length === 1 && result.data[0] === 'NULL') {
50 return false; 50 return false;
51 } else { 51 } else {
52 return result.data; 52 return result.data;
53 - } 53 + }
54 } 54 }
55 }); 55 });
56 }; 56 };
@@ -178,7 +178,7 @@ function shopNavData() { @@ -178,7 +178,7 @@ function shopNavData() {
178 navList: data 178 navList: data
179 }); 179 });
180 180
181 - if(data === false) { 181 + if (data === false) {
182 shopListData('null'); 182 shopListData('null');
183 $('.shop-nav').hide(); 183 $('.shop-nav').hide();
184 return; 184 return;
@@ -206,7 +206,8 @@ function shopNavData() { @@ -206,7 +206,8 @@ function shopNavData() {
206 shopListData($('.shop-nav').find('li').eq(0).data('type')); 206 shopListData($('.shop-nav').find('li').eq(0).data('type'));
207 } 207 }
208 208
209 - console.log($('.shop-nav').length) 209 + console.log($('.shop-nav').length);
  210 +
210 // 导航点击事件 211 // 导航点击事件
211 $('.shop-nav').find('li').on('click', function() { 212 $('.shop-nav').find('li').on('click', function() {
212 var $this = $(this), 213 var $this = $(this),
@@ -225,7 +226,8 @@ function shopNavData() { @@ -225,7 +226,8 @@ function shopNavData() {
225 226
226 }, 227 },
227 error: function() { 228 error: function() {
228 - console.log('123') 229 + console.log('123');
  230 +
229 // tip.show('网络断开连接了~'); 231 // tip.show('网络断开连接了~');
230 $('.shop-nav').hide(); 232 $('.shop-nav').hide();
231 $('.shop-list').hide(); 233 $('.shop-list').hide();