Authored by hongweigao

套餐中所有商品均只有一个颜色、一个尺码时,跳转的结算页

... ... @@ -1393,7 +1393,7 @@ $(function() {
type: 'GET',
url: '/product/detail/getPacakge',
data: {
skn: '51127118'
skn: skn
}
}).then(function(result) {
if (result.code === 200 && result.data.packageData.length > 0) {
... ... @@ -1415,6 +1415,26 @@ $(function() {
// 套餐点击事件
$('.package-box').on('click', '#buy-detail', function() {
var isSingle = true,
singleSkuList = [];
for (var i = 0; i < pkgData.packageData.length; i++) {
var pData = pkgData.packageData[i];
if(pData.colors.length === 1 && pData.colors[0].size.length === 1) {
singleSkuList.push(pData.colors[0].size[0].sku);
} else {
isSingle = false;
}
}
//如果只有套餐中商品,都只有一个颜色一个尺码,就直接跳转结算页
if (isSingle) {
if (!window.getUid()) {
return window.jumpUrl(window.signinUrl());
}
window.location.href = '//www.yohobuy.com/cart/easypay?bundle=' + pkgData.bundleId + '&sku=' + singleSkuList.join(',');
return true;
}
var pkgDetailTpl = require('hbs/product/package-dialog.hbs');
var opt = {
className: 'pkg-dialog',
... ...