附加功能在计算机上工作正常,但在电话上仅附加但不显示列表
我的代码jQuery
if (decodeURIComponent(getCookie("sp")) != null && decodeURIComponent(getCookie("sp")) != "" && decodeURIComponent(getCookie("sp")) != "{}") {
var temp = JSON.parse(decodeURIComponent(getCookie("sp"))), quantity = 0,item="";
for (var item in temp) {
quantity++;
var item_cart = '<li><div class="img-product"><img src="' + temp[item]["Img"] + '" alt=""/></div><div class="info-product"><div class="name">' + temp[item]["Name"] + '</div><div class="price"><span>1 </span><span> x </span><span class="item-price-cart">' + parseInt(temp[item]["Price"]).toLocaleString(undefined, { minimumFractionDigits: 0 }) + ' VNĐ</span></div></div><div class="clearfix"></div><span class="delete" id="remove_' + temp[item]["ID"] + '">x</span></li>';
item += item_cart;
$(".list-cart").append(item_cart);
}
$(".quanlity-cart").text(quantity);
var price_cart = 0;
$(".item-price-cart").each(function () {
price_cart += parseInt($(this).text().replace(" VNĐ", "").replace(".", "").replace(".", ""));
});
document.getElementById("total-price").innerText = price_cart.toLocaleString(undefined, { minimumFractionDigits: 0 }) + " VNĐ";
$(".total-price").text(price_cart.toLocaleString(undefined, { minimumFractionDigits: 0 }) + " VNĐ");
}
该站点遇到该错误。 (在购物车中打印列表购物车项目)https://obu.vn/Cart.aspx。帮我!请!!!