Dress Shoes

Higgins Bit Loafer

123,89 $
Sale!

Dress Shoes

Higgins Bit Loafer

Original price was: 185,00 $.Current price is: 122,89 $.
Sale!

Dress Shoes

Higgins Bit Loafer

Original price was: 119,99 $.Current price is: 82,99 $.
Sale!

Dress Shoes

Higgins Bit Loafer

Original price was: 119,99 $.Current price is: 79,99 $.
Sale!
Original price was: 119,99 $.Current price is: 81,99 $.
Sale!
Original price was: 119,99 $.Current price is: 80,99 $.
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.
document.addEventListener('DOMContentLoaded', function () { (function () { 'use strict'; /* ============================================ 1. 倒计时(按秒数倒计时) ============================================ */ var timerEl = document.querySelector('.my-timer'); if (timerEl) { // 从 data-duration 读取剩余秒数,默认 2000 秒 var durationSec = parseInt(timerEl.getAttribute('data-duration'), 10); if (isNaN(durationSec)) { durationSec = 2000; } // 结束时间 = 当前时间 + 秒数 * 1000 var endTime = Date.now() + durationSec * 1000; var elDays = document.getElementById('my-days'); var elHours = document.getElementById('my-hours'); var elMin = document.getElementById('my-min'); var elSec = document.getElementById('my-sec'); function pad(n) { return n < 10 ? '0' + n : '' + n; } function updateCountdown() { var now = Date.now(); var diff = endTime - now; // 已结束 if (diff <= 0) { elDays.textContent = '00'; elHours.textContent = '00'; elMin.textContent = '00'; elSec.textContent = '00'; // 可选:隐藏整个倒计时区域 // document.querySelector('.my-countdown-stock').style.display = 'none'; return; } var days = Math.floor(diff / 86400000); var hours = Math.floor((diff % 86400000) / 3600000); var mins = Math.floor((diff % 3600000) / 60000); var secs = Math.floor((diff % 60000) / 1000); elDays.textContent = pad(days); elHours.textContent = pad(hours); elMin.textContent = pad(mins); elSec.textContent = pad(secs); } updateCountdown(); setInterval(updateCountdown, 1000); } /* ============================================ 2. 库存进度条 ============================================ */ function updateStock(sold, stock) { var elSold = document.getElementById('my-sold'); var elStock = document.getElementById('my-stock'); var elProgress = document.getElementById('my-progress'); if (!elSold || !elStock || !elProgress) return; var total = sold + stock; // 防止除以 0 var percent = total > 0 ? Math.round((sold / total) * 100) : 0; elSold.textContent = sold; elStock.textContent = stock; elProgress.style.width = percent + '%'; // 可选:更新进度条的 title 提示 var area = elProgress.parentElement; if (area) { area.setAttribute('title', 'Sold ' + percent + '%'); } } // ---- 调用示例 ---- // 方式 A:静态写死 updateStock(66, 500); // 方式 C:暴露到全局,方便你在控制台或其他脚本里调用 window.myUpdateStock = updateStock; })(); });