Authored by Rock Zhang

更新到201603031828静态资源

... ... @@ -5282,11 +5282,13 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
var $cart = $('.cart-bar');
var limitSaleBtn = document.getElementById('limit-sale'),
limitSaleHammer = limitSaleBtn && new Hammer(limitSaleBtn);
var limitSaleHammer = (limitSaleHammer = document.getElementById('limit-sale')) && new Hammer(limitSaleHammer);
var appUrl = $('input[name="limitCodeUrl"]').val();
var dialog = require("js/me/dialog");
//add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
var $cartBar = $('.cart-bar');
... ... @@ -5344,15 +5346,15 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
});
}
limitSaleHammer ? limitSaleHammer.on('tap', function(e) {
limitSaleHammer && limitSaleHammer.on('tap', function(e) {
e.srcEvent.stopPropagation();
dialog.showDialog({
dialogText: '进入有货APP尖货频道分享\n以获取限购码',
dialogText: '打开有货APP限定发售频道\n获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
console.log('111');
window.location.href = appUrl;
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
... ... @@ -5361,7 +5363,7 @@ limitSaleHammer ? limitSaleHammer.on('tap', function(e) {
dialog.hideDialog();
}
});
}) : null;
});
require("js/product/detail/desc");
require("js/product/detail/comments-consults");
... ... @@ -5408,6 +5410,9 @@ var $ = require("jquery"),
var productId = $('#productId').val();
var skn = $('#preferenceUrl').val().split('?')[1].split('&')[0].split('=')[1],
productCode = $('#limitProductCode').val();
$('#likeBtn').on('touchstart', function() {
var opt,
favorite;
... ... @@ -5462,6 +5467,7 @@ $('#likeBtn').on('touchstart', function() {
$('#addtoCart').on('touchstart', function() {
$('.cart-bar').hide();
chosePanel.setLimitGoodModeWithSknId(productCode, skn);
chosePanel.show();
//统计代码:用于统计用户加入购物车的动作
... ... @@ -5474,6 +5480,7 @@ $('#addtoCart').on('touchstart', function() {
return false;
});
});
define("js/cart/chose-panel", ["jquery"], function(require, exports, module){
/**
... ... @@ -5516,12 +5523,19 @@ var $chosePanel = $('#chose-panel'),
$soonSoldOut = $('.soonSoldOut-tag'),
$yohoPage = $('.yoho-page');
//购物车编辑标相关变量
// 购物车编辑标相关变量
var isEdit,
isSelected,
oldSknId;
//初始化购物车面板显示
// 限购商品的商品码。只有限购商品时才会设置。
var limitProductCode,
// 限购商品的skn。只有限购商品时才会设置。
skn;
// 初始化购物车面板显示
function init() {
hasChooseColor = false;
hasChooseSize = false;
... ... @@ -5555,6 +5569,21 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) {
isSelected = isThisGoodSelected;
}
/*
* 设置当前面板为限购商品模式
*
* @param {String} code 当前限购商品的商品码
*
* @param {String} sknId. 当前限购商品的sknId
*
* @return {undefined}
*/
function setLimitGoodModeWithSknId(code, sknId) {
$('#chose-btn-sure').html('结算');
limitProductCode = code;
skn = sknId;
}
//删除面板
function removePannel() {
var $pannel = $('.chose-panel'),
... ... @@ -5627,6 +5656,8 @@ function updateConformButtonClassAndText() {
$chosed = $allChoseItems.find('.chosed');
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
} else if (limitProductCode) {
$('#chose-btn-sure').css('background-color', '#eb0313').html('结算');
} else {
$('#chose-btn-sure').css('background-color', '#eb0313').html(isEdit ? '确认' : '加入购物车');
}
... ... @@ -5924,6 +5955,16 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
url = '/cart/index/modify';
} else if (limitProductCode) {
// 当前面板选择的是限购商品
url = 'http://m.yohobuy.com/cart/index/orderEnsure?code=' + limitProductCode + '&&sku=' +
productSku + '&&skn=' + skn + '&&buy_num=' + buyNumber;
//打开结算页面,结束函数执行。
window.location.href = url;
return false;
} else {
cartGoodData = {
productSku: productSku,
... ... @@ -5986,7 +6027,7 @@ exports.show = show;
exports.remove = removePannel;
exports.setEditModeWithSknId = setEditModeWithSknId;
exports.disableNumEdit = disableNumEdit;
exports.setLimitGoodModeWithSknId = setLimitGoodModeWithSknId;
});
define("js/plugin/inner-scroll", ["jquery"], function(require, exports, module){
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.