feat(forum): P1 topic coupons, P2 plate follow gateway, cash creator revenue

- Topic_Pay: soft/hard coupon validate, payable amount, free-after-discount, paid burn
- Creator_Revenue: settle content/topic/plate_follow cash (type=order), keep shop path
- Plate VIP1/VIP2 meta + resolve_plate_follow_pay_price via aksrt_get_user_vip_level
- New AKSRT_Plate_Follow_Pay REST multi-gateway; remove Credits×100 money bypass
- Frontend: cms-download plate_follow apiKind + forum-governance money cashier bridge
This commit is contained in:
kate522 committed 2026-07-15 13:04:04 +08:00
1 parent 1a15ae7cea
commit 78d3189f8f
14 files changed
+1189 -169

No files matched your search

+22 -6
View File
@@ -367,7 +367,9 @@
}
function payApiBase(apiKind) {
return apiKind === 'topic' ? '/pay/topic/' : '/pay/content/';
if (apiKind === 'topic') return '/pay/topic/';
if (apiKind === 'plate_follow') return '/pay/plate-follow/';
return '/pay/content/';
}
function buildPreviewUrl(postId, priceType, couponCode, apiKind) {
@@ -414,7 +416,7 @@
renderError(r.json.message || '', data, returnFocusEl, 'aksrt_need_vip');
return;
}
if (code === 'aksrt_already_paid') {
if (code === 'aksrt_already_paid' || code === 'aksrt_already_followed') {
window.location.reload();
return;
}
@@ -446,15 +448,16 @@
window.location.reload();
return;
}
// Free VIP topics still need a free-order unlock POST; content free can reload.
if (preview.is_free && preview.pay_type !== 'topic') {
// Free VIP topic/plate_follow still need a free-order unlock POST; content free can reload.
if (preview.is_free && preview.pay_type !== 'topic' && preview.pay_type !== 'plate_follow') {
window.location.reload();
return;
}
const isPoints = preview.pay_modo === 'points';
const priceType = (preview._price_type || preview.price_type || '');
const apiKind = preview._api_kind || (preview.pay_type === 'topic' ? 'topic' : 'content');
const apiKind = preview._api_kind
|| (preview.pay_type === 'topic' ? 'topic' : (preview.pay_type === 'plate_follow' ? 'plate_follow' : 'content'));
let amountLabel = escapeHtml(preview.amount_label || '');
let baseLabel = escapeHtml(preview.base_label || '');
const listLabel = escapeHtml(preview.list_amount_label || preview.amount_label || amountLabel);
@@ -616,7 +619,7 @@
if (!r.ok || (r.json && r.json.code && !r.json.success)) {
const code = r.json && r.json.code ? r.json.code : '';
const data = (r.json && r.json.data) || {};
if (code === 'aksrt_already_paid') {
if (code === 'aksrt_already_paid' || code === 'aksrt_already_followed') {
window.location.reload();
return;
}
@@ -666,6 +669,14 @@
return;
}
const plateFollowBuyBtn = e.target.closest('[data-aksrt-pay-plate-follow]');
if (plateFollowBuyBtn) {
e.preventDefault();
const plateId = parseInt(plateFollowBuyBtn.getAttribute('data-aksrt-pay-plate-follow') || '0', 10);
if (plateId) openCashier(plateId, plateFollowBuyBtn, '', '', 'plate_follow');
return;
}
const buyBtn = e.target.closest('[data-action="aksrt-need-purchase"], [data-aksrt-pay-content]');
if (buyBtn) {
e.preventDefault();
@@ -696,6 +707,11 @@
requestDownload(btn);
});
// Bridge for forum-governance plate money cashier.
window.aksrtOpenCashier = function (postId, returnFocusEl, priceType, couponCode, apiKind) {
openCashier(postId, returnFocusEl || null, priceType || '', couponCode || '', apiKind || 'content');
};
// ===== 注入 modal 基础样式(避免必须额外加载 CSS)=====
const style = document.createElement('style');
style.textContent =