You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.9 KiB

class Book {
constructor(name, price) {
this.name = name
this.price = price
}
}
function appendBooks() {
var bookList = [new Book("1", 1),new Book("2", 2)]
for (book in bookList) {
var ul = document.createElement("ul")
ul.classList.add("clearfix", "item-content")
ul.innerHTML = '<li class=\"td td-chk\"\>\
<div class=\"td-inner\"\>\
<div style=\"height: 82px;position: relative;\"\>\
<div class=\"cart-checkbox\"\>\
<input type=\"checkbox\" class=\"chk\"\>\
</div\>\
</div\>\
</div\>\
</li\>\
<li class=\"td td-item\"\>\
<div class=\"td-inner\"\>\
<div class=\"item-pic\"\>\
<a href=\"#\"\>\
<img src=\"../img/logo.png\" alt=\"物品图片\"\>\
</a\>\
</div\>\
<div class=\"item-info\"\>\
<div class=\"item-basic-info\"\>\
<div\><p\>Apple/苹果 iPhone 11 Pro</p\></div\>\
</div\>\
<div class=\"item-other-info\"\>\
</div\>\
</div\>\
</div\>\
</li\>\
<li class=\"td td-info\"\>\
\
</li\>\
<li class=\"td td-price\"\>\
<div class=\"td-inner\"\>\
<div class=\"item-price\"\>\
<div class=\"price-content\"\>\
<div class=\"price-line\"\>\
<p\>¥8699.00</p\>\
</div\>\
</div\>\
</div\>\
</div\>\
</li\>\
<li class=\"td td-amount\"\>\
<div class=\"td-inner\"\>\
<div class=\"amount-wrapper\"\>\
<div class=\"item-amount\"\>\
\
</div\>\
</div\>\
</div\>\
</li\>\
<li class=\"td td-sum\"\>\
<div class=\"td-inner\"\>\
<p class=\"number\"\>¥17398.00</p\>\
</div\>\
</li\>\
<li class=\"td td-op\"\>\
<div class=\"td-inner\"\>\
<a href=\"#\"\>移入收藏夹</a\>\
<a href=\"#\"\>删除</a\>\
</div\>\
</li\>'
document.body.appendChild(ul)
}
}