Authored by 毕凯

购物车选择框加载优化

... ... @@ -96,17 +96,21 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
* @return false or undefined
*
*/
function showEditPannelWithSku(html, id, isSelected, isEditNum) {
if (html.length < 2) {
function showEditPannelWithSku(html, id, isSelected, isEditNum, skn) {
var $html = $(html);
if (!$html.hasClass('chose-panel')) {
tip.show('出错啦!');
return false;
}
// 记录成功加载的选择框
previousEditSkn = skn;
//删掉页面上原有的pannel
chosePanel.remove();
$(html).appendTo('#mainCart');
$html.appendTo('#mainCart');
chosePanel.init();
chosePanel.setEditModeWithSknId(id, isSelected);
... ... @@ -141,9 +145,6 @@ $('.icon-edit').on('touchstart', function(e) {
return;
}
previousEditSkn = skn;
$checkBox = $this.closest('.info').siblings('.checkbox');
$tag = $this.closest('.deps').siblings('.few-tag');
... ... @@ -157,7 +158,6 @@ $('.icon-edit').on('touchstart', function(e) {
loading.showLoadingMask();
$.ajax({
url: '/cart/index/goodinfo',
data: {
... ... @@ -165,7 +165,7 @@ $('.icon-edit').on('touchstart', function(e) {
buy_num: count
},
success: function(res) {
showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum);
showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum, skn);
},
error: function() {
tip.show('网络异常');
... ...