diff --git a/admin.php b/admin.php index d5e007e..3ef7a1a 100644 --- a/admin.php +++ b/admin.php @@ -3616,7 +3616,9 @@ async function editShopConfig(id) { async function saveShopConfig() { const id = document.getElementById('scfId').value; const name = document.getElementById('scfName').value.trim(); - const stock = parseInt(document.getElementById('scfStock').value) || -1; + // ★ 修复:库存=0不能写成-1。空值才默认-1(无限),0是合法售罄值 + const stockRaw = document.getElementById('scfStock').value; + const stock = stockRaw === '' ? -1 : parseInt(stockRaw, 10); const offer = document.getElementById('scfOffer').value.trim(); const expire = document.getElementById('scfExpire').value.trim(); const price = parseFloat(document.getElementById('scfPrice').value) || 0; diff --git a/player.php b/player.php index 1b0ca2d..abec798 100644 --- a/player.php +++ b/player.php @@ -1184,6 +1184,17 @@ if ($currentVersion !== $BUILD_VERSION) { // 加载商店商品列表 async function loadShopProducts() { const container = document.getElementById('shopProductsContainer'); + // ★ 盲盒随机语录(带动消费情绪) + const blindBoxQuotes = [ + '🎲 手气未知,欧皇可能就是你!', + '✨ 下一发就是传说级债券!', + '🔥 盲盒刺激,开箱见惊喜!', + '💎 运气爆棚,开出大额债券不是梦!', + '🍀 天选之人,?? 藏着大宝藏!', + '🎁 未知才有趣,下单揭晓答案!', + '⚡ 搏一搏,债券多一摞!', + '🌟 你的专属幸运数字正在等你!' + ]; try { const res = await api('pay.php', {action: 'get_shop_products'}); if (res.success && res.data && res.data.products) { @@ -1197,9 +1208,14 @@ if ($currentVersion !== $BUILD_VERSION) { let html = ''; products.forEach((product, index) => { const isSelected = index === 0; // 默认选中第一个 + const isBlindBox = product.bond_min !== product.bond_max; // 盲盒:范围格式 const offerText = product.temporary_offer ? `
🎁 ${product.temporary_offer}${product.expire_display ? ' (有效期: ' + product.expire_display + ')' : ''}
` : ''; const stockText = product.stock === -1 ? '无限库存' : (product.stock > 0 ? `库存: ${product.stock}` : '售罄'); const stockColor = product.stock === -1 ? 'var(--green)' : (product.stock > 0 ? 'var(--dim)' : 'var(--red)'); + // ★ 盲盒不显示具体金额,用 ?? 代替 + const bondDisplay = isBlindBox ? '🎲 ?? 债券' : `${product.bond_min} 债券`; + // ★ 盲盒随机语录 + const quoteText = isBlindBox ? `
${blindBoxQuotes[Math.floor(Math.random() * blindBoxQuotes.length)]}
` : ''; html += `
@@ -1209,9 +1225,10 @@ if ($currentVersion !== $BUILD_VERSION) {
¥${product.price}
支付金额
-
→ ${product.bond_min === product.bond_max ? product.bond_min + ' 债券' : product.bond_min + '-' + product.bond_max + ' 债券'}
+
→ ${bondDisplay}
${offerText} + ${quoteText} `; }); @@ -1247,7 +1264,8 @@ if ($currentVersion !== $BUILD_VERSION) { const price = el.dataset.price; const bondMin = el.dataset.bondMin; const bondMax = el.dataset.bondMax; - const bondText = bondMin === bondMax ? bondMin + ' 债券' : bondMin + '-' + bondMax + ' 债券'; + // ★ 盲盒不显示具体金额,用 ?? 代替 + const bondText = bondMin === bondMax ? bondMin + ' 债券' : '🎲 ?? 债券'; btn.style.display = 'block'; btn.textContent = `支付宝支付 ¥${price} → ${bondText}`; btn.dataset.productId = el.dataset.productId;