feat(forum): plate follow cash coupons + free auto-order
- Meta _aksrt_follow_pay_coupon_s + plate admin toggle (money only) - Plate_Follow_Pay soft/hard coupon apply, free-after-discount, burn via shared helper - Cashier auto-submits free topic/plate orders; topic coupon label no longer "预留"
This commit is contained in:
1 parent
3588ebeb85
commit
cb43412369
6 files changed
+273
-42
No files matched your search
@@ -448,7 +448,7 @@
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
// Free VIP topic/plate_follow still need a free-order unlock POST; content free can reload.
|
||||
// Content free: reload. Topic/plate free: auto free-order POST (VIP free / free-after-coupon).
|
||||
if (preview.is_free && preview.pay_type !== 'topic' && preview.pay_type !== 'plate_follow') {
|
||||
window.location.reload();
|
||||
return;
|
||||
@@ -458,6 +458,25 @@
|
||||
const priceType = (preview._price_type || preview.price_type || '');
|
||||
const apiKind = preview._api_kind
|
||||
|| (preview.pay_type === 'topic' ? 'topic' : (preview.pay_type === 'plate_follow' ? 'plate_follow' : 'content'));
|
||||
|
||||
// Auto-submit free topic/plate orders so user doesn't click through empty cash UI.
|
||||
if (preview.is_free && (apiKind === 'topic' || apiKind === 'plate_follow') && !isPoints) {
|
||||
open(
|
||||
'<h3 class="aksrt-dl-modal__title">' + tt('confirm_buy', '确认购买') + '</h3>' +
|
||||
'<p class="aksrt-dl-modal__msg">' + tt('processing', '处理中…') + '</p>',
|
||||
returnFocusEl
|
||||
);
|
||||
const freeBtn = document.createElement('button');
|
||||
freeBtn.type = 'button';
|
||||
freeBtn.style.display = 'none';
|
||||
freeBtn.setAttribute('data-price-type', priceType || '');
|
||||
document.body.appendChild(freeBtn);
|
||||
const freeCode = String(preview.coupon_code || preview._coupon_code || '');
|
||||
submitPurchase(preview.post_id, 'cash', 'balance', freeBtn, returnFocusEl, freeCode, apiKind);
|
||||
try { freeBtn.remove(); } catch (e0) { /* ignore */ }
|
||||
return;
|
||||
}
|
||||
|
||||
let amountLabel = escapeHtml(preview.amount_label || '');
|
||||
let baseLabel = escapeHtml(preview.base_label || '');
|
||||
const listLabel = escapeHtml(preview.list_amount_label || preview.amount_label || amountLabel);
|
||||
|
||||
Reference in new issue
Block a user