Authored by 陈峰

js语法错误

... ... @@ -2,9 +2,9 @@
'use strict';
require('plugin/modal.alert');
require('../common');
var yoho = require('js/yoho-app');
var tip = require('plugin/tip');
var Game = require('./vip-day/game');
let yoho = require('js/yoho-app');
let tip = require('plugin/tip');
let Game = require('./vip-day/game');
window.$ = $;
... ... @@ -23,7 +23,7 @@ function getAwards($container) {
return tip.show('获取失败,稍后再试..');
}
var $frag = $(document.createDocumentFragment());
let $frag = $(document.createDocumentFragment());
if (!res.data) {
$frag.append('<li><div class="text-center">快试试手气吧~</div></li>');
... ... @@ -49,12 +49,12 @@ function getAwards($container) {
$(function() {
var gCoin = window.coin;
var $coin = $('#my-coin');
var $awardsModal = $('#js-awards');
var $playerNum = $('#player-num');
var $awardsList = $awardsModal.find('.ymodal-body');
var game = new Game('#js-stage', {
let gCoin = window.coin;
let $coin = $('#my-coin');
let $awardsModal = $('#js-awards');
let $playerNum = $('#player-num');
let $awardsList = $awardsModal.find('.ymodal-body');
let game = new Game('#js-stage', {
url: '/activity/vip-day/crazy-luck/award.json?app_version=1&uid=' + yoho.getUid(),
prize_type: 1,
awards: [20, 2000, 100, 50, 200, 5000, 0, 10000],
... ... @@ -71,7 +71,7 @@ $(function() {
}
setInterval(function() {
var up = Math.floor(Math.random() * 5);
let up = Math.floor(Math.random() * 5);
upPlayers(up);
}, 5000);
... ... @@ -83,7 +83,8 @@ $(function() {
};
game.onsuccess = function(score, coin) {
var content = score === 0 ? '很遗憾您没有中奖,继续加油哦~' : '<p class="primary">恭喜你获得<span class="award">' + score + '</span>个有货币,请到【我的奖品】中查收</p>';
let content = score === 0 ? '很遗憾您没有中奖,继续加油哦~' :
'<p class="primary">恭喜你获得<span class="award">' + score + '</span>个有货币,请到【我的奖品】中查收</p>';
$.yAlert({
class: 'vipday-game-alert',
... ...
... ... @@ -2,9 +2,9 @@
'use strict';
require('plugin/modal.alert');
require('../common');
var yoho = require('js/yoho-app');
var tip = require('plugin/tip');
var Game = require('./vip-day/game');
let yoho = require('js/yoho-app');
let tip = require('plugin/tip');
let Game = require('./vip-day/game');
window.$ = $;
... ... @@ -23,7 +23,7 @@ function getAwards($container) {
return tip.show('获取失败,稍后再试..');
}
var $frag = $(document.createDocumentFragment());
let $frag = $(document.createDocumentFragment());
if (!res.data) {
$frag.append('<li><div class="text-center">快试试手气吧~</div></li>');
... ... @@ -49,12 +49,12 @@ function getAwards($container) {
$(function() {
var gCoin = window.coin;
var $coin = $('#my-coin');
var $awardsModal = $('#js-awards');
var $playerNum = $('#player-num');
var $awardsList = $awardsModal.find('.ymodal-body');
var game = new Game('#js-stage', {
let gCoin = window.coin;
let $coin = $('#my-coin');
let $awardsModal = $('#js-awards');
let $playerNum = $('#player-num');
let $awardsList = $awardsModal.find('.ymodal-body');
let game = new Game('#js-stage', {
url: '/activity/vip-day10/crazy-luck/award.json?app_version=1&uid=' + yoho.getUid(),
prize_type: 1,
awards: [20, 2000, 100, 50, 200, 5000, 0, 10000],
... ... @@ -71,7 +71,7 @@ $(function() {
}
setInterval(function() {
var up = Math.floor(Math.random() * 5);
let up = Math.floor(Math.random() * 5);
upPlayers(up);
}, 5000);
... ... @@ -83,7 +83,8 @@ $(function() {
};
game.onsuccess = function(score, coin) {
var content = score === 0 ? '很遗憾您没有中奖,继续加油哦~' : '<p class="primary">恭喜你获得<span class="award">' + score + '</span>个有货币,请到【我的奖品】中查收</p>';
let content = score === 0 ? '很遗憾您没有中奖,继续加油哦~' :
'<p class="primary">恭喜你获得<span class="award">' + score + '</span>个有货币,请到【我的奖品】中查收</p>';
$.yAlert({
class: 'vipday-game-alert',
... ...
... ... @@ -12,13 +12,13 @@
// 异步渲染的模板统一插入 #chose-panel ,兼容页面多个选择框
var $ = require('yoho-jquery'),
let $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading');
var innerScroll = require('../plugin/inner-scroll');
let innerScroll = require('../plugin/inner-scroll');
var $chosePanel = $('#chose-panel'),
let $chosePanel = $('#chose-panel'),
$num,
$chosed,
$imgsThumb,
... ... @@ -49,27 +49,27 @@ var $chosePanel = $('#chose-panel'),
$buyNowForm = $('#buyNowForm');
// 购物车编辑标相关变量
var isEdit,
let isEdit,
isSelected,
oldSknId,
isGift;
// 限购商品的商品码。只有限购商品时才会设置。
var limitProductCode,
let limitProductCode,
// 限购商品的skn。只有限购商品时才会设置。
skn;
// 套餐模式
var budnleMode;
let budnleMode;
// 量贩商品
var discountNum = $('#mnum').val() - 0,
let discountNum = $('#mnum').val() - 0,
discountLimit = false;
var C_ID;
let C_ID;
var $sizeInfo,
let $sizeInfo,
$thumbImg;
require('../common');
... ... @@ -78,7 +78,7 @@ C_ID = window._ChannelVary[window.cookie('_Channel')];
// 禁用数字编辑
function disableNumEdit() {
var $numBtn = $('.chose-panel').find('.num .btn>.iconfont');
let $numBtn = $('.chose-panel').find('.num .btn>.iconfont');
// 添加disabled样式
$numBtn.hasClass('disabled') ? null : $numBtn.addClass('disabled');
... ... @@ -160,7 +160,7 @@ function setBundleModeWithSknId(sknId) {
// 删除面板
function removePannel() {
var $pannel = $('.chose-panel'),
let $pannel = $('.chose-panel'),
$promotionId = $('#promotionId');
if ($pannel) {
... ... @@ -244,8 +244,8 @@ function hide() {
// 修改加入购物车的文字和背景
var isSeckill = $('.limit-num-text').length;
var isSecKills = 0;
let isSeckill = $('.limit-num-text').length;
let isSecKills = 0;
function updateConformButtonClassAndText() {
if (isSeckill > 0) {
... ... @@ -303,7 +303,7 @@ function displayGoodNum(curGoodNum) {
// 老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(newSizeIndex) {
var sizes,
let sizes,
sizeBlock,
i;
... ... @@ -350,7 +350,7 @@ function changeColorChosed(newColorIndex) {
// 添加门票
function addTickets(productSku, buyNumber) {
var data = {
let data = {
productSku: productSku,
buyNumber: buyNumber
};
... ... @@ -383,7 +383,7 @@ function addTickets(productSku, buyNumber) {
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
var $cur = $(e.target);
let $cur = $(e.target);
if ($cur.closest('.main').length > 0) {
return;
... ... @@ -396,7 +396,7 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
});
function chosedLength() {
var $chosedL = $('.block-list li.chosed'),
let $chosedL = $('.block-list li.chosed'),
infoHtml,
choosedInfo = $('.choosed-info'),
notChoose = $('.not-choose'),
... ... @@ -409,7 +409,7 @@ function chosedLength() {
notChoose.addClass('hide');
}
for (var i = 0; i < chosedStr.length; i++) {
for (let i = 0; i < chosedStr.length; i++) {
if (chosedStr.charCodeAt(i) > 255) {
strlen += 2;
} else {
... ... @@ -436,7 +436,7 @@ function chosedLength() {
}
$yohoPage.on('touchstart', '.color-list .block', function() {
var $this = $(this),
let $this = $(this),
index = $this.index(),
curGoodNum;
... ... @@ -526,7 +526,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
chosedLength();
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
let $this = $(this),
index,
curGoodNum;
... ... @@ -600,7 +600,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
});
$yohoPage.on('touchstart', '.btn-minus', function() {
var num = parseInt($num.val(), 10);
let num = parseInt($num.val(), 10);
leftNum = $('#left-num').val();
... ... @@ -629,7 +629,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
$num.val(num - 1);
}).on('touchstart', '.btn-plus', function() {
var num = parseInt($num.val(), 10),
let num = parseInt($num.val(), 10),
maxTips = ticketsLimit ? '每人只可购买' + ticketsLimit + '张当日门票' : '您选择的数量超过了最大库存量~';
leftNum = ticketsLimit || $('#left-num').val();
... ... @@ -654,7 +654,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
$num.val(num + 1);
}).on('touchstart', '#chose-btn-sure', function() {
var productSku,
let productSku,
productSkn,
buyNumber = $('#good-num').val() - 0,
promotionId,
... ... @@ -814,7 +814,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
url: url,
data: cartGoodData
}).done(function(res) {
var cartNum;
let cartNum;
loading.hideLoadingMask();
if (res.code === 200 && !isEdit) {
... ... @@ -856,8 +856,8 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
} else {
var thisSkn = $('#productSkn').val();
var thisSku = '';
let thisSkn = $('#productSkn').val();
let thisSku = '';
thisSku = $('.size-list').find('.chosed').attr('data-skuid');
window.location.href = '/cart/index/seckill?skn=' + thisSkn + '&sku=' + thisSku;
... ...
... ... @@ -41,7 +41,9 @@ let indexObj = {
let localUrl = window.location.href.replace(/\/?\?.*$/, '').replace(/https?:\/\//, '');
let referrerPath = referrer.replace(/\/?\?.*$/, '').replace(/https?:\/\//, '');
if (referrer && localUrl !== referrerPath && referrer.indexOf('orderEnsure') === -1 && referrer.indexOf('/gift') === -1 && referrer.indexOf('/advanceBuy') === -1 && referrer.indexOf('/product/index/index?promotion_id=') === -1) {
if (referrer && localUrl !== referrerPath &&
referrer.indexOf('orderEnsure') === -1 && referrer.indexOf('/gift') === -1 &&
referrer.indexOf('/advanceBuy') === -1 && referrer.indexOf('/product/index/index?promotion_id=') === -1) {
cookie.set('_cartReferrer', referrer);
}
},
... ...
... ... @@ -64,7 +64,8 @@ let cartObj = {
promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
if (status === 20 || status === 0 || (promotionType !== 'Gift' && promotionType !== 'Needpaygift')) {
window.location.href = `/product/index/index?promotion_id=${promotionId}&title=优惠活动商品&intro_text=${promotionTitle}`;
window.location.href =
`/product/index/index?promotion_id=${promotionId}&title=优惠活动商品&intro_text=${promotionTitle}`;
} else {
self.toPromotionPage(promotionId, promotionType, status);
}
... ...
... ... @@ -291,7 +291,7 @@ let goodObj = {
let goodInfo = {};
goodInfo.goods_type = $('#cartType').val();
if (selectAll !== undefined) {
if (typeof selectAll !== 'undefined') {
goodInfo.selected = selectAll ? 'Y' : 'N';
} else {
goodInfo.selected = $this.hasClass('checked') ? 'N' : 'Y';
... ... @@ -434,7 +434,7 @@ let goodObj = {
}
});
},
openChosepanel(e, isGift) {
openChosepanel(e) {
let self = this;
let skn = $(e.delegateTarget).data('skn');
let id,
... ... @@ -450,7 +450,8 @@ let goodObj = {
promotionId = $(e.delegateTarget).data('promotion');
// 加价购或者赠品不能编辑数量
canEditNum = $(e.delegateTarget).find('.flag.gift').length || $(e.delegateTarget).find('.flag.price-gift').length ? false : true;
canEditNum = $(e.delegateTarget).find('.flag.gift').length ||
$(e.delegateTarget).find('.flag.price-gift').length ? false : true;
e.stopPropagation();
loading.showLoading();
$.ajax({
... ... @@ -458,7 +459,7 @@ let goodObj = {
data: {
skn: skn,
buy_num: count,
mnum: minNum > 1 ? minNum : undefined,
mnum: minNum > 1 ? minNum : void 0,
promotion_id: promotionId
},
type: 'POST',
... ...
... ... @@ -192,7 +192,7 @@ function orderCompute() {
paymentType: orderInfo('paymentType'),
couponCode: orderInfo('couponCode'),
yohoCoin: yohoCoin,
skuList: isLimitGood() ? orderInfo('skuList') : undefined
skuList: isLimitGood() ? orderInfo('skuList') : void 0
};
// 门票
... ... @@ -214,7 +214,7 @@ function orderCompute() {
if ($.type(res) !== 'object') {
window.location.reload();
} else {
if (typeof res.last_order_amount !== undefined) {
if (typeof res.last_order_amount !== 'undefined') {
res.last_order_amount = (+res.last_order_amount).toFixed(2);
}
... ... @@ -291,7 +291,7 @@ function submitOrder() {
paymentType: orderInfo('paymentType'), // 支付方式
couponCode: orderInfo('couponCode'),
yohoCoin: orderInfo('yohoCoin'),
skuList: isLimitGood() ? orderInfo('skuList') : undefined
skuList: isLimitGood() ? orderInfo('skuList') : void 0
}
}).then(function(res) {
var url;
... ...
... ... @@ -4,10 +4,10 @@
* @date: 2015/12/14
*/
require('../common');
var info = window.cookie('order-info');
let info = window.cookie('order-info');
// cookie 参数
var actCkOpthn = {
let actCkOpthn = {
path: '/cart/index'
};
... ... @@ -47,7 +47,7 @@ try {
exports.init = init;
exports.orderInfo = function(key, value) {
if (value === undefined) {
if (typeof value === 'undefined') {
return info[key];
}
info[key] = value;
... ...
var $ = require('yoho-jquery'),
let $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var prompt = $('.fraud-prompt'),
let prompt = $('.fraud-prompt'),
tipContent = $('.tip-content'),
tipEle = $('.tip'),
fraudTip = $('.fraud-tip');
var tipConWidth = tipContent.width(),
let tipConWidth = tipContent.width(),
tipWidth = tipEle.width(),
promptWidth = prompt.width();
var scrollVal,
let scrollVal,
onePageW,
diff;
var loading = require('../plugin/loading'),
let loading = require('../plugin/loading'),
tip = require('../plugin/tip'),
Hammer = require('yoho-hammer');
var richTip = require('../plugin/rich-tip');
let richTip = require('../plugin/rich-tip');
// 点击微信显示加载
var $loadingToast = $('.loading-toast');
let $loadingToast = $('.loading-toast');
/* TODO 影响加载此段 JS */
var theOrderCode = document.getElementById('ordercode') ? document.getElementById('ordercode').value : '';
let theOrderCode = document.getElementById('ordercode') ? document.getElementById('ordercode').value : '';
var wxPayEl = document.getElementById('weixin'),
let wxPayEl = document.getElementById('weixin'),
wxHammer = wxPayEl && new Hammer(wxPayEl);
var appIconPosition = {
let appIconPosition = {
baidu: '-2.7rem',
weixin: '-1.2rem',
QQ: '-5.4rem',
... ... @@ -71,9 +71,21 @@ setTimeout(function() {
}
}, 200);
function Marquee() {
prompt.scrollLeft(prompt.scrollLeft() + 1);
scrollVal = prompt.scrollLeft();
onePageW = tipContent.eq(0).width();
diff = scrollVal - onePageW;
if (diff > 0) {
prompt.scrollLeft(Math.abs(diff));
}
}
// 防诈骗提示滚动
if (tipConWidth > promptWidth - tipWidth) {
var speed = 30;
let speed = 30;
tipContent.width(tipConWidth + (promptWidth / 2));
... ... @@ -81,18 +93,6 @@ if (tipConWidth > promptWidth - tipWidth) {
width: 2 * tipContent.width()
});
function Marquee() {
prompt.scrollLeft(prompt.scrollLeft() + 1);
scrollVal = prompt.scrollLeft();
onePageW = tipContent.eq(0).width();
diff = scrollVal - onePageW;
if (diff > 0) {
prompt.scrollLeft(Math.abs(diff));
}
}
setInterval(Marquee, speed);
}
... ... @@ -107,7 +107,7 @@ function onBridgeReady() {
});
}
if (typeof WeixinJSBridge === undefined) {
if (typeof WeixinJSBridge === 'undefined') {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
} else if (document.attachEvent) {
... ... @@ -135,10 +135,10 @@ function jsApiCall(orderCode, jsApiParameters) {
// 微信支付
function callpay(orderCode) {
var jsApiParameters;
let jsApiParameters;
$loadingToast.removeClass('hide');
if (typeof WeixinJSBridge === undefined) {
if (typeof WeixinJSBridge === 'undefined') {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
} else if (document.attachEvent) {
... ... @@ -174,13 +174,13 @@ function callpay(orderCode) {
function isWXOpen() {
var ua = window.navigator.userAgent.toLowerCase();
let ua = window.navigator.userAgent.toLowerCase();
return ua.indexOf('micromessenger') > 0;
}
function hideWeChatPay() {
var $payApps = $('.app');
let $payApps = $('.app');
$payApps.each(function(idx, app) {
if ($(app).parent().attr('id') === 'weixin') {
... ... @@ -191,7 +191,7 @@ function hideWeChatPay() {
}
function hideAliPay() {
var $payApps = $('.app');
let $payApps = $('.app');
$payApps.each(function(idx, app) {
if ($(app).parent().attr('id') === 'alipay') {
... ... @@ -215,9 +215,9 @@ function setAppIcon(el, position) {
}
function loadIcon() {
var $boxs = $('.box');
var $div = null;
var appid = null;
let $boxs = $('.box');
let $div = null;
let appid = null;
$boxs.each(function(idx, box) {
$div = $(box).find('.icon').find('div');
... ... @@ -235,7 +235,7 @@ function showPage() {
}
function bindTouchedEvent() {
var $boxs = $('.box');
let $boxs = $('.box');
$boxs.on('touchstart', function() {
$(this).addClass('bytouch');
... ...
... ... @@ -203,7 +203,7 @@ function orderCompute() {
if ($.type(res) !== 'object') {
window.location.reload();
} else {
if (typeof res.last_order_amount !== undefined) {
if (typeof res.last_order_amount !== 'undefined') {
res.last_order_amount = (+res.last_order_amount).toFixed(2);
}
... ...
var $ = require('yoho-jquery'),
dbClass = 'data-bind';
let $ = require('yoho-jquery');
let dbClass = 'data-bind';
module.exports = function(callback) {
$.ajax({
type: 'POST',
url: '/brands/searchAsync',
success: function(data) {
render(data.data);
callback && callback(data);
}
});
};
function render(data) {
if (data.history && data.history.list && data.history.list.length) {
var hisEl = $('.history>li').remove();
let hisEl = $('.history>li').remove();
$.each(data.history.list, function(i, his) {
var itemEl = hisEl.clone();
let itemEl = hisEl.clone();
itemEl.find('a')
.attr('href', his.url)
... ... @@ -31,3 +21,13 @@ function render(data) {
$('.net-history').remove();
}
}
module.exports = function(callback) {
$.ajax({
type: 'POST',
url: '/brands/searchAsync',
success: function(data) {
render(data.data);
callback && callback(data);
}
});
};
... ...
... ... @@ -7,14 +7,14 @@
require('channel/home.page.css');
var $ = require('yoho-jquery'),
let $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
lazyLoad = require('yoho-jquery-lazyload'),
fastclick = require('yoho-fastclick'),
noticeScroll = require('../plugin/notice-scroll'),
tip = require('../plugin/tip');
var $mobileWrap = $('.mobile-wrap'),
let $mobileWrap = $('.mobile-wrap'),
$overlay = $('.overlay'),
$sideNav = $('.side-nav'),
$subNav = $('.sub-nav'),
... ... @@ -24,9 +24,9 @@ var $mobileWrap = $('.mobile-wrap'),
swiperClass,
isen = true;
var channelContentHbs = require('channel/content.hbs');
let channelContentHbs = require('channel/content.hbs');
var C_ID;
let C_ID;
require('../common');
fastclick.attach(document.body);
... ... @@ -119,8 +119,8 @@ if ($('.banner-swiper').find('li').size() > 1) {
}
// 店铺推荐人数和收藏初始查询
var checkShop = function() {
var shopIds = [];
let checkShop = function() {
let shopIds = [];
$('.recom-shop').each(function() {
shopIds.push($(this).attr('shopId'));
... ... @@ -134,9 +134,9 @@ var checkShop = function() {
},
}).then(function(result) {
if (result.code === 200) {
for (var i = 0, elem;
(elem = result.data[i]) != null; i++) {
var a = $('.recom-shop[shopId = ' + elem.id + ']');
for (let i = 0, elem;
(elem = result.data[i]); i++) {
let a = $('.recom-shop[shopId = ' + elem.id + ']');
a.find('.faved-num').text(elem.collectionNum + '人已收藏');
if (elem.favorite) {
... ... @@ -148,9 +148,19 @@ var checkShop = function() {
});
};
function formatNumber(number) {
if (number < 0) {
return '00';
} else if (number < 10) {
return '0' + number;
} else {
return number;
}
}
// sale倒计时
var saleTime = function(elem, offsetTime) {
var hour = parseInt(offsetTime / (60 * 60), 10),
let saleTime = function(elem, offsetTime) {
let hour = parseInt(offsetTime / (60 * 60), 10),
minute = parseInt(offsetTime % (60 * 60) / 60, 10),
second = offsetTime % 60;
... ... @@ -159,9 +169,9 @@ var saleTime = function(elem, offsetTime) {
}
if (offsetTime >= -1) {
$(elem).find('.hour').text(hour < 0 ? '00' : (hour < 10 ? ('0' + hour) : hour));
$(elem).find('.minute').text(minute < 0 ? '00' : (minute < 10 ? ('0' + minute) : minute));
$(elem).find('.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second));
$(elem).find('.hour').text(formatNumber(hour));
$(elem).find('.minute').text(formatNumber(minute));
$(elem).find('.second').text(formatNumber(second));
if (offsetTime <= -1) { // 结束倒计时刷新状态
$(elem).find('.limit').hide();
... ... @@ -173,6 +183,7 @@ var saleTime = function(elem, offsetTime) {
}
};
function ajaxResource() {
$('.banner-center-swiper').each(function() {
... ... @@ -271,12 +282,12 @@ function ajaxResource() {
}
// 店铺收藏 || 取消收藏
var $collect = $('.fav-container');
let $collect = $('.fav-container');
$collect.on('touchstart', function() {
var opt = $(this).hasClass('fav-yes') ? 'cancel' : 'ok';
var self = $(this);
var num = parseInt(self.parent().find('.faved-num').html());
let opt = $(this).hasClass('fav-yes') ? 'cancel' : 'ok';
let self = $(this);
let num = parseInt(self.parent().find('.faved-num').html(), 10);
$.ajax({
method: 'get',
... ... @@ -290,7 +301,7 @@ function ajaxResource() {
withCredentials: true
},
success: function(data) {
var url = '';
let url = '';
if (data.code === 200) {
if (self.hasClass('fav-yes')) {
... ... @@ -328,7 +339,7 @@ function ajaxResource() {
channel: 1,
},
success: function(data) {
var vip = $('.vip-only');
let vip = $('.vip-only');
if (data.code === 200 && Number(data.current_vip_level) !== 0) {
vip.show();
... ... @@ -342,10 +353,10 @@ function ajaxResource() {
checkShop();
var limitFloor = $('.sale-floor-time');
let limitFloor = $('.sale-floor-time');
limitFloor.each(function() {
var endTime = $(this).attr('data-time'),
let endTime = $(this).attr('data-time'),
// ~~两次取反位运算就是取整
limit = ~~((endTime * 1000 - Date.now()) / 1000);
... ... @@ -355,7 +366,7 @@ function ajaxResource() {
}
// 异步获取首屏其余楼层
var getResourceContent = function() {
let getResourceContent = function() {
$.ajax({
type: 'GET',
url: '/channel/getResourceContent',
... ... @@ -363,7 +374,7 @@ var getResourceContent = function() {
gender: $mobileWrap.data('channel')
},
}).then(function(result) {
var resourceTemplate = channelContentHbs({content: result});
let resourceTemplate = channelContentHbs({content: result});
$resourceContent.append(resourceTemplate);
lazyLoad($resourceContent.find('img.lazy:not([src])'));
... ...