Authored by 王水玲

单品日

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 * @author: wsl<shuiling.wang@yoho.cn> 3 * @author: wsl<shuiling.wang@yoho.cn>
4 * @date: 2016/10/17 4 * @date: 2016/10/17
5 */ 5 */
  6 +
6 var $ = require('yoho-jquery'), 7 var $ = require('yoho-jquery'),
7 Swiper = require('yoho-swiper'), 8 Swiper = require('yoho-swiper'),
8 tip = require('../plugin/tip'), 9 tip = require('../plugin/tip'),
@@ -12,7 +13,6 @@ var $ = require('yoho-jquery'), @@ -12,7 +13,6 @@ var $ = require('yoho-jquery'),
12 tab = require('../../template/activity/single-day/tab.hbs'), 13 tab = require('../../template/activity/single-day/tab.hbs'),
13 product = require('../../template/activity/single-day/product-list.hbs'); 14 product = require('../../template/activity/single-day/product-list.hbs');
14 15
15 -var hash = window.location.hash.replace('#', '');  
16 var $productList = $('.product-list'); 16 var $productList = $('.product-list');
17 var getFlag = false; 17 var getFlag = false;
18 18
@@ -55,6 +55,7 @@ var getInitData = function() { @@ -55,6 +55,7 @@ var getInitData = function() {
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, $productTab; 57 var i = 0, $swiperTab, $productTab;
  58 + var tabNum = window.queryString.tabNum - 1;
58 59
59 // data[1] = ['限定名额', '首发', '热卖', '明星单品']; 60 // data[1] = ['限定名额', '首发', '热卖', '明星单品'];
60 if (data[0]) { 61 if (data[0]) {
@@ -89,8 +90,8 @@ var getInitData = function() { @@ -89,8 +90,8 @@ var getInitData = function() {
89 90
90 $productTab = $('.product-tab'); 91 $productTab = $('.product-tab');
91 92
92 - getProductData(hash, tabName(hash));  
93 - $swiperTab.eq(hash).addClass('active'); 93 + getProductData(tabNum, tabName(tabNum));
  94 + $swiperTab.eq(tabNum).addClass('active');
94 95
95 $swiperTab.on('click', function() { 96 $swiperTab.on('click', function() {
96 var index = $(this).index(); 97 var index = $(this).index();
@@ -113,6 +114,8 @@ var getInitData = function() { @@ -113,6 +114,8 @@ var getInitData = function() {
113 }); 114 });
114 }; 115 };
115 116
  117 +require('../common');
  118 +
116 $(function() { 119 $(function() {
117 loading.showLoadingMask(); 120 loading.showLoadingMask();
118 getInitData(); 121 getInitData();