Authored by 王水玲

单品日

@@ -16,18 +16,20 @@ module.exports = { @@ -16,18 +16,20 @@ module.exports = {
16 siteUrl: '//m.yohobuy.com', 16 siteUrl: '//m.yohobuy.com',
17 assetUrl: '//localhost:5001', 17 assetUrl: '//localhost:5001',
18 domains: { 18 domains: {
19 - //api: 'http://api.yoho.yohoops.org/', 19 + // api: 'http://api.yoho.yohoops.org/',
20 // service: 'http://service.yoho.yohoops.org/', 20 // service: 'http://service.yoho.yohoops.org/',
21 // liveApi: 'http://api.live.yoho.cn/', 21 // liveApi: 'http://api.live.yoho.cn/',
22 // singleApi: 'http://single.yoho.cn/' 22 // singleApi: 'http://single.yoho.cn/'
23 23
24 - //api: 'http://api-test1.yohops.com:9999/', 24 + // api: 'http://api-test1.yohops.com:9999/',
25 service: 'http://service-test1.yohops.com:9999/', 25 service: 'http://service-test1.yohops.com:9999/',
26 - //liveApi: 'http://testapi.live.yohops.com:9999/',  
27 - //singleApi: 'http://api-test1.yohops.com:9999/' 26 +
  27 + // liveApi: 'http://testapi.live.yohops.com:9999/',
  28 + // singleApi: 'http://api-test1.yohops.com:9999/'
28 29
29 api: 'http://dev-api.yohops.com:9999/', 30 api: 'http://dev-api.yohops.com:9999/',
30 - //service: 'http://dev-service.yohops.com:9999/', 31 +
  32 + // service: 'http://dev-service.yohops.com:9999/',
31 liveApi: 'http://testapi.live.yohops.com:9999/', 33 liveApi: 'http://testapi.live.yohops.com:9999/',
32 singleApi: 'http://api-test1.yohops.com:9999/' 34 singleApi: 'http://api-test1.yohops.com:9999/'
33 35
@@ -54,9 +54,9 @@ var getInitData = function() { @@ -54,9 +54,9 @@ var getInitData = function() {
54 type: 'GET', 54 type: 'GET',
55 url: '/activity/single-day/getSingleData', 55 url: '/activity/single-day/getSingleData',
56 success: function(data) { 56 success: function(data) {
57 - var i = 0, $swiperTab; 57 + var i = 0, $swiperTab, $productTab;
58 58
59 - //data[1] = ['限定名额', '首发', '热卖', '明星单品']; 59 + // data[1] = ['限定名额', '首发', '热卖', '明星单品'];
60 if (data[0]) { 60 if (data[0]) {
61 $('.banner').append(banner(data[0][0])); 61 $('.banner').append(banner(data[0][0]));
62 62
@@ -87,6 +87,8 @@ var getInitData = function() { @@ -87,6 +87,8 @@ var getInitData = function() {
87 $productList.append('<ul class="product-tab"></ul>'); 87 $productList.append('<ul class="product-tab"></ul>');
88 } 88 }
89 89
  90 + $productTab = $('.product-tab');
  91 +
90 getProductData(hash, tabName(hash)); 92 getProductData(hash, tabName(hash));
91 $swiperTab.eq(hash).addClass('active'); 93 $swiperTab.eq(hash).addClass('active');
92 94
@@ -95,8 +97,8 @@ var getInitData = function() { @@ -95,8 +97,8 @@ var getInitData = function() {
95 97
96 $swiperTab.removeClass('active').eq(index).addClass('active'); 98 $swiperTab.removeClass('active').eq(index).addClass('active');
97 99
98 - if ($('.product-tab').eq(index).find('li').length > 0) {  
99 - return false; 100 + if ($productTab.eq(index).find('li').length > 0) {
  101 + $productTab.hide().eq(index).show();
100 } else { 102 } else {
101 getProductData(index, tabName(index)); 103 getProductData(index, tabName(index));
102 } 104 }