Authored by 王水玲

单品日

... ... @@ -3,6 +3,7 @@
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/10/17
*/
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
tip = require('../plugin/tip'),
... ... @@ -12,7 +13,6 @@ var $ = require('yoho-jquery'),
tab = require('../../template/activity/single-day/tab.hbs'),
product = require('../../template/activity/single-day/product-list.hbs');
var hash = window.location.hash.replace('#', '');
var $productList = $('.product-list');
var getFlag = false;
... ... @@ -55,6 +55,7 @@ var getInitData = function() {
url: '/activity/single-day/getSingleData',
success: function(data) {
var i = 0, $swiperTab, $productTab;
var tabNum = window.queryString.tabNum - 1;
// data[1] = ['限定名额', '首发', '热卖', '明星单品'];
if (data[0]) {
... ... @@ -89,8 +90,8 @@ var getInitData = function() {
$productTab = $('.product-tab');
getProductData(hash, tabName(hash));
$swiperTab.eq(hash).addClass('active');
getProductData(tabNum, tabName(tabNum));
$swiperTab.eq(tabNum).addClass('active');
$swiperTab.on('click', function() {
var index = $(this).index();
... ... @@ -113,6 +114,8 @@ var getInitData = function() {
});
};
require('../common');
$(function() {
loading.showLoadingMask();
getInitData();
... ...