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.
53 lines
2.3 KiB
53 lines
2.3 KiB
function createNextStepList() {
|
|
let parentNode = document.getElementById("next-step")
|
|
for (i in [0,1,2,3,4]) {
|
|
let node = document.createElement("li")
|
|
if (i==0) {
|
|
node.classList.add("next-step-item", "next-step-item-process", "next-step-item-first")
|
|
} else if (i==4) {
|
|
node.classList.add("next-step-item", "next-step-item-wait")
|
|
} else {
|
|
node.classList.add("next-step-item", "next-step-item-wait", "next-step-item-last")
|
|
}
|
|
node.style.width = "20%"
|
|
parentNode.appendChild(node)
|
|
|
|
let container = document.createElement("div")
|
|
container.classList.add("next-step-item-container")
|
|
node.appendChild(container)
|
|
let placeholder = document.createElement("div")
|
|
placeholder.classList.add("next-step-item-node-placeholder")
|
|
container.appendChild(placeholder)
|
|
let itemNode = document.createElement("div")
|
|
itemNode.classList.add("next-step-item-node")
|
|
placeholder.appendChild(itemNode)
|
|
let circle = document.createElement("div")
|
|
circle.classList.add("next-step-item-node-circle")
|
|
|
|
circle.innerText = (Number(i)+1).toString()
|
|
itemNode.appendChild(circle)
|
|
|
|
let itemBody = document.createElement("div")
|
|
itemBody.classList.add("next-step-item-body")
|
|
itemBody.setAttribute("tabindex", "0")
|
|
itemBody.setAttribute("aria-current", "step")
|
|
node.appendChild(itemBody)
|
|
let itemtitle = document.createElement("div")
|
|
itemtitle.classList.add("next-step-item-title")
|
|
itemBody.innerText = "查看购物车"
|
|
itemBody.appendChild(itemtitle)
|
|
let itemContent = document.createElement("div")
|
|
itemContent.classList.add("next-step-item-content")
|
|
itemBody.appendChild(itemContent)
|
|
|
|
let itemTail = document.createElement("div")
|
|
itemTail.classList.add("next-step-item-tail")
|
|
node.appendChild(itemTail)
|
|
let tailUnderlay = document.createElement("div")
|
|
tailUnderlay.classList.add("next-step-item-tail-underlay")
|
|
itemTail.appendChild(tailUnderlay)
|
|
let tailOverlay = document.createElement("div")
|
|
tailOverlay.classList.add("next-step-item-tail-overlay")
|
|
tailUnderlay.appendChild(tailOverlay)
|
|
}
|
|
}
|