@seaverse/payment-sdk 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -2
- package/dist/index.browser.js +569 -670
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +569 -670
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +569 -670
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2196,24 +2196,19 @@ class PaymentModal {
|
|
|
2196
2196
|
*
|
|
2197
2197
|
* 设计风格:深色卡片 + 清晰信息层次 + 渐变 CTA 按钮
|
|
2198
2198
|
*/
|
|
2199
|
-
/* ─── 设计 Token
|
|
2199
|
+
/* ─── 设计 Token(与 order-popups PendingPopup 一致) ─── */
|
|
2200
2200
|
const D = {
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
textWhite: '#
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
accentTealShadow: 'rgba(45, 212, 191, 0.35)',
|
|
2213
|
-
// 分隔线
|
|
2214
|
-
divider: 'rgba(255, 255, 255, 0.06)',
|
|
2215
|
-
// 圆角
|
|
2216
|
-
radiusCard: '20px',
|
|
2201
|
+
bgOverlay: 'rgba(0, 0, 0, 0.85)',
|
|
2202
|
+
bgCard: '#121212',
|
|
2203
|
+
bgCardBorder: 'rgba(44, 44, 46, 0.6)',
|
|
2204
|
+
bgSurface: '#1E1E1E',
|
|
2205
|
+
bgSurfaceHighlight: '#2A2A2E',
|
|
2206
|
+
borderSubtle: 'rgba(255, 255, 255, 0.05)',
|
|
2207
|
+
textWhite: '#FFFFFF',
|
|
2208
|
+
textMuted: '#A1A1AA',
|
|
2209
|
+
timerRed: '#EF4444',
|
|
2210
|
+
brandGreen: '#10B981',
|
|
2211
|
+
radiusCard: '24px',
|
|
2217
2212
|
radiusInner: '12px',
|
|
2218
2213
|
radiusBtn: '12px',
|
|
2219
2214
|
};
|
|
@@ -2275,27 +2270,30 @@ class RetentionModal {
|
|
|
2275
2270
|
*/
|
|
2276
2271
|
createModal() {
|
|
2277
2272
|
const { language, productName, purchaseAmount, bonusAmount, discountPrice } = this.options;
|
|
2278
|
-
const
|
|
2273
|
+
const lang = language ?? 'en';
|
|
2274
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
2279
2275
|
const t = isZh ? {
|
|
2280
2276
|
title: '你有一笔订单待支付',
|
|
2281
|
-
timePrefix: '请在',
|
|
2282
|
-
timeSuffix: '
|
|
2283
|
-
productLabel: '
|
|
2284
|
-
|
|
2285
|
-
|
|
2277
|
+
timePrefix: '请在 ',
|
|
2278
|
+
timeSuffix: ' 内支付,超时自动取消',
|
|
2279
|
+
productLabel: '商品',
|
|
2280
|
+
quantityLabel: '数量',
|
|
2281
|
+
priceLabel: '优惠价',
|
|
2282
|
+
bonusLabel: '奖励',
|
|
2286
2283
|
cancelBtn: '取消',
|
|
2287
2284
|
continueBtn: '继续支付',
|
|
2288
2285
|
} : {
|
|
2289
2286
|
title: 'You have a pending order',
|
|
2290
|
-
timePrefix: 'Please pay within',
|
|
2291
|
-
timeSuffix: '
|
|
2287
|
+
timePrefix: 'Please pay within ',
|
|
2288
|
+
timeSuffix: ', auto-cancelled if timeout',
|
|
2292
2289
|
productLabel: 'Product:',
|
|
2293
|
-
|
|
2290
|
+
quantityLabel: 'Quantity:',
|
|
2291
|
+
priceLabel: 'Price:',
|
|
2294
2292
|
bonusLabel: 'Bonus:',
|
|
2295
2293
|
cancelBtn: 'Cancel',
|
|
2296
|
-
continueBtn: '
|
|
2294
|
+
continueBtn: 'Pay Now',
|
|
2297
2295
|
};
|
|
2298
|
-
// ───
|
|
2296
|
+
// ─── 遮罩(与 order-popups 一致) ───
|
|
2299
2297
|
this.overlay = document.createElement('div');
|
|
2300
2298
|
this.overlay.id = 'retention-modal-overlay';
|
|
2301
2299
|
this.overlay.style.cssText = `
|
|
@@ -2303,137 +2301,130 @@ class RetentionModal {
|
|
|
2303
2301
|
display: flex; align-items: center; justify-content: center;
|
|
2304
2302
|
padding: 24px;
|
|
2305
2303
|
background: ${D.bgOverlay};
|
|
2306
|
-
backdrop-filter: blur(
|
|
2304
|
+
backdrop-filter: blur(8px);
|
|
2307
2305
|
animation: rm-fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
2308
2306
|
`;
|
|
2309
|
-
// ───
|
|
2307
|
+
// ─── 卡片(order-popups: bg-dark-card, rounded-[24px], border dark-border) ───
|
|
2310
2308
|
this.modal = document.createElement('div');
|
|
2311
2309
|
this.modal.style.cssText = `
|
|
2312
2310
|
position: relative;
|
|
2313
|
-
width: 90vw; max-width:
|
|
2311
|
+
width: 90vw; max-width: 500px; min-width: 420px;
|
|
2314
2312
|
border-radius: ${D.radiusCard};
|
|
2315
2313
|
background: ${D.bgCard};
|
|
2316
|
-
|
|
2314
|
+
border: 1px solid ${D.bgCardBorder};
|
|
2315
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
2316
|
+
padding: 24px;
|
|
2317
2317
|
animation: rm-slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
2318
2318
|
overflow: hidden;
|
|
2319
2319
|
`;
|
|
2320
|
-
// ─── 构建 HTML ───
|
|
2320
|
+
// ─── 构建 HTML(与 order-popups PendingPopup + 图片布局一致) ───
|
|
2321
2321
|
this.modal.innerHTML = `
|
|
2322
|
-
<!--
|
|
2322
|
+
<!-- 关闭按钮(order-popups: top-5 right-5, rounded-full, text-dark-muted) -->
|
|
2323
2323
|
<button type="button" id="retention-modal-close-btn" style="
|
|
2324
|
-
position: absolute; top:
|
|
2325
|
-
display: flex; width:
|
|
2324
|
+
position: absolute; top: 20px; right: 20px; z-index: 10;
|
|
2325
|
+
display: flex; width: 40px; height: 40px;
|
|
2326
2326
|
align-items: center; justify-content: center;
|
|
2327
2327
|
border-radius: 50%;
|
|
2328
|
-
background:
|
|
2329
|
-
color:
|
|
2328
|
+
background: transparent;
|
|
2329
|
+
color: ${D.textMuted};
|
|
2330
2330
|
border: none; cursor: pointer;
|
|
2331
|
-
transition:
|
|
2331
|
+
transition: color 0.2s, background 0.2s;
|
|
2332
2332
|
">
|
|
2333
|
-
<svg width="
|
|
2334
|
-
<
|
|
2333
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2334
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
2335
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
2335
2336
|
</svg>
|
|
2336
2337
|
</button>
|
|
2337
2338
|
|
|
2338
|
-
<!--
|
|
2339
|
-
<div style="padding:
|
|
2340
|
-
<
|
|
2341
|
-
margin: 0 0
|
|
2342
|
-
font-size:
|
|
2339
|
+
<!-- 标题区域(order-popups: text-2xl font-bold, timer in red font-mono) -->
|
|
2340
|
+
<div style="padding: 16px 0 32px; text-align: center;">
|
|
2341
|
+
<h1 style="
|
|
2342
|
+
margin: 0 0 8px;
|
|
2343
|
+
font-size: 24px;
|
|
2343
2344
|
font-weight: 700;
|
|
2344
2345
|
color: ${D.textWhite};
|
|
2345
|
-
letter-spacing: -0.
|
|
2346
|
-
">${t.title}</
|
|
2346
|
+
letter-spacing: -0.02em;
|
|
2347
|
+
">${t.title}</h1>
|
|
2347
2348
|
<p style="
|
|
2348
2349
|
margin: 0;
|
|
2349
2350
|
font-size: 14px;
|
|
2350
|
-
color: ${D.
|
|
2351
|
-
|
|
2351
|
+
color: ${D.textMuted};
|
|
2352
|
+
display: flex;
|
|
2353
|
+
align-items: center;
|
|
2354
|
+
justify-content: center;
|
|
2355
|
+
flex-wrap: wrap;
|
|
2356
|
+
gap: 2px;
|
|
2352
2357
|
">
|
|
2353
|
-
${t.timePrefix}
|
|
2354
|
-
|
|
2355
|
-
color: ${D.accentRed};
|
|
2358
|
+
${t.timePrefix}<span id="countdown-display" style="
|
|
2359
|
+
color: ${D.timerRed};
|
|
2356
2360
|
font-weight: 700;
|
|
2357
2361
|
font-variant-numeric: tabular-nums;
|
|
2358
|
-
|
|
2359
|
-
|
|
2362
|
+
font-family: ui-monospace, monospace;
|
|
2363
|
+
">00:15:00</span>${t.timeSuffix}
|
|
2360
2364
|
</p>
|
|
2361
2365
|
</div>
|
|
2362
2366
|
|
|
2363
|
-
<!--
|
|
2364
|
-
<div style="
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
<div style="
|
|
2376
|
-
display: flex; align-items: center; justify-content: space-between;
|
|
2377
|
-
padding: 16px 20px;
|
|
2378
|
-
border-bottom: 1px solid ${D.divider};
|
|
2379
|
-
">
|
|
2380
|
-
<span style="font-size: 14px; color: ${D.textSecondary};">${t.productLabel}</span>
|
|
2381
|
-
<span style="font-size: 14px; font-weight: 600; color: ${D.textWhite};">${this.escapeHtml(productName)}</span>
|
|
2367
|
+
<!-- 订单详情卡片(order-popups: rounded-xl border border-white/5,上 part surface,下 part surfaceHighlight) -->
|
|
2368
|
+
<div style="
|
|
2369
|
+
border-radius: ${D.radiusInner};
|
|
2370
|
+
overflow: hidden;
|
|
2371
|
+
border: 1px solid ${D.borderSubtle};
|
|
2372
|
+
margin-bottom: 32px;
|
|
2373
|
+
">
|
|
2374
|
+
<!-- 上:Product + Quantity -->
|
|
2375
|
+
<div style="background: ${D.bgSurface}; padding: 20px; display: flex; flex-direction: column; gap: 16px;">
|
|
2376
|
+
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
|
|
2377
|
+
<span style="color: ${D.textMuted}; min-width: 64px;">${t.productLabel}</span>
|
|
2378
|
+
<span style="color: ${D.textWhite}; font-weight: 500; text-align: right; word-break: break-word;">${this.escapeHtml(productName)}</span>
|
|
2382
2379
|
</div>
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
display: flex; align-items: center; justify-content: space-between;
|
|
2387
|
-
padding: 16px 20px;
|
|
2388
|
-
border-bottom: 1px solid ${D.divider};
|
|
2389
|
-
">
|
|
2390
|
-
<span style="font-size: 14px; color: ${D.textSecondary};">${t.amountLabel}</span>
|
|
2391
|
-
<span style="font-size: 14px; font-weight: 600; color: ${D.textWhite};">${discountPrice}</span>
|
|
2380
|
+
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
|
|
2381
|
+
<span style="color: ${D.textMuted}; min-width: 64px;">${t.quantityLabel}</span>
|
|
2382
|
+
<span style="color: ${D.textWhite}; font-weight: 500; text-align: right;">${purchaseAmount.toLocaleString()}</span>
|
|
2392
2383
|
</div>
|
|
2393
|
-
|
|
2394
2384
|
${bonusAmount ? `
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
padding: 16px 20px;
|
|
2399
|
-
border-bottom: 1px solid ${D.divider};
|
|
2400
|
-
">
|
|
2401
|
-
<span style="font-size: 14px; color: ${D.textSecondary};">${t.bonusLabel}</span>
|
|
2402
|
-
<span style="font-size: 14px; font-weight: 600; color: ${D.textWhite};">${bonusAmount.toLocaleString()}</span>
|
|
2385
|
+
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
|
|
2386
|
+
<span style="color: ${D.textMuted}; min-width: 64px;">${t.bonusLabel}</span>
|
|
2387
|
+
<span style="color: ${D.textWhite}; font-weight: 500; text-align: right;">${bonusAmount.toLocaleString()}</span>
|
|
2403
2388
|
</div>
|
|
2404
2389
|
` : ''}
|
|
2405
|
-
|
|
2406
|
-
|
|
2390
|
+
</div>
|
|
2391
|
+
<!-- 下:Price(图片:大号绿色金额) -->
|
|
2392
|
+
<div style="
|
|
2393
|
+
background: ${D.bgSurfaceHighlight};
|
|
2394
|
+
padding: 20px;
|
|
2395
|
+
display: flex;
|
|
2396
|
+
justify-content: space-between;
|
|
2397
|
+
align-items: center;
|
|
2398
|
+
border-top: 1px solid ${D.borderSubtle};
|
|
2399
|
+
">
|
|
2400
|
+
<span style="font-size: 14px; color: ${D.textMuted}">${t.priceLabel}</span>
|
|
2401
|
+
<span style="font-size: 24px; font-weight: 700; color: ${D.brandGreen}; letter-spacing: 0.02em;">${this.escapeHtml(discountPrice)}</span>
|
|
2407
2402
|
</div>
|
|
2408
2403
|
</div>
|
|
2409
2404
|
|
|
2410
|
-
<!--
|
|
2411
|
-
<div style="display:
|
|
2405
|
+
<!-- 按钮组(order-popups: grid grid-cols-2 gap-4, Cancel=white/5 border, Pay=#10b981) -->
|
|
2406
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 16px;">
|
|
2412
2407
|
<button type="button" id="retention-cancel-btn" style="
|
|
2413
|
-
flex: 1;
|
|
2414
2408
|
padding: 14px 20px;
|
|
2415
2409
|
border-radius: ${D.radiusBtn};
|
|
2416
|
-
border: 1px solid rgba(255,255,255,0.
|
|
2417
|
-
background:
|
|
2418
|
-
color: ${D.
|
|
2419
|
-
font-size:
|
|
2420
|
-
font-weight:
|
|
2410
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
2411
|
+
background: rgba(255,255,255,0.05);
|
|
2412
|
+
color: ${D.textMuted};
|
|
2413
|
+
font-size: 14px;
|
|
2414
|
+
font-weight: 500;
|
|
2421
2415
|
cursor: pointer;
|
|
2422
|
-
transition:
|
|
2416
|
+
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
2423
2417
|
">${t.cancelBtn}</button>
|
|
2424
|
-
|
|
2425
2418
|
<button type="button" id="retention-continue-btn" style="
|
|
2426
|
-
flex: 1;
|
|
2427
2419
|
padding: 14px 20px;
|
|
2428
2420
|
border-radius: ${D.radiusBtn};
|
|
2429
2421
|
border: none;
|
|
2430
|
-
background: ${D.
|
|
2431
|
-
color: #
|
|
2432
|
-
font-size:
|
|
2422
|
+
background: ${D.brandGreen};
|
|
2423
|
+
color: #000000;
|
|
2424
|
+
font-size: 14px;
|
|
2433
2425
|
font-weight: 700;
|
|
2434
2426
|
cursor: pointer;
|
|
2435
|
-
transition:
|
|
2436
|
-
box-shadow: 0 4px 16px ${D.accentTealShadow};
|
|
2427
|
+
transition: box-shadow 0.2s, transform 0.1s;
|
|
2437
2428
|
">${t.continueBtn}</button>
|
|
2438
2429
|
</div>
|
|
2439
2430
|
`;
|
|
@@ -2468,20 +2459,20 @@ class RetentionModal {
|
|
|
2468
2459
|
}
|
|
2469
2460
|
|
|
2470
2461
|
#retention-modal-close-btn:hover {
|
|
2471
|
-
background: rgba(255,255,255,0.
|
|
2472
|
-
color: #
|
|
2473
|
-
transform: rotate(90deg);
|
|
2462
|
+
background: rgba(255,255,255,0.05) !important;
|
|
2463
|
+
color: #FFFFFF !important;
|
|
2474
2464
|
}
|
|
2475
2465
|
#retention-cancel-btn:hover {
|
|
2476
|
-
background: rgba(255,255,255,0.
|
|
2477
|
-
|
|
2466
|
+
background: rgba(255,255,255,0.1) !important;
|
|
2467
|
+
color: #FFFFFF !important;
|
|
2468
|
+
border-color: rgba(255,255,255,0.1) !important;
|
|
2478
2469
|
}
|
|
2479
2470
|
#retention-continue-btn:hover {
|
|
2480
|
-
box-shadow: 0
|
|
2481
|
-
transform:
|
|
2471
|
+
box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
|
|
2472
|
+
transform: scale(1.02);
|
|
2482
2473
|
}
|
|
2483
2474
|
#retention-continue-btn:active {
|
|
2484
|
-
transform:
|
|
2475
|
+
transform: scale(0.98);
|
|
2485
2476
|
}
|
|
2486
2477
|
`;
|
|
2487
2478
|
document.head.appendChild(style);
|
|
@@ -3761,8 +3752,9 @@ class PurchaseSuccessModal {
|
|
|
3761
3752
|
*/
|
|
3762
3753
|
createModal() {
|
|
3763
3754
|
const { data, language } = this.options;
|
|
3764
|
-
const
|
|
3765
|
-
|
|
3755
|
+
const lang = language ?? 'en';
|
|
3756
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
3757
|
+
// 创建遮罩层(与 order-popups 一致:纯黑底)
|
|
3766
3758
|
this.overlay = document.createElement('div');
|
|
3767
3759
|
this.overlay.id = 'purchase-success-modal-overlay';
|
|
3768
3760
|
this.overlay.style.cssText = `
|
|
@@ -3773,21 +3765,24 @@ class PurchaseSuccessModal {
|
|
|
3773
3765
|
align-items: center;
|
|
3774
3766
|
justify-content: center;
|
|
3775
3767
|
padding: 20px;
|
|
3776
|
-
background: rgba(
|
|
3768
|
+
background: rgba(0, 0, 0, 0.85);
|
|
3777
3769
|
backdrop-filter: blur(8px);
|
|
3778
3770
|
animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
3779
3771
|
overflow: hidden;
|
|
3780
3772
|
`;
|
|
3781
|
-
//
|
|
3773
|
+
// 创建弹窗卡片(order-popups: dark-card #121212, rounded-[24px], border dark-border)
|
|
3782
3774
|
this.modal = document.createElement('div');
|
|
3783
3775
|
this.modal.style.cssText = `
|
|
3784
3776
|
position: relative;
|
|
3785
3777
|
width: 90vw;
|
|
3786
|
-
max-width:
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3778
|
+
max-width: 500px;
|
|
3779
|
+
min-width: 420px;
|
|
3780
|
+
border-radius: 24px;
|
|
3781
|
+
background: #121212;
|
|
3782
|
+
border: 1px solid rgba(44, 44, 46, 0.6);
|
|
3783
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
3790
3784
|
animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
3785
|
+
overflow: hidden;
|
|
3791
3786
|
`;
|
|
3792
3787
|
this.modal.innerHTML = this.getModalHTML(data, isZh);
|
|
3793
3788
|
this.overlay.appendChild(this.modal);
|
|
@@ -3806,211 +3801,121 @@ class PurchaseSuccessModal {
|
|
|
3806
3801
|
message: '感谢您的购买。您的积分已成功添加到账户中。',
|
|
3807
3802
|
packLabel: '套餐名称',
|
|
3808
3803
|
creditsLabel: '积分数量',
|
|
3809
|
-
amountLabel: '支付金额'
|
|
3810
|
-
badge: '已支付',
|
|
3811
|
-
} : {
|
|
3804
|
+
amountLabel: '支付金额'} : {
|
|
3812
3805
|
title: 'Purchase Successful!',
|
|
3813
3806
|
subtitle: 'Your credits have been added',
|
|
3814
3807
|
greeting: 'Hi there,',
|
|
3815
3808
|
message: 'Thank you for your purchase. Your credits have been successfully added to your account.',
|
|
3816
3809
|
packLabel: 'Package',
|
|
3817
3810
|
creditsLabel: 'Credits',
|
|
3818
|
-
amountLabel: 'Amount'
|
|
3819
|
-
badge: 'PAID',
|
|
3820
|
-
};
|
|
3811
|
+
amountLabel: 'Amount'};
|
|
3821
3812
|
const currency = getCurrencySymbol(data.currency || 'USD');
|
|
3813
|
+
const creditsText = isZh ? `${data.credits.toLocaleString()} 积分` : `${data.credits.toLocaleString()} Credits`;
|
|
3822
3814
|
return `
|
|
3823
|
-
<!--
|
|
3815
|
+
<!-- 关闭按钮(order-popups: top-5 right-5, rounded-full, text-dark-muted, hover:bg-white/5) -->
|
|
3824
3816
|
<button
|
|
3825
3817
|
type="button"
|
|
3826
3818
|
id="success-modal-close-btn"
|
|
3827
3819
|
style="
|
|
3828
3820
|
position: absolute;
|
|
3829
|
-
top:
|
|
3830
|
-
right:
|
|
3821
|
+
top: 20px;
|
|
3822
|
+
right: 20px;
|
|
3831
3823
|
z-index: 10;
|
|
3832
3824
|
display: flex;
|
|
3833
|
-
width:
|
|
3834
|
-
height:
|
|
3825
|
+
width: 40px;
|
|
3826
|
+
height: 40px;
|
|
3835
3827
|
align-items: center;
|
|
3836
3828
|
justify-content: center;
|
|
3837
3829
|
border-radius: 50%;
|
|
3838
|
-
background:
|
|
3839
|
-
color:
|
|
3830
|
+
background: transparent;
|
|
3831
|
+
color: #A1A1AA;
|
|
3840
3832
|
border: none;
|
|
3841
3833
|
cursor: pointer;
|
|
3842
|
-
transition:
|
|
3834
|
+
transition: color 0.2s, background 0.2s;
|
|
3843
3835
|
"
|
|
3844
3836
|
>
|
|
3845
|
-
<svg width="
|
|
3846
|
-
<
|
|
3837
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
3838
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
3839
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
3847
3840
|
</svg>
|
|
3848
3841
|
</button>
|
|
3849
3842
|
|
|
3850
|
-
<!--
|
|
3843
|
+
<!-- 成功状态与标题(与图片一致:大号绿色勾 + 紧凑布局) -->
|
|
3851
3844
|
<div style="
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3845
|
+
display: flex;
|
|
3846
|
+
flex-direction: column;
|
|
3847
|
+
align-items: center;
|
|
3855
3848
|
text-align: center;
|
|
3849
|
+
padding: 32px 24px 24px;
|
|
3856
3850
|
">
|
|
3857
|
-
<!-- Success Icon -->
|
|
3851
|
+
<!-- Success Icon:绿色实心圆 + 白色勾 -->
|
|
3858
3852
|
<div style="
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3853
|
+
width: 72px;
|
|
3854
|
+
height: 72px;
|
|
3855
|
+
margin-bottom: 20px;
|
|
3862
3856
|
animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
3863
3857
|
">
|
|
3864
|
-
<svg width="
|
|
3865
|
-
<circle cx="
|
|
3866
|
-
<
|
|
3867
|
-
<path d="M28 40L36 48L52 32" stroke="#10B981" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
|
|
3858
|
+
<svg width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
3859
|
+
<circle cx="36" cy="36" r="36" fill="#52AD5F"/>
|
|
3860
|
+
<path d="M22 36 L32 46 L50 26" stroke="#FFFFFF" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3868
3861
|
</svg>
|
|
3869
3862
|
</div>
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
margin: 0 0 6px;
|
|
3874
|
-
font-size: 24px;
|
|
3863
|
+
<h1 style="
|
|
3864
|
+
margin: 0 0 12px;
|
|
3865
|
+
font-size: 28px;
|
|
3875
3866
|
font-weight: 700;
|
|
3876
|
-
color:
|
|
3877
|
-
|
|
3878
|
-
">${texts.title}</
|
|
3879
|
-
|
|
3880
|
-
<!-- Subtitle -->
|
|
3867
|
+
color: #FFFFFF;
|
|
3868
|
+
letter-spacing: 0.02em;
|
|
3869
|
+
">${texts.title}</h1>
|
|
3881
3870
|
<p style="
|
|
3882
3871
|
margin: 0;
|
|
3883
|
-
font-size:
|
|
3884
|
-
color:
|
|
3885
|
-
animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
|
|
3872
|
+
font-size: 16px;
|
|
3873
|
+
color: #A1A1AA;
|
|
3886
3874
|
">${texts.subtitle}</p>
|
|
3887
3875
|
</div>
|
|
3888
3876
|
|
|
3889
|
-
<!--
|
|
3890
|
-
<div style="
|
|
3891
|
-
|
|
3877
|
+
<!-- 详情卡片(order-popups: bg-dark-surface/50, rounded-xl, border border-white/5) -->
|
|
3878
|
+
<div style="
|
|
3879
|
+
margin: 0 24px 24px;
|
|
3880
|
+
padding: 20px;
|
|
3881
|
+
border-radius: 12px;
|
|
3882
|
+
background: rgba(30, 30, 30, 0.5);
|
|
3883
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
3884
|
+
">
|
|
3885
|
+
<!-- 问候语(border-b border-white/10) -->
|
|
3892
3886
|
<div style="
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
background: #1e293b;
|
|
3897
|
-
animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
|
|
3887
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
3888
|
+
padding-bottom: 16px;
|
|
3889
|
+
margin-bottom: 16px;
|
|
3898
3890
|
">
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
color: #10B981;
|
|
3913
|
-
">
|
|
3914
|
-
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
|
|
3915
|
-
<path d="M12 2L2 7L12 12L22 7L12 2Z" fill="currentColor" opacity="0.3" />
|
|
3916
|
-
<path d="M2 17L12 22L22 17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
3917
|
-
<path d="M2 12L12 17L22 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
3918
|
-
</svg>
|
|
3919
|
-
<span style="
|
|
3920
|
-
font-size: 15px;
|
|
3921
|
-
font-weight: 600;
|
|
3922
|
-
">SeaVerse</span>
|
|
3923
|
-
</div>
|
|
3924
|
-
<div style="
|
|
3925
|
-
border-radius: 9999px;
|
|
3926
|
-
border: 1px solid rgba(168, 85, 247, 0.3);
|
|
3927
|
-
background: rgba(168, 85, 247, 0.1);
|
|
3928
|
-
padding: 4px 12px;
|
|
3929
|
-
font-size: 11px;
|
|
3930
|
-
font-weight: 500;
|
|
3931
|
-
color: #a855f7;
|
|
3932
|
-
">${texts.badge}</div>
|
|
3933
|
-
</div>
|
|
3891
|
+
<h2 style="
|
|
3892
|
+
margin: 0 0 8px;
|
|
3893
|
+
font-size: 18px;
|
|
3894
|
+
font-weight: 600;
|
|
3895
|
+
color: #FFFFFF;
|
|
3896
|
+
">${texts.greeting}</h2>
|
|
3897
|
+
<p style="
|
|
3898
|
+
margin: 0;
|
|
3899
|
+
font-size: 14px;
|
|
3900
|
+
line-height: 1.6;
|
|
3901
|
+
color: #A1A1AA;
|
|
3902
|
+
">${texts.message}</p>
|
|
3903
|
+
</div>
|
|
3934
3904
|
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
<p style="
|
|
3941
|
-
margin: 0 0 8px;
|
|
3942
|
-
font-size: 13px;
|
|
3943
|
-
font-weight: 600;
|
|
3944
|
-
color: rgba(255, 255, 255, 0.9);
|
|
3945
|
-
">${texts.greeting}</p>
|
|
3946
|
-
<p style="
|
|
3947
|
-
margin: 0;
|
|
3948
|
-
font-size: 12px;
|
|
3949
|
-
line-height: 1.6;
|
|
3950
|
-
color: rgba(255, 255, 255, 0.7);
|
|
3951
|
-
">${texts.message}</p>
|
|
3905
|
+
<!-- 套餐/积分/金额行(order-popups: space-y-4, label muted, value white/right, amount 绿色) -->
|
|
3906
|
+
<div style="display: flex; flex-direction: column; gap: 16px;">
|
|
3907
|
+
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
|
|
3908
|
+
<span style="color: #A1A1AA;">${texts.packLabel}</span>
|
|
3909
|
+
<span style="color: #FFFFFF; font-weight: 500; text-align: right;">${this.escapeHtml(data.packName)}</span>
|
|
3952
3910
|
</div>
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
">
|
|
3959
|
-
<
|
|
3960
|
-
|
|
3961
|
-
align-items: center;
|
|
3962
|
-
justify-content: space-between;
|
|
3963
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
3964
|
-
padding: 12px 0;
|
|
3965
|
-
">
|
|
3966
|
-
<span style="
|
|
3967
|
-
font-size: 12px;
|
|
3968
|
-
font-weight: 500;
|
|
3969
|
-
color: rgba(255, 255, 255, 0.6);
|
|
3970
|
-
">${texts.packLabel}</span>
|
|
3971
|
-
<span style="
|
|
3972
|
-
font-size: 13px;
|
|
3973
|
-
font-weight: 600;
|
|
3974
|
-
color: rgba(255, 255, 255, 0.95);
|
|
3975
|
-
">${this.escapeHtml(data.packName)}</span>
|
|
3976
|
-
</div>
|
|
3977
|
-
<div style="
|
|
3978
|
-
display: flex;
|
|
3979
|
-
align-items: center;
|
|
3980
|
-
justify-content: space-between;
|
|
3981
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
3982
|
-
padding: 12px 0;
|
|
3983
|
-
">
|
|
3984
|
-
<span style="
|
|
3985
|
-
font-size: 12px;
|
|
3986
|
-
font-weight: 500;
|
|
3987
|
-
color: rgba(255, 255, 255, 0.6);
|
|
3988
|
-
">${texts.creditsLabel}</span>
|
|
3989
|
-
<span style="
|
|
3990
|
-
font-size: 13px;
|
|
3991
|
-
font-weight: 600;
|
|
3992
|
-
color: rgba(255, 255, 255, 0.95);
|
|
3993
|
-
">${data.credits.toLocaleString()} Credits</span>
|
|
3994
|
-
</div>
|
|
3995
|
-
<div style="
|
|
3996
|
-
display: flex;
|
|
3997
|
-
align-items: center;
|
|
3998
|
-
justify-content: space-between;
|
|
3999
|
-
background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
|
|
4000
|
-
margin: 0 -16px;
|
|
4001
|
-
padding: 12px 16px;
|
|
4002
|
-
">
|
|
4003
|
-
<span style="
|
|
4004
|
-
font-size: 12px;
|
|
4005
|
-
font-weight: 500;
|
|
4006
|
-
color: rgba(255, 255, 255, 0.6);
|
|
4007
|
-
">${texts.amountLabel}</span>
|
|
4008
|
-
<span style="
|
|
4009
|
-
font-size: 16px;
|
|
4010
|
-
font-weight: 600;
|
|
4011
|
-
color: #10B981;
|
|
4012
|
-
">${currency}${this.escapeHtml(data.amount)}</span>
|
|
4013
|
-
</div>
|
|
3911
|
+
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
|
|
3912
|
+
<span style="color: #A1A1AA;">${texts.creditsLabel}</span>
|
|
3913
|
+
<span style="color: #FFFFFF; font-weight: 500; text-align: right;">${creditsText}</span>
|
|
3914
|
+
</div>
|
|
3915
|
+
<div style="height: 1px; background: rgba(255, 255, 255, 0.1); margin: 4px 0;"></div>
|
|
3916
|
+
<div style="display: flex; justify-content: space-between; align-items: center; padding-top: 4px;">
|
|
3917
|
+
<span style="font-size: 14px; color: #A1A1AA;">${texts.amountLabel}</span>
|
|
3918
|
+
<span style="font-size: 20px; font-weight: 700; color: #10B981; letter-spacing: 0.02em;">${currency}${this.escapeHtml(data.amount)}</span>
|
|
4014
3919
|
</div>
|
|
4015
3920
|
</div>
|
|
4016
3921
|
</div>
|
|
@@ -4089,9 +3994,8 @@ class PurchaseSuccessModal {
|
|
|
4089
3994
|
}
|
|
4090
3995
|
|
|
4091
3996
|
#success-modal-close-btn:hover {
|
|
4092
|
-
background: rgba(255, 255, 255, 0.
|
|
4093
|
-
color:
|
|
4094
|
-
transform: rotate(90deg);
|
|
3997
|
+
background: rgba(255, 255, 255, 0.05) !important;
|
|
3998
|
+
color: #FFFFFF !important;
|
|
4095
3999
|
}
|
|
4096
4000
|
`;
|
|
4097
4001
|
document.head.appendChild(style);
|
|
@@ -4514,7 +4418,7 @@ class BasePackageModal {
|
|
|
4514
4418
|
* Cleanup resources
|
|
4515
4419
|
*/
|
|
4516
4420
|
cleanup() {
|
|
4517
|
-
console.log(`[${this.constructor.name}] Cleaning up...`);
|
|
4421
|
+
// console.log(`[${this.constructor.name}] Cleaning up...`);
|
|
4518
4422
|
// Remove resize listener
|
|
4519
4423
|
if (this.resizeHandler) {
|
|
4520
4424
|
window.removeEventListener('resize', this.resizeHandler);
|
|
@@ -5141,8 +5045,9 @@ class PaymentVerificationModal {
|
|
|
5141
5045
|
* 创建弹窗元素
|
|
5142
5046
|
*/
|
|
5143
5047
|
createModal() {
|
|
5144
|
-
const
|
|
5145
|
-
|
|
5048
|
+
const lang = this.options.language ?? 'en';
|
|
5049
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
5050
|
+
// 遮罩(与 PurchaseSuccessModal 一致)
|
|
5146
5051
|
this.overlay = document.createElement('div');
|
|
5147
5052
|
this.overlay.id = 'payment-verification-modal-overlay';
|
|
5148
5053
|
this.overlay.style.cssText = `
|
|
@@ -5153,20 +5058,21 @@ class PaymentVerificationModal {
|
|
|
5153
5058
|
align-items: center;
|
|
5154
5059
|
justify-content: center;
|
|
5155
5060
|
padding: 20px;
|
|
5156
|
-
background: rgba(
|
|
5157
|
-
backdrop-filter: blur(
|
|
5158
|
-
animation: fadeIn 0.
|
|
5061
|
+
background: rgba(0, 0, 0, 0.85);
|
|
5062
|
+
backdrop-filter: blur(8px);
|
|
5063
|
+
animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
5159
5064
|
overflow: hidden;
|
|
5160
5065
|
`;
|
|
5161
|
-
//
|
|
5066
|
+
// 弹窗卡片(PurchaseSuccessModal 风格)
|
|
5162
5067
|
this.modal = document.createElement('div');
|
|
5163
5068
|
this.modal.style.cssText = `
|
|
5164
5069
|
position: relative;
|
|
5165
5070
|
width: 90vw;
|
|
5166
|
-
max-width:
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5071
|
+
max-width: 500px;
|
|
5072
|
+
min-width: 420px;
|
|
5073
|
+
border-radius: 24px;
|
|
5074
|
+
background: #121212;
|
|
5075
|
+
border: 1px solid rgba(44, 44, 46, 0.6);
|
|
5170
5076
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
5171
5077
|
animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
5172
5078
|
overflow: hidden;
|
|
@@ -5184,52 +5090,50 @@ class PaymentVerificationModal {
|
|
|
5184
5090
|
const texts = this.getTexts(isZh);
|
|
5185
5091
|
const paymentType = this.options.paymentMethodName || 'Debit/Credit Card';
|
|
5186
5092
|
return `
|
|
5187
|
-
<!--
|
|
5093
|
+
<!-- 关闭按钮(与 PurchaseSuccessModal 一致) -->
|
|
5188
5094
|
<button
|
|
5189
5095
|
type="button"
|
|
5190
5096
|
id="verification-modal-close-btn"
|
|
5191
5097
|
style="
|
|
5192
5098
|
position: absolute;
|
|
5193
|
-
top:
|
|
5194
|
-
right:
|
|
5099
|
+
top: 20px;
|
|
5100
|
+
right: 20px;
|
|
5195
5101
|
z-index: 10;
|
|
5196
5102
|
display: flex;
|
|
5197
|
-
width:
|
|
5198
|
-
height:
|
|
5103
|
+
width: 40px;
|
|
5104
|
+
height: 40px;
|
|
5199
5105
|
align-items: center;
|
|
5200
5106
|
justify-content: center;
|
|
5201
5107
|
border-radius: 50%;
|
|
5202
|
-
background:
|
|
5203
|
-
color:
|
|
5108
|
+
background: transparent;
|
|
5109
|
+
color: #A1A1AA;
|
|
5204
5110
|
border: none;
|
|
5205
5111
|
cursor: pointer;
|
|
5206
|
-
transition:
|
|
5112
|
+
transition: color 0.2s, background 0.2s;
|
|
5207
5113
|
"
|
|
5208
5114
|
>
|
|
5209
|
-
<svg width="
|
|
5210
|
-
<
|
|
5115
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5116
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
5117
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
5211
5118
|
</svg>
|
|
5212
5119
|
</button>
|
|
5213
5120
|
|
|
5214
5121
|
<!-- 内容区域 -->
|
|
5215
|
-
<div style="padding:
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
margin: 0 0 12px;
|
|
5122
|
+
<div style="padding: 24px 24px 24px;">
|
|
5123
|
+
<h1 style="
|
|
5124
|
+
margin: 0 0 8px;
|
|
5219
5125
|
font-size: 24px;
|
|
5220
5126
|
font-weight: 700;
|
|
5221
|
-
color: #
|
|
5127
|
+
color: #FFFFFF;
|
|
5222
5128
|
text-align: center;
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
">${texts.title} ${paymentType}</h2>
|
|
5129
|
+
letter-spacing: -0.02em;
|
|
5130
|
+
">${texts.title} ${paymentType}</h1>
|
|
5226
5131
|
|
|
5227
|
-
<!-- 提示文本 -->
|
|
5228
5132
|
<p style="
|
|
5229
5133
|
margin: 0 0 20px;
|
|
5230
|
-
font-size:
|
|
5134
|
+
font-size: 14px;
|
|
5231
5135
|
line-height: 1.6;
|
|
5232
|
-
color:
|
|
5136
|
+
color: #A1A1AA;
|
|
5233
5137
|
text-align: center;
|
|
5234
5138
|
">${texts.message}</p>
|
|
5235
5139
|
|
|
@@ -5238,16 +5142,19 @@ class PaymentVerificationModal {
|
|
|
5238
5142
|
position: relative;
|
|
5239
5143
|
margin: 0 0 24px;
|
|
5240
5144
|
min-height: 56px;
|
|
5145
|
+
padding: 16px;
|
|
5146
|
+
border-radius: 12px;
|
|
5147
|
+
background: rgba(30, 30, 30, 0.5);
|
|
5148
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
5241
5149
|
">
|
|
5242
5150
|
<p style="
|
|
5243
5151
|
margin: 0;
|
|
5244
5152
|
font-size: 13px;
|
|
5245
5153
|
line-height: 1.7;
|
|
5246
|
-
color:
|
|
5154
|
+
color: #A1A1AA;
|
|
5247
5155
|
text-align: center;
|
|
5248
5156
|
">${texts.helpText}</p>
|
|
5249
5157
|
|
|
5250
|
-
<!-- 加载状态遮罩(默认隐藏,Processing 时显示) -->
|
|
5251
5158
|
<div id="verification-loading-overlay" style="
|
|
5252
5159
|
display: none;
|
|
5253
5160
|
position: absolute;
|
|
@@ -5255,71 +5162,47 @@ class PaymentVerificationModal {
|
|
|
5255
5162
|
align-items: center;
|
|
5256
5163
|
justify-content: center;
|
|
5257
5164
|
gap: 12px;
|
|
5258
|
-
background: rgba(
|
|
5259
|
-
backdrop-filter: blur(
|
|
5260
|
-
border-radius:
|
|
5165
|
+
background: rgba(18, 18, 18, 0.92);
|
|
5166
|
+
backdrop-filter: blur(4px);
|
|
5167
|
+
border-radius: 12px;
|
|
5261
5168
|
">
|
|
5262
5169
|
<div id="verification-spinner" style="
|
|
5263
5170
|
width: 24px;
|
|
5264
5171
|
height: 24px;
|
|
5265
|
-
border: 3px solid rgba(
|
|
5266
|
-
border-top-color: #
|
|
5172
|
+
border: 3px solid rgba(16, 185, 129, 0.25);
|
|
5173
|
+
border-top-color: #10B981;
|
|
5267
5174
|
border-radius: 50%;
|
|
5268
5175
|
animation: verificationSpin 0.8s linear infinite;
|
|
5269
5176
|
flex-shrink: 0;
|
|
5270
5177
|
"></div>
|
|
5271
|
-
<span style="
|
|
5272
|
-
font-size: 14px;
|
|
5273
|
-
color: rgba(255, 255, 255, 0.8);
|
|
5274
|
-
white-space: nowrap;
|
|
5275
|
-
">${texts.checkingStatus}</span>
|
|
5178
|
+
<span style="font-size: 14px; color: #A1A1AA; white-space: nowrap;">${texts.checkingStatus}</span>
|
|
5276
5179
|
</div>
|
|
5277
5180
|
</div>
|
|
5278
5181
|
|
|
5279
|
-
<!--
|
|
5280
|
-
<div style="
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
>${texts.
|
|
5303
|
-
|
|
5304
|
-
<!-- Complete Payment / Processing 按钮 -->
|
|
5305
|
-
<button
|
|
5306
|
-
type="button"
|
|
5307
|
-
id="verification-complete-btn"
|
|
5308
|
-
style="
|
|
5309
|
-
flex: 1;
|
|
5310
|
-
max-width: 240px;
|
|
5311
|
-
height: 48px;
|
|
5312
|
-
border-radius: 10px;
|
|
5313
|
-
border: none;
|
|
5314
|
-
background: linear-gradient(135deg, #0d9488 0%, #3b82f6 100%);
|
|
5315
|
-
color: white;
|
|
5316
|
-
font-size: 15px;
|
|
5317
|
-
font-weight: 600;
|
|
5318
|
-
cursor: pointer;
|
|
5319
|
-
transition: all 0.2s;
|
|
5320
|
-
box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
|
|
5321
|
-
"
|
|
5322
|
-
>${texts.completeButton}</button>
|
|
5182
|
+
<!-- 按钮组(与 PurchaseSuccessModal 一致) -->
|
|
5183
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 16px;">
|
|
5184
|
+
<button type="button" id="verification-cancel-btn" style="
|
|
5185
|
+
padding: 14px 20px;
|
|
5186
|
+
border-radius: 12px;
|
|
5187
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
5188
|
+
background: rgba(255,255,255,0.05);
|
|
5189
|
+
color: #A1A1AA;
|
|
5190
|
+
font-size: 14px;
|
|
5191
|
+
font-weight: 500;
|
|
5192
|
+
cursor: pointer;
|
|
5193
|
+
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
5194
|
+
">${texts.cancelButton}</button>
|
|
5195
|
+
<button type="button" id="verification-complete-btn" style="
|
|
5196
|
+
padding: 14px 20px;
|
|
5197
|
+
border-radius: 12px;
|
|
5198
|
+
border: none;
|
|
5199
|
+
background: #10B981;
|
|
5200
|
+
color: #000000;
|
|
5201
|
+
font-size: 14px;
|
|
5202
|
+
font-weight: 700;
|
|
5203
|
+
cursor: pointer;
|
|
5204
|
+
transition: box-shadow 0.2s, transform 0.1s;
|
|
5205
|
+
">${texts.completeButton}</button>
|
|
5323
5206
|
</div>
|
|
5324
5207
|
</div>
|
|
5325
5208
|
`;
|
|
@@ -5397,24 +5280,23 @@ class PaymentVerificationModal {
|
|
|
5397
5280
|
}
|
|
5398
5281
|
|
|
5399
5282
|
#verification-modal-close-btn:hover {
|
|
5400
|
-
background: rgba(255, 255, 255, 0.
|
|
5401
|
-
color:
|
|
5402
|
-
transform: rotate(90deg);
|
|
5283
|
+
background: rgba(255, 255, 255, 0.05) !important;
|
|
5284
|
+
color: #FFFFFF !important;
|
|
5403
5285
|
}
|
|
5404
5286
|
|
|
5405
5287
|
#verification-cancel-btn:hover {
|
|
5406
|
-
background: rgba(255, 255, 255, 0.
|
|
5407
|
-
|
|
5288
|
+
background: rgba(255, 255, 255, 0.1) !important;
|
|
5289
|
+
color: #FFFFFF !important;
|
|
5290
|
+
border-color: rgba(255, 255, 255, 0.1) !important;
|
|
5408
5291
|
}
|
|
5409
5292
|
|
|
5410
5293
|
#verification-complete-btn:hover {
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
transform: translateY(-1px);
|
|
5294
|
+
box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
|
|
5295
|
+
transform: scale(1.02);
|
|
5414
5296
|
}
|
|
5415
5297
|
|
|
5416
5298
|
#verification-complete-btn:active {
|
|
5417
|
-
transform:
|
|
5299
|
+
transform: scale(0.98);
|
|
5418
5300
|
}
|
|
5419
5301
|
`;
|
|
5420
5302
|
document.head.appendChild(style);
|
|
@@ -5493,7 +5375,8 @@ class PaymentVerificationModal {
|
|
|
5493
5375
|
// 更新按钮文本为 Processing...
|
|
5494
5376
|
const completeBtn = document.getElementById('verification-complete-btn');
|
|
5495
5377
|
if (completeBtn) {
|
|
5496
|
-
const
|
|
5378
|
+
const lang = this.options.language ?? 'en';
|
|
5379
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
5497
5380
|
completeBtn.textContent = isZh ? '处理中...' : 'Processing...';
|
|
5498
5381
|
completeBtn.style.pointerEvents = 'none';
|
|
5499
5382
|
completeBtn.style.opacity = '0.85';
|
|
@@ -5511,7 +5394,8 @@ class PaymentVerificationModal {
|
|
|
5511
5394
|
// 恢复按钮文本
|
|
5512
5395
|
const completeBtn = document.getElementById('verification-complete-btn');
|
|
5513
5396
|
if (completeBtn) {
|
|
5514
|
-
const
|
|
5397
|
+
const lang = this.options.language ?? 'en';
|
|
5398
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
5515
5399
|
completeBtn.textContent = isZh ? '我已完成支付' : 'I\'ve Completed Payment';
|
|
5516
5400
|
completeBtn.style.pointerEvents = '';
|
|
5517
5401
|
completeBtn.style.opacity = '';
|
|
@@ -5635,8 +5519,9 @@ class PaymentFailedModal {
|
|
|
5635
5519
|
*/
|
|
5636
5520
|
createModal() {
|
|
5637
5521
|
const { language } = this.options;
|
|
5638
|
-
const
|
|
5639
|
-
|
|
5522
|
+
const lang = language ?? 'en';
|
|
5523
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
5524
|
+
// 遮罩(与 PurchaseSuccessModal 一致)
|
|
5640
5525
|
this.overlay = document.createElement('div');
|
|
5641
5526
|
this.overlay.id = 'payment-failed-modal-overlay';
|
|
5642
5527
|
this.overlay.style.cssText = `
|
|
@@ -5647,20 +5532,21 @@ class PaymentFailedModal {
|
|
|
5647
5532
|
align-items: center;
|
|
5648
5533
|
justify-content: center;
|
|
5649
5534
|
padding: 20px;
|
|
5650
|
-
background: rgba(
|
|
5651
|
-
backdrop-filter: blur(
|
|
5652
|
-
animation: fadeIn 0.
|
|
5535
|
+
background: rgba(0, 0, 0, 0.85);
|
|
5536
|
+
backdrop-filter: blur(8px);
|
|
5537
|
+
animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
5653
5538
|
overflow: hidden;
|
|
5654
5539
|
`;
|
|
5655
|
-
//
|
|
5540
|
+
// 弹窗卡片(PurchaseSuccessModal 风格:dark-card #121212, rounded 24px)
|
|
5656
5541
|
this.modal = document.createElement('div');
|
|
5657
5542
|
this.modal.style.cssText = `
|
|
5658
5543
|
position: relative;
|
|
5659
5544
|
width: 90vw;
|
|
5660
|
-
max-width:
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5545
|
+
max-width: 500px;
|
|
5546
|
+
min-width: 420px;
|
|
5547
|
+
border-radius: 24px;
|
|
5548
|
+
background: #121212;
|
|
5549
|
+
border: 1px solid rgba(44, 44, 46, 0.6);
|
|
5664
5550
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
5665
5551
|
animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
5666
5552
|
overflow: hidden;
|
|
@@ -5683,58 +5569,62 @@ class PaymentFailedModal {
|
|
|
5683
5569
|
const hasDetails = !!this.options.details;
|
|
5684
5570
|
const hasRetry = !!this.options.onRetry;
|
|
5685
5571
|
return `
|
|
5686
|
-
<!--
|
|
5572
|
+
<!-- 关闭按钮(与 PurchaseSuccessModal 一致) -->
|
|
5687
5573
|
<button
|
|
5688
5574
|
type="button"
|
|
5689
5575
|
id="failed-modal-close-btn"
|
|
5690
5576
|
style="
|
|
5691
5577
|
position: absolute;
|
|
5692
|
-
top:
|
|
5693
|
-
right:
|
|
5578
|
+
top: 20px;
|
|
5579
|
+
right: 20px;
|
|
5694
5580
|
z-index: 10;
|
|
5695
5581
|
display: flex;
|
|
5696
|
-
width:
|
|
5697
|
-
height:
|
|
5582
|
+
width: 40px;
|
|
5583
|
+
height: 40px;
|
|
5698
5584
|
align-items: center;
|
|
5699
5585
|
justify-content: center;
|
|
5700
5586
|
border-radius: 50%;
|
|
5701
|
-
background:
|
|
5702
|
-
color:
|
|
5587
|
+
background: transparent;
|
|
5588
|
+
color: #A1A1AA;
|
|
5703
5589
|
border: none;
|
|
5704
5590
|
cursor: pointer;
|
|
5705
|
-
transition:
|
|
5591
|
+
transition: color 0.2s, background 0.2s;
|
|
5706
5592
|
"
|
|
5707
5593
|
>
|
|
5708
|
-
<svg width="
|
|
5709
|
-
<
|
|
5594
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5595
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
5596
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
5710
5597
|
</svg>
|
|
5711
5598
|
</button>
|
|
5712
5599
|
|
|
5713
|
-
<!--
|
|
5714
|
-
<div style="padding:
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
margin: 0 0 12px;
|
|
5600
|
+
<!-- 标题与消息 -->
|
|
5601
|
+
<div style="padding: 24px 24px 0;">
|
|
5602
|
+
<h1 style="
|
|
5603
|
+
margin: 0 0 8px;
|
|
5718
5604
|
font-size: 24px;
|
|
5719
5605
|
font-weight: 700;
|
|
5720
|
-
color: #
|
|
5606
|
+
color: #FFFFFF;
|
|
5721
5607
|
text-align: center;
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
">${this.escapeHtml(title)}</h2>
|
|
5725
|
-
|
|
5726
|
-
<!-- 消息 -->
|
|
5608
|
+
letter-spacing: -0.02em;
|
|
5609
|
+
">${this.escapeHtml(title)}</h1>
|
|
5727
5610
|
<p style="
|
|
5728
|
-
margin: 0 0
|
|
5729
|
-
font-size:
|
|
5611
|
+
margin: 0 0 24px;
|
|
5612
|
+
font-size: 14px;
|
|
5730
5613
|
line-height: 1.6;
|
|
5731
|
-
color:
|
|
5614
|
+
color: #A1A1AA;
|
|
5732
5615
|
text-align: center;
|
|
5733
5616
|
">${this.escapeHtml(this.options.message)}</p>
|
|
5617
|
+
</div>
|
|
5734
5618
|
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5619
|
+
<!-- 详情展开/折叠(放入内卡片风格) -->
|
|
5620
|
+
${hasDetails ? `
|
|
5621
|
+
<div style="margin: 0 24px 24px;">
|
|
5622
|
+
<div style="
|
|
5623
|
+
padding: 20px;
|
|
5624
|
+
border-radius: 12px;
|
|
5625
|
+
background: rgba(30, 30, 30, 0.5);
|
|
5626
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
5627
|
+
">
|
|
5738
5628
|
<button
|
|
5739
5629
|
type="button"
|
|
5740
5630
|
id="failed-modal-details-toggle"
|
|
@@ -5744,15 +5634,15 @@ class PaymentFailedModal {
|
|
|
5744
5634
|
align-items: center;
|
|
5745
5635
|
justify-content: center;
|
|
5746
5636
|
gap: 8px;
|
|
5747
|
-
padding: 10px;
|
|
5637
|
+
padding: 10px 12px;
|
|
5748
5638
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
5749
|
-
border-radius:
|
|
5639
|
+
border-radius: 8px;
|
|
5750
5640
|
background: rgba(255, 255, 255, 0.03);
|
|
5751
|
-
color:
|
|
5641
|
+
color: #A1A1AA;
|
|
5752
5642
|
font-size: 13px;
|
|
5753
5643
|
font-weight: 500;
|
|
5754
5644
|
cursor: pointer;
|
|
5755
|
-
transition:
|
|
5645
|
+
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
5756
5646
|
"
|
|
5757
5647
|
>
|
|
5758
5648
|
<span id="failed-modal-details-toggle-text">${detailsToggleText}</span>
|
|
@@ -5771,91 +5661,69 @@ class PaymentFailedModal {
|
|
|
5771
5661
|
<div style="
|
|
5772
5662
|
margin-top: 12px;
|
|
5773
5663
|
padding: 16px;
|
|
5774
|
-
border-radius:
|
|
5775
|
-
background: rgba(239, 68, 68, 0.
|
|
5776
|
-
border: 1px solid rgba(239, 68, 68, 0.
|
|
5664
|
+
border-radius: 8px;
|
|
5665
|
+
background: rgba(239, 68, 68, 0.06);
|
|
5666
|
+
border: 1px solid rgba(239, 68, 68, 0.12);
|
|
5777
5667
|
">
|
|
5778
5668
|
<pre style="
|
|
5779
5669
|
margin: 0;
|
|
5780
|
-
font-family: ui-monospace,
|
|
5670
|
+
font-family: ui-monospace, monospace;
|
|
5781
5671
|
font-size: 12px;
|
|
5782
5672
|
line-height: 1.6;
|
|
5783
|
-
color:
|
|
5673
|
+
color: #A1A1AA;
|
|
5784
5674
|
white-space: pre-wrap;
|
|
5785
5675
|
word-break: break-word;
|
|
5786
5676
|
">${this.escapeHtml(this.options.details || '')}</pre>
|
|
5787
5677
|
</div>
|
|
5788
5678
|
</div>
|
|
5789
5679
|
</div>
|
|
5790
|
-
` : ''}
|
|
5791
|
-
|
|
5792
|
-
<!-- 按钮组 -->
|
|
5793
|
-
<div style="
|
|
5794
|
-
display: flex;
|
|
5795
|
-
gap: 16px;
|
|
5796
|
-
justify-content: center;
|
|
5797
|
-
">
|
|
5798
|
-
${hasRetry ? `
|
|
5799
|
-
<!-- 关闭按钮(有重试时) -->
|
|
5800
|
-
<button
|
|
5801
|
-
type="button"
|
|
5802
|
-
id="failed-modal-close-bottom-btn"
|
|
5803
|
-
style="
|
|
5804
|
-
flex: 1;
|
|
5805
|
-
max-width: 240px;
|
|
5806
|
-
height: 48px;
|
|
5807
|
-
border-radius: 10px;
|
|
5808
|
-
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
5809
|
-
background: transparent;
|
|
5810
|
-
color: rgba(255, 255, 255, 0.8);
|
|
5811
|
-
font-size: 15px;
|
|
5812
|
-
font-weight: 500;
|
|
5813
|
-
cursor: pointer;
|
|
5814
|
-
transition: all 0.2s;
|
|
5815
|
-
"
|
|
5816
|
-
>${closeText}</button>
|
|
5817
|
-
|
|
5818
|
-
<!-- 重试按钮 -->
|
|
5819
|
-
<button
|
|
5820
|
-
type="button"
|
|
5821
|
-
id="failed-modal-retry-btn"
|
|
5822
|
-
style="
|
|
5823
|
-
flex: 1;
|
|
5824
|
-
max-width: 240px;
|
|
5825
|
-
height: 48px;
|
|
5826
|
-
border-radius: 10px;
|
|
5827
|
-
border: none;
|
|
5828
|
-
background: linear-gradient(135deg, #0d9488 0%, #3b82f6 100%);
|
|
5829
|
-
color: white;
|
|
5830
|
-
font-size: 15px;
|
|
5831
|
-
font-weight: 600;
|
|
5832
|
-
cursor: pointer;
|
|
5833
|
-
transition: all 0.2s;
|
|
5834
|
-
box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
|
|
5835
|
-
"
|
|
5836
|
-
>${retryText}</button>
|
|
5837
|
-
` : `
|
|
5838
|
-
<!-- 关闭按钮(无重试时,居中显示) -->
|
|
5839
|
-
<button
|
|
5840
|
-
type="button"
|
|
5841
|
-
id="failed-modal-close-bottom-btn"
|
|
5842
|
-
style="
|
|
5843
|
-
flex: 0;
|
|
5844
|
-
min-width: 160px;
|
|
5845
|
-
max-width: 240px;
|
|
5846
|
-
height: 48px;
|
|
5847
|
-
border-radius: 10px;
|
|
5848
|
-
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
5849
|
-
background: transparent;
|
|
5850
|
-
color: rgba(255, 255, 255, 0.8);
|
|
5851
|
-
font-size: 15px;
|
|
5852
|
-
font-weight: 500;
|
|
5853
|
-
cursor: pointer;
|
|
5854
|
-
transition: all 0.2s;
|
|
5855
|
-
"
|
|
5856
|
-
>${closeText}</button>
|
|
5857
|
-
`}
|
|
5858
5680
|
</div>
|
|
5681
|
+
` : '<div style="margin-bottom: 24px;"></div>'}
|
|
5682
|
+
|
|
5683
|
+
<!-- 按钮组(与 PurchaseSuccessModal / RetentionModal 一致) -->
|
|
5684
|
+
<div style="display: grid; grid-template-columns: ${hasRetry ? '1fr 1fr' : '1fr'}; gap: 16px; padding: 0 24px 24px; justify-items: center;">
|
|
5685
|
+
${hasRetry ? `
|
|
5686
|
+
<button type="button" id="failed-modal-close-bottom-btn" style="
|
|
5687
|
+
width: 100%;
|
|
5688
|
+
max-width: 240px;
|
|
5689
|
+
padding: 14px 20px;
|
|
5690
|
+
border-radius: 12px;
|
|
5691
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
5692
|
+
background: rgba(255,255,255,0.05);
|
|
5693
|
+
color: #A1A1AA;
|
|
5694
|
+
font-size: 14px;
|
|
5695
|
+
font-weight: 500;
|
|
5696
|
+
cursor: pointer;
|
|
5697
|
+
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
5698
|
+
">${closeText}</button>
|
|
5699
|
+
<button type="button" id="failed-modal-retry-btn" style="
|
|
5700
|
+
width: 100%;
|
|
5701
|
+
max-width: 240px;
|
|
5702
|
+
padding: 14px 20px;
|
|
5703
|
+
border-radius: 12px;
|
|
5704
|
+
border: none;
|
|
5705
|
+
background: #10B981;
|
|
5706
|
+
color: #000000;
|
|
5707
|
+
font-size: 14px;
|
|
5708
|
+
font-weight: 700;
|
|
5709
|
+
cursor: pointer;
|
|
5710
|
+
transition: box-shadow 0.2s, transform 0.1s;
|
|
5711
|
+
">${retryText}</button>
|
|
5712
|
+
` : `
|
|
5713
|
+
<button type="button" id="failed-modal-close-bottom-btn" style="
|
|
5714
|
+
min-width: 160px;
|
|
5715
|
+
max-width: 240px;
|
|
5716
|
+
padding: 14px 20px;
|
|
5717
|
+
border-radius: 12px;
|
|
5718
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
5719
|
+
background: rgba(255,255,255,0.05);
|
|
5720
|
+
color: #A1A1AA;
|
|
5721
|
+
font-size: 14px;
|
|
5722
|
+
font-weight: 500;
|
|
5723
|
+
cursor: pointer;
|
|
5724
|
+
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
5725
|
+
">${closeText}</button>
|
|
5726
|
+
`}
|
|
5859
5727
|
</div>
|
|
5860
5728
|
`;
|
|
5861
5729
|
}
|
|
@@ -5902,30 +5770,29 @@ class PaymentFailedModal {
|
|
|
5902
5770
|
}
|
|
5903
5771
|
|
|
5904
5772
|
#failed-modal-close-btn:hover {
|
|
5905
|
-
background: rgba(255, 255, 255, 0.
|
|
5906
|
-
color:
|
|
5907
|
-
transform: rotate(90deg);
|
|
5773
|
+
background: rgba(255, 255, 255, 0.05) !important;
|
|
5774
|
+
color: #FFFFFF !important;
|
|
5908
5775
|
}
|
|
5909
5776
|
|
|
5910
5777
|
#failed-modal-details-toggle:hover {
|
|
5911
5778
|
background: rgba(255, 255, 255, 0.06) !important;
|
|
5912
|
-
border-color: rgba(255, 255, 255, 0.
|
|
5913
|
-
color:
|
|
5779
|
+
border-color: rgba(255, 255, 255, 0.15) !important;
|
|
5780
|
+
color: #FFFFFF !important;
|
|
5914
5781
|
}
|
|
5915
5782
|
|
|
5916
5783
|
#failed-modal-close-bottom-btn:hover {
|
|
5917
|
-
background: rgba(255, 255, 255, 0.
|
|
5918
|
-
|
|
5784
|
+
background: rgba(255, 255, 255, 0.1) !important;
|
|
5785
|
+
color: #FFFFFF !important;
|
|
5786
|
+
border-color: rgba(255, 255, 255, 0.1) !important;
|
|
5919
5787
|
}
|
|
5920
5788
|
|
|
5921
5789
|
#failed-modal-retry-btn:hover {
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
transform: translateY(-1px);
|
|
5790
|
+
box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
|
|
5791
|
+
transform: scale(1.02);
|
|
5925
5792
|
}
|
|
5926
5793
|
|
|
5927
5794
|
#failed-modal-retry-btn:active {
|
|
5928
|
-
transform:
|
|
5795
|
+
transform: scale(0.98);
|
|
5929
5796
|
}
|
|
5930
5797
|
`;
|
|
5931
5798
|
document.head.appendChild(style);
|
|
@@ -5978,7 +5845,8 @@ class PaymentFailedModal {
|
|
|
5978
5845
|
* 切换详情展开/折叠
|
|
5979
5846
|
*/
|
|
5980
5847
|
toggleDetails() {
|
|
5981
|
-
const
|
|
5848
|
+
const lang = this.options.language ?? 'en';
|
|
5849
|
+
const isZh = lang === 'zh' || lang === 'zh-TW';
|
|
5982
5850
|
const detailsToggleText = isZh ? '查看详情' : 'View Details';
|
|
5983
5851
|
const detailsHideText = isZh ? '隐藏详情' : 'Hide Details';
|
|
5984
5852
|
this.detailsExpanded = !this.detailsExpanded;
|
|
@@ -8720,7 +8588,7 @@ class CreditPackageModal extends BasePackageModal {
|
|
|
8720
8588
|
color: ${this.COLORS.text.secondary};
|
|
8721
8589
|
line-height: 1.6;
|
|
8722
8590
|
">
|
|
8723
|
-
${isZh ? '随时购买永久积分包' : '
|
|
8591
|
+
${isZh ? '随时购买永久积分包' : 'Get credits (Valid for all platform products)'}
|
|
8724
8592
|
</p>
|
|
8725
8593
|
</div>
|
|
8726
8594
|
|
|
@@ -8910,6 +8778,7 @@ class GenericPackageModal extends BasePackageModal {
|
|
|
8910
8778
|
if (container) {
|
|
8911
8779
|
container.addEventListener('close-modal', () => {
|
|
8912
8780
|
this.close();
|
|
8781
|
+
this.options.onClose?.();
|
|
8913
8782
|
});
|
|
8914
8783
|
}
|
|
8915
8784
|
}
|
|
@@ -8921,8 +8790,8 @@ class GenericPackageModal extends BasePackageModal {
|
|
|
8921
8790
|
if (!container) {
|
|
8922
8791
|
throw new Error('Modal content container not found');
|
|
8923
8792
|
}
|
|
8924
|
-
|
|
8925
|
-
container.innerHTML =
|
|
8793
|
+
const cardsHtml = this.options.packages.map((pkg, index) => this.renderPackageCard(pkg, index)).join('');
|
|
8794
|
+
container.innerHTML = `<div style="display:flex;flex-wrap:wrap;justify-content:center;gap:24px;padding:0;">${cardsHtml}</div>`;
|
|
8926
8795
|
// Attach event listeners
|
|
8927
8796
|
this.attachEventListeners(container);
|
|
8928
8797
|
}
|
|
@@ -9017,199 +8886,229 @@ class GenericPackageModal extends BasePackageModal {
|
|
|
9017
8886
|
};
|
|
9018
8887
|
}
|
|
9019
8888
|
/**
|
|
9020
|
-
* Render package card
|
|
8889
|
+
* Render package card (Credits.html / 参考图一比一风格)
|
|
9021
8890
|
*/
|
|
9022
8891
|
renderPackageCard(pkg, index) {
|
|
9023
8892
|
const hasBonus = pkg.bonus_credits && parseInt(pkg.bonus_credits) > 0;
|
|
9024
|
-
const hasBonusPercentage = pkg.bonus_percentage && pkg.bonus_percentage > 0;
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
8893
|
+
const hasBonusPercentage = pkg.bonus_percentage != null && pkg.bonus_percentage > 0;
|
|
8894
|
+
const baseNum = this.formatNumber(pkg.base_credits || pkg.credits);
|
|
8895
|
+
const bonusNum = hasBonus ? this.formatNumber(pkg.bonus_credits) : '';
|
|
8896
|
+
const originalPrice = pkg.original_price;
|
|
8897
|
+
const svgClose = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>';
|
|
8898
|
+
const svgZap = '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>';
|
|
8899
|
+
const svgCheck = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>';
|
|
8900
|
+
const svgSparkles = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"></path></svg>';
|
|
9030
8901
|
return `
|
|
9031
8902
|
<div
|
|
9032
8903
|
data-package-id="${pkg.id}"
|
|
8904
|
+
class="generic-package-card"
|
|
9033
8905
|
style="
|
|
9034
8906
|
position: relative;
|
|
9035
8907
|
display: flex;
|
|
9036
8908
|
flex-direction: column;
|
|
9037
|
-
justify-content: center;
|
|
9038
8909
|
align-items: center;
|
|
9039
|
-
gap: 48px;
|
|
9040
|
-
border-radius: 16px;
|
|
9041
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
9042
|
-
background: #000000;
|
|
9043
|
-
padding: 80px 60px;
|
|
9044
8910
|
text-align: center;
|
|
9045
|
-
cursor: pointer;
|
|
9046
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
9047
8911
|
width: 100%;
|
|
9048
|
-
|
|
8912
|
+
max-width: 384px;
|
|
8913
|
+
min-width: 340px;
|
|
8914
|
+
margin: 0 auto;
|
|
9049
8915
|
box-sizing: border-box;
|
|
8916
|
+
border-radius: 24px;
|
|
8917
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
8918
|
+
background: #171717;
|
|
8919
|
+
padding: 40px 32px 32px;
|
|
8920
|
+
overflow: hidden;
|
|
9050
8921
|
"
|
|
9051
|
-
onmouseover="this.style.borderColor='rgba(255, 255, 255, 0.2)';"
|
|
9052
|
-
onmouseout="this.style.borderColor='rgba(255, 255, 255, 0.1)';"
|
|
9053
8922
|
>
|
|
9054
|
-
<!--
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
">
|
|
9068
|
-
${packageTitle}
|
|
9069
|
-
</div>
|
|
9070
|
-
` : ''}
|
|
8923
|
+
<!-- Background Ambient Glow (参考图中部绿色光晕) -->
|
|
8924
|
+
<div style="
|
|
8925
|
+
position: absolute;
|
|
8926
|
+
bottom: 25%;
|
|
8927
|
+
right: 25%;
|
|
8928
|
+
width: 240px;
|
|
8929
|
+
height: 240px;
|
|
8930
|
+
background: rgba(6, 182, 212, 0.1);
|
|
8931
|
+
border-radius: 50%;
|
|
8932
|
+
filter: blur(100px);
|
|
8933
|
+
pointer-events: none;
|
|
8934
|
+
z-index: 0;
|
|
8935
|
+
"></div>
|
|
9071
8936
|
|
|
9072
|
-
<!-- Close button
|
|
8937
|
+
<!-- Close button (右上角圆形按钮) -->
|
|
9073
8938
|
<button
|
|
8939
|
+
type="button"
|
|
9074
8940
|
onclick="this.closest('[data-package-id]').dispatchEvent(new CustomEvent('close-modal', { bubbles: true }));"
|
|
9075
8941
|
style="
|
|
9076
8942
|
position: absolute;
|
|
9077
|
-
top:
|
|
9078
|
-
right:
|
|
9079
|
-
width:
|
|
9080
|
-
height:
|
|
8943
|
+
top: 16px;
|
|
8944
|
+
right: 16px;
|
|
8945
|
+
width: 34px;
|
|
8946
|
+
height: 34px;
|
|
9081
8947
|
border-radius: 50%;
|
|
9082
8948
|
border: none;
|
|
9083
|
-
background: rgba(255, 255, 255, 0.
|
|
9084
|
-
color: rgba(255, 255, 255, 0.
|
|
8949
|
+
background: rgba(255, 255, 255, 0.05);
|
|
8950
|
+
color: rgba(255, 255, 255, 0.4);
|
|
9085
8951
|
cursor: pointer;
|
|
9086
8952
|
display: flex;
|
|
9087
8953
|
align-items: center;
|
|
9088
8954
|
justify-content: center;
|
|
9089
|
-
font-size: 20px;
|
|
9090
|
-
line-height: 1;
|
|
9091
8955
|
transition: all 0.2s;
|
|
9092
|
-
z-index:
|
|
8956
|
+
z-index: 10;
|
|
9093
8957
|
"
|
|
9094
|
-
onmouseover="this.style.background='rgba(255,
|
|
9095
|
-
onmouseout="this.style.background='rgba(255,
|
|
9096
|
-
>
|
|
9097
|
-
×
|
|
9098
|
-
</button>
|
|
8958
|
+
onmouseover="this.style.background='rgba(255,255,255,0.1)'; this.style.color='#FFFFFF';"
|
|
8959
|
+
onmouseout="this.style.background='rgba(255,255,255,0.05)'; this.style.color='rgba(255,255,255,0.4)';"
|
|
8960
|
+
>${svgClose}</button>
|
|
9099
8961
|
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
8962
|
+
<div style="position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center;">
|
|
8963
|
+
<!-- Value badge: +N% EXTRA VALUE (深色底, 金色边框) -->
|
|
8964
|
+
${hasBonusPercentage ? `
|
|
8965
|
+
<div style="
|
|
8966
|
+
display: inline-flex;
|
|
8967
|
+
align-items: center;
|
|
8968
|
+
gap: 6px;
|
|
8969
|
+
margin-bottom: 24px;
|
|
8970
|
+
padding: 4px 12px;
|
|
8971
|
+
border-radius: 9999px;
|
|
8972
|
+
background: rgba(249, 176, 22, 0.1);
|
|
8973
|
+
border: 1px solid rgba(249, 176, 22, 0.2);
|
|
8974
|
+
color: #F9B016;
|
|
8975
|
+
font-size: 12px;
|
|
8976
|
+
font-weight: 700;
|
|
8977
|
+
box-shadow: 0 0 15px rgba(249, 176, 22, 0.1);
|
|
8978
|
+
">
|
|
8979
|
+
<span style="display:inline-flex;">${svgZap}</span>
|
|
8980
|
+
<span>+${pkg.bonus_percentage}% EXTRA VALUE</span>
|
|
8981
|
+
</div>
|
|
8982
|
+
` : '<div style="height:16px;"></div>'}
|
|
8983
|
+
|
|
8984
|
+
<!-- Main credits: 巨大白字 + CREDITS -->
|
|
8985
|
+
<div style="margin-bottom: 0;">
|
|
8986
|
+
<span style="
|
|
8987
|
+
display: block;
|
|
8988
|
+
font-size: 60px;
|
|
8989
|
+
line-height: 1;
|
|
8990
|
+
font-weight: 800;
|
|
8991
|
+
color: #FFFFFF;
|
|
8992
|
+
letter-spacing: -0.05em;
|
|
8993
|
+
filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
|
|
8994
|
+
">${baseNum}</span>
|
|
8995
|
+
<span style="
|
|
8996
|
+
display: block;
|
|
8997
|
+
margin-top: 4px;
|
|
8998
|
+
font-size: 14px;
|
|
8999
|
+
font-weight: 500;
|
|
9000
|
+
color: #A3A3A3;
|
|
9001
|
+
letter-spacing: 0.1em;
|
|
9002
|
+
text-transform: uppercase;
|
|
9003
|
+
">CREDITS</span>
|
|
9117
9004
|
</div>
|
|
9118
|
-
` : ''}
|
|
9119
9005
|
|
|
9120
|
-
|
|
9121
|
-
<div style="
|
|
9122
|
-
display: flex;
|
|
9123
|
-
flex-direction: column;
|
|
9124
|
-
align-items: center;
|
|
9125
|
-
justify-content: center;
|
|
9126
|
-
gap: 0;
|
|
9127
|
-
width: 100%;
|
|
9128
|
-
margin-top: 60px;
|
|
9129
|
-
">
|
|
9006
|
+
<!-- Separator: 渐变线 + 加号 (缩短线条长度) -->
|
|
9130
9007
|
<div style="
|
|
9131
9008
|
display: flex;
|
|
9132
|
-
align-items:
|
|
9009
|
+
align-items: center;
|
|
9133
9010
|
justify-content: center;
|
|
9134
9011
|
gap: 12px;
|
|
9135
|
-
|
|
9012
|
+
width: 100%;
|
|
9013
|
+
margin: 12px 0;
|
|
9014
|
+
opacity: 0.4;
|
|
9136
9015
|
">
|
|
9137
|
-
|
|
9138
|
-
<span style="
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
font-weight: 400;
|
|
9142
|
-
color: white;
|
|
9143
|
-
letter-spacing: -0.04em;
|
|
9144
|
-
white-space: nowrap;
|
|
9145
|
-
">
|
|
9146
|
-
${this.formatNumber(pkg.base_credits || pkg.credits)}
|
|
9147
|
-
</span>
|
|
9148
|
-
|
|
9149
|
-
<!-- credits text -->
|
|
9150
|
-
<span style="
|
|
9151
|
-
font-size: 52px;
|
|
9152
|
-
line-height: 1;
|
|
9153
|
-
font-weight: 400;
|
|
9154
|
-
color: white;
|
|
9155
|
-
letter-spacing: -0.04em;
|
|
9156
|
-
white-space: nowrap;
|
|
9157
|
-
">
|
|
9158
|
-
credits
|
|
9159
|
-
</span>
|
|
9016
|
+
<span style="width: 40px; height: 1px; background: linear-gradient(to right, transparent, #FFFFFF);"></span>
|
|
9017
|
+
<span style="color: #FFFFFF; font-size: 18px; font-weight: 300; line-height: 1;">+</span>
|
|
9018
|
+
<span style="width: 40px; height: 1px; background: linear-gradient(to left, transparent, #FFFFFF);"></span>
|
|
9019
|
+
</div>
|
|
9160
9020
|
|
|
9161
|
-
|
|
9162
|
-
|
|
9021
|
+
<!-- Bonus credits: 绿色数字 + BONUS CREDITS -->
|
|
9022
|
+
${hasBonus ? `
|
|
9023
|
+
<div style="margin-bottom: 32px; position: relative;">
|
|
9024
|
+
<div style="position: absolute; inset: -16px; background: rgba(34, 197, 94, 0.1); filter: blur(20px); border-radius: 50%;"></div>
|
|
9163
9025
|
<span style="
|
|
9164
|
-
|
|
9026
|
+
display: block;
|
|
9027
|
+
position: relative;
|
|
9028
|
+
font-size: 36px;
|
|
9165
9029
|
line-height: 1;
|
|
9166
|
-
font-weight:
|
|
9167
|
-
color:
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9030
|
+
font-weight: 700;
|
|
9031
|
+
color: transparent;
|
|
9032
|
+
background: linear-gradient(to bottom, #86EFAC, #22C55E);
|
|
9033
|
+
-webkit-background-clip: text;
|
|
9034
|
+
background-clip: text;
|
|
9035
|
+
">${bonusNum}</span>
|
|
9036
|
+
<div style="display:inline-flex;position: relative;align-items:center;gap:6px;margin-top:4px;">
|
|
9037
|
+
<span style="display:inline-flex;color:#4ADE80;">${svgSparkles}</span>
|
|
9038
|
+
<span style="font-size:14px;font-weight:600;color:#4ADE80;letter-spacing:0.05em;text-transform:uppercase;">Bonus Credits</span>
|
|
9039
|
+
</div>
|
|
9040
|
+
</div>
|
|
9041
|
+
` : '<div style="height:32px;"></div>'}
|
|
9042
|
+
|
|
9043
|
+
<!-- Validity badge (深色小胶囊) -->
|
|
9044
|
+
<div style="
|
|
9045
|
+
display: inline-flex;
|
|
9046
|
+
align-items: center;
|
|
9047
|
+
gap: 6px;
|
|
9048
|
+
margin-bottom: 32px;
|
|
9049
|
+
padding: 6px 12px;
|
|
9050
|
+
border-radius: 8px;
|
|
9051
|
+
background: rgba(255, 255, 255, 0.05);
|
|
9052
|
+
color: #737373;
|
|
9053
|
+
font-size: 12px;
|
|
9054
|
+
">
|
|
9055
|
+
<span style="display:inline-flex;">${svgCheck}</span>
|
|
9056
|
+
<span>Valid for all platform products</span>
|
|
9174
9057
|
</div>
|
|
9175
|
-
</div>
|
|
9176
9058
|
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9059
|
+
<!-- CTA Button (渐变大按钮, 右侧带价格深色块) -->
|
|
9060
|
+
<button
|
|
9061
|
+
data-package-button="${pkg.id}"
|
|
9062
|
+
type="button"
|
|
9063
|
+
style="
|
|
9064
|
+
width: 100%;
|
|
9065
|
+
border: none;
|
|
9066
|
+
border-radius: 16px;
|
|
9067
|
+
padding: 4px 4px 4px 24px;
|
|
9068
|
+
background: linear-gradient(to right, #34D399, #06B6D4);
|
|
9069
|
+
color: #171717;
|
|
9070
|
+
font-size: 18px;
|
|
9071
|
+
font-weight: 700;
|
|
9072
|
+
cursor: pointer;
|
|
9073
|
+
display: flex;
|
|
9074
|
+
align-items: center;
|
|
9075
|
+
justify-content: space-between;
|
|
9076
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
9077
|
+
box-sizing: border-box;
|
|
9078
|
+
position: relative;
|
|
9079
|
+
overflow: hidden;
|
|
9080
|
+
"
|
|
9081
|
+
onmouseover="this.style.transform='scale(1.02)';"
|
|
9082
|
+
onmouseout="this.style.transform='scale(1)';"
|
|
9083
|
+
onmousedown="this.style.transform='scale(0.98)';"
|
|
9084
|
+
>
|
|
9085
|
+
<!-- Hover Shine Effect -->
|
|
9086
|
+
<div style="
|
|
9087
|
+
position: absolute;
|
|
9088
|
+
top: 0;
|
|
9089
|
+
left: -100%;
|
|
9090
|
+
height: 100%;
|
|
9091
|
+
width: 100%;
|
|
9092
|
+
background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
|
|
9093
|
+
transform: skewX(-20deg);
|
|
9094
|
+
transition: left 0.5s;
|
|
9095
|
+
" onmouseover="this.style.left='100%'" onmouseout="this.style.left='-100%'"></div>
|
|
9187
9096
|
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
cursor: pointer;
|
|
9204
|
-
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
9205
|
-
box-shadow: 0 4px 20px rgba(0, 255, 136, 0.35);
|
|
9206
|
-
letter-spacing: 0.01em;
|
|
9207
|
-
"
|
|
9208
|
-
onmouseover="this.style.background='linear-gradient(135deg, #00ff88 0%, #00f2fe 100%)'; this.style.boxShadow='0 6px 28px rgba(0, 255, 136, 0.5)'; this.style.transform='translateY(-2px) scale(1.02)';"
|
|
9209
|
-
onmouseout="this.style.background='linear-gradient(135deg, #00ff88 0%, #00f2fe 100%)'; this.style.boxShadow='0 4px 20px rgba(0, 255, 136, 0.35)'; this.style.transform='translateY(0) scale(1)';"
|
|
9210
|
-
>
|
|
9211
|
-
Buy $ ${pkg.price}
|
|
9212
|
-
</button>
|
|
9097
|
+
<span>Unlock Now</span>
|
|
9098
|
+
<div style="
|
|
9099
|
+
display: flex;
|
|
9100
|
+
align-items: center;
|
|
9101
|
+
gap: 8px;
|
|
9102
|
+
background: rgba(0, 0, 0, 0.2);
|
|
9103
|
+
padding: 10px 10px;
|
|
9104
|
+
border-radius: 8px;
|
|
9105
|
+
backdrop-filter: blur(4px);
|
|
9106
|
+
">
|
|
9107
|
+
${originalPrice ? `<span style="font-size:14px;font-weight:700;color:rgba(255, 255, 255, 0.6);text-decoration:line-through;">$${originalPrice}</span>` : ''}
|
|
9108
|
+
<span style="font-size:16px;font-weight:600;color:#FFFFFF;">$${pkg.price}</span>
|
|
9109
|
+
</div>
|
|
9110
|
+
</button>
|
|
9111
|
+
</div>
|
|
9213
9112
|
</div>
|
|
9214
9113
|
`;
|
|
9215
9114
|
}
|
|
@@ -9267,7 +9166,7 @@ class GenericPackageModal extends BasePackageModal {
|
|
|
9267
9166
|
/**
|
|
9268
9167
|
* SDK version
|
|
9269
9168
|
*/
|
|
9270
|
-
const VERSION$2 = '0.9.
|
|
9169
|
+
const VERSION$2 = '0.9.2';
|
|
9271
9170
|
|
|
9272
9171
|
var __defProp = Object.defineProperty;
|
|
9273
9172
|
var __defProps = Object.defineProperties;
|