...
|
...
|
@@ -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;
|
...
|
...
|
|