温馨提示:在 ChatGPT 官网(www.chatgpt.com)使用 GPT-5.5、ChatGPT-Image-2 等模型时,需要 ChatGPT Plus 或更高等级的会员权限。如需购买帐号或代充值会员,请扫码添加我们客服咨询。
该网页呈现了一个模拟的ChatGPT智能助手礼品卡充值界面,用户可在此输入礼品卡卡密完成账户充值,页面设计简洁直观,核心功能聚焦于礼品卡兑换,整体风格与该智能助手服务紧密关联。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, viewport-fit=cover">GPT智能助手 · 礼品卡充值</title>
<!-- 引入 Font Awesome 6 图标库 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(145deg, #0b0f1c 0%, #1a1f33 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
padding: 1.5rem;
margin: 0;
}
.card {
max-width: 480px;
width: 100%;
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
background: linear-gradient(135deg, rgba(30, 35, 55, 0.8) 0%, rgba(20, 25, 40, 0.9) 100%);
box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
border-radius: 2.5rem;
padding: 2rem 1.8rem;
transition: all 0.3s ease;
color: #f0f3fa;
}
.logo-area {
display: flex;
align-items: center;
justify-content: center;
gap: 0.8rem;
margin-bottom: 2.2rem;
}
.gpt-icon {
background: linear-gradient(135deg, #10a37f, #1a7f64);
width: 52px;
height: 52px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 2.2rem;
color: white;
box-shadow: 0 10px 20px rgba(16, 163, 127, 0.35);
}
.logo-text {
font-size: 1.9rem;
font-weight: 700;
letter-spacing: -0.5px;
background: linear-gradient(to right, #ffffff, #c0d0ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.subtitle {
text-align: center;
margin-bottom: 2rem;
color: #a8b5db;
font-size: 0.95rem;
font-weight: 400;
letter-spacing: 0.3px;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}
.subtitle i {
color: #10a37f;
font-size: 0.9rem;
}
.balance-preview {
background: rgba(16, 163, 127, 0.12);
border: 1px solid rgba(16, 163, 127, 0.25);
border-radius: 2rem;
padding: 0.9rem 1.5rem;
margin-bottom: 2rem;
display: flex;
align-items: center;
justify-content: space-between;
backdrop-filter: blur(10px);
}
.balance-label {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.9rem;
color: #b9c6e5;
}
.balance-amount {
font-weight: 700;
font-size: 1.4rem;
background: linear-gradient(to right, #ffffff, #d0e0ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.input-section {
margin-bottom: 1.8rem;
}
.input-label {
font-size: 0.9rem;
font-weight: 500;
margin-bottom: 0.6rem;
color: #cbd5f0;
display: flex;
align-items: center;
gap: 0.4rem;
}
.code-input-wrapper {
background: rgba(10, 14, 23, 0.6);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 1.2rem;
padding: 0.2rem 0.2rem 0.2rem 1.2rem;
display: flex;
align-items: center;
transition: border 0.2s, box-shadow 0.2s;
backdrop-filter: blur(8px);
}
.code-input-wrapper:focus-within {
border-color: #10a37f;
box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.25);
}
.code-input-wrapper i {
color: #6b7ca0;
font-size: 1.2rem;
margin-right: 0.5rem;
}
#giftCodeInput {
background: transparent;
border: none;
padding: 0.9rem 0;
font-size: 1.1rem;
width: 100%;
color: white;
outline: none;
letter-spacing: 0.8px;
font-weight: 500;
}
#giftCodeInput::placeholder {
color: #5a6380;
font-weight: 400;
letter-spacing: 0.5px;
font-size: 0.95rem;
}
.paste-btn {
background: rgba(255, 255, 255, 0.08);
border: none;
color: #b0c2f0;
padding: 0.6rem 1.2rem;
border-radius: 1rem;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
margin-right: 0.3rem;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 0.3rem;
white-space: nowrap;
background: rgba(16, 163, 127, 0.15);
border: 1px solid rgba(16, 163, 127, 0.3);
}
.paste-btn:hover {
background: rgba(16, 163, 127, 0.25);
color: white;
}
.redeem-button {
width: 100%;
background: linear-gradient(135deg, #10a37f, #0d8c6a);
border: none;
border-radius: 1.5rem;
padding: 1rem;
font-size: 1.2rem;
font-weight: 600;
color: white;
display: flex;
align-items: center;
justify-content: center;
gap: 0.7rem;
cursor: pointer;
transition: all 0.25s;
box-shadow: 0 12px 25px rgba(16, 163, 127, 0.35);
margin-top: 0.6rem;
letter-spacing: 0.4px;
border: 1px solid rgba(255, 255, 255, 0.15);
}
.redeem-button:hover {
background: linear-gradient(135deg, #1bb88a, #0f9b74);
box-shadow: 0 15px 30px rgba(16, 163, 127, 0.5);
transform: scale(1.02);
}
.redeem-button:active {
transform: scale(0.98);
}
.redeem-button:disabled {
opacity: 0.6;
box-shadow: none;
transform: none;
cursor: not-allowed;
background: #2d3a55;
border-color: rgba(255,255,255,0.1);
}
.message-area {
margin-top: 1.5rem;
min-height: 2.8rem;
font-size: 0.9rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
border-radius: 1rem;
padding: 0.5rem 1rem;
background: rgba(0,0,0,0.2);
color: #cfdbf5;
}
.success-message {
color: #7ee6b5;
background: rgba(16, 163, 127, 0.15);
}
.error-message {
color: #f9a8b8;
background: rgba(220, 50, 70, 0.15);
}
.info-message {
color: #b8c7f0;
}
.features {
display: flex;
justify-content: space-around;
margin-top: 2.2rem;
padding-top: 1.2rem;
border-top: 1px solid rgba(255, 255, 255, 0.08);
color: #8b9ac0;
font-size: 0.8rem;
}
.feature-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.3rem;
opacity: 0.8;
}
.feature-item i {
font-size: 1.3rem;
color: #10a37f;
}
.hidden {
display: none;
}
@media (max-width: 400px) {
.card {
padding: 1.8rem 1.3rem;
}
}
</style>
</head>
<body>
<div class="card">
<!-- 品牌标识 -->
<div class="logo-area">
<div class="gpt-icon">
<i class="fas fa-robot"></i>
</div>
<span class="logo-text">GPT·助手</span>
</div>
<div class="subtitle">
<i class="fas fa-gift"></i> 礼品卡兑换中心
</div>
<!-- 当前余额显示 -->
<div class="balance-preview">
<span class="balance-label">
<i class="fas fa-coins"></i> 我的余额
</span>
<span class="balance-amount" id="currentBalance">$12.50</span>
</div>
<!-- 兑换码输入区域 -->
<div class="input-section">
<div class="input-label">
<i class="fas fa-key"></i> 礼品卡代码
</div>
<div class="code-input-wrapper">
<i class="fas fa-ticket-alt" style="margin-right: 0.3rem;"></i>
<input type="text" id="giftCodeInput" placeholder="GPT-XXXX-XXXX-XXXX" autocomplete="off" autofocus>
<button class="paste-btn" id="pasteButton">
<i class="fas fa-paste"></i> 粘贴
</button>
</div>
</div>
<!-- 充值按钮 -->
<button class="redeem-button" id="redeemButton">
<i class="fas fa-arrow-right-to-bracket"></i> 立即充值
</button>
<!-- 消息反馈区域 -->
<div class="message-area" id="messageBox">
<i class="fas fa-info-circle"></i>
<span id="messageText">输入16位礼品卡代码</span>
</div>
<!-- 底部特点 -->
<div class="features">
<div class="feature-item">
<i class="fas fa-bolt"></i>
<span>即时到账</span>
</div>
<div class="feature-item">
<i class="fas fa-shield-alt"></i>
<span>安全加密</span>
</div>
<div class="feature-item">
<i class="fas fa-headset"></i>
<span>24h支持</span>
</div>
</div>
</div>
<script>
(function() {
// --- 模拟数据与状态 ---
// 当前余额 (使用美元符号模拟)
let currentBalance = 12.50;
// 预定义的“有效”礼品卡数据库 (模拟)
const validGiftCards = new Map([
['GPT-2025-HELLO-WORLD', 10.00],
['GPT-GIFT-50-OFF', 50.00],
['GPT-WELCOME-25', 25.00],
['GPT-XMAS-2025', 30.00],
['GPT-ALPHA-TEST', 5.00],
['DEMO-CODE-0001', 15.00]
]);
// 记录已使用的卡片 (防止重复使用)
const usedCards = new Set();
// DOM 元素
const balanceElement = document.getElementById('currentBalance');
const giftCodeInput = document.getElementById('giftCodeInput');
const redeemButton = document.getElementById('redeemButton');
const pasteButton = document.getElementById('pasteButton');
const messageBox = document.getElementById('messageBox');
const messageText = document.getElementById('messageText');
// 辅助函数:更新余额显示
function updateBalanceDisplay() {
balanceElement.textContent = `$${currentBalance.toFixed(2)}`;
}
// 显示消息 (支持类型: success, error, info)
function showMessage(text, type = 'info') {
messageText.textContent = text;
messageBox.className = 'message-area'; // 重置类
// 根据类型添加对应样式类
if (type === 'success') {
messageBox.classList.add('success-message');
messageBox.innerHTML = `<i class="fas fa-check-circle"></i><span>${text}</span>`;
} else if (type === 'error') {
messageBox.classList.add('error-message');
messageBox.innerHTML = `<i class="fas fa-exclamation-circle"></i><span>${text}</span>`;
} else {
messageBox.classList.add('info-message');
messageBox.innerHTML = `<i class="fas fa-info-circle"></i><span>${text}</span>`;
}
}
// 重置消息为默认提示
function resetMessageToDefault() {
showMessage('输入16位礼品卡代码', 'info');
}
// 处理粘贴功能 (从剪贴板读取)
async function handlePaste() {
try {
// 检查浏览器是否支持 clipboard API
if (!navigator.clipboard || !navigator.clipboard.readText) {
showMessage('剪贴板不可用,请手动输入', 'error');
return;
}
const text = await navigator.clipboard.readText();
if (text && text.trim() !== '') {
giftCodeInput.value = text.trim();
// 可选自动聚焦并触发视觉反馈
giftCodeInput.focus();
showMessage('已从剪贴板粘贴', 'info');
// 短暂显示后恢复默认提示(但保留输入内容)
setTimeout(() => {
if (giftCodeInput.value === text.trim()) {
// 如果用户没有修改,恢复到通用提示
if (messageText.textContent.includes('已从剪贴板粘贴')) {
resetMessageToDefault();
}
}
}, 1500);
} else {
showMessage('剪贴板为空', 'error');
}
} catch (err) {
console.warn('粘贴失败:', err);
showMessage('无法访问剪贴板,请手动输入', 'error');
}
}
// 格式化验证代码 (去除空格,转大写)
function sanitizeCode(input) {
return input.trim().replace(/\s+/g, '').toUpperCase();
}
// 验证代码格式 (示例:要求类似 GPT-XXXX-XXXX-XXXX 或自定义格式)
function isValidFormat(code) {
// 允许格式:字母数字以及连字符,长度至少8位,最多30位
const pattern = /^[A-Z0-9\-]{8,30}$/;
return pattern.test(code);
}
// 核心兑换逻辑
function redeemGiftCard() {
const rawCode = giftCodeInput.value;
const code = sanitizeCode(rawCode);
// 1. 空值检查
if (!code) {
showMessage('请输入礼品卡代码', 'error');
giftCodeInput.focus();
return;
}
// 2. 格式检查
if (!isValidFormat(code)) {
showMessage('代码格式无效 (8-30位字母数字或连字符)', 'error');
giftCodeInput.focus();
return;
}
// 3. 检查是否已使用 (防重复)
if (usedCards.has(code)) {
showMessage('此礼品卡已被使用', 'error');
giftCodeInput.value = ''; // 清空输入方便重新输入
giftCodeInput.focus();
return;
}
// 4. 验证是否存在于有效卡池中
if (!validGiftCards.has(code)) {
showMessage('无效的礼品卡代码', 'error');
giftCodeInput.value = '';
giftCodeInput.focus();
return;
}
//温馨提示:在 ChatGPT 官网(www.chatgpt.com)使用 GPT-5.5、ChatGPT-Image-2 等模型时,需要 ChatGPT Plus 或更高等级的会员权限。如需购买帐号或代充值会员,请扫码添加我们客服咨询。



