| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617 |
- <!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=no">
- <title>停车减免查询 - YesWash</title>
- <style>
- :root {
- --color-primary: #9B0415;
- --color-primary-light: #c0051a;
- --color-primary-lighter: #fef0f0;
- --color-primary-bg: #fff5f5;
- --color-success: #67C23A;
- --color-success-bg: #f0f9eb;
- --color-warning: #E6A23C;
- --color-warning-bg: #fdf6ec;
- --color-danger: #F56C6C;
- --color-danger-bg: #fef0f0;
- --color-info: #909399;
- --color-info-bg: #f4f4f5;
- --bg-color: #f8f8f8;
- --bg-white: #ffffff;
- --text-primary: #303133;
- --text-regular: #606266;
- --text-secondary: #909399;
- --text-placeholder: #c0c4cc;
- --border-color: #dcdfe6;
- --border-color-light: #e4e7ed;
- --border-color-lighter: #ebeef5;
- --border-radius: 4px;
- --border-radius-lg: 8px;
- --border-radius-round: 20px;
- --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.04);
- --shadow-card-hover: 0 2px 12px rgba(0, 0, 0, 0.08);
- --font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "SimSun", sans-serif;
- --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: var(--font-family);
- font-size: 14px;
- color: var(--text-primary);
- background-color: var(--bg-color);
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- align-items: center;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- /* Header */
- .brand-header {
- width: 100%;
- background: linear-gradient(135deg, #8b0312 0%, #9B0415 40%, #b01528 100%);
- padding: 32px 20px 40px;
- text-align: center;
- color: #fff;
- position: relative;
- overflow: hidden;
- }
- .brand-header::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
- pointer-events: none;
- }
- .brand-logo {
- font-size: 13px;
- font-weight: 400;
- letter-spacing: 4px;
- opacity: 0.7;
- margin-bottom: 8px;
- position: relative;
- }
- .brand-title {
- font-size: 28px;
- font-weight: 600;
- letter-spacing: 1px;
- margin-bottom: 6px;
- position: relative;
- }
- .brand-subtitle {
- font-size: 14px;
- opacity: 0.75;
- font-weight: 300;
- position: relative;
- }
- /* Main Content */
- .page-wrapper {
- width: 100%;
- max-width: 420px;
- padding: 0 16px;
- margin-top: -16px;
- position: relative;
- z-index: 1;
- }
- .main-card {
- background: var(--bg-white);
- border-radius: var(--border-radius-lg);
- box-shadow: var(--shadow-card);
- padding: 28px 24px;
- margin-bottom: 20px;
- }
- /* Form */
- .form-group {
- margin-bottom: 0;
- }
- .field-label {
- display: block;
- font-size: 13px;
- font-weight: 500;
- color: var(--text-regular);
- margin-bottom: 8px;
- }
- .input-wrapper {
- position: relative;
- display: flex;
- align-items: center;
- }
- .input-prefix {
- position: absolute;
- left: 14px;
- z-index: 1;
- display: flex;
- align-items: center;
- }
- .input-prefix svg {
- width: 18px;
- height: 18px;
- color: var(--text-secondary);
- }
- .phone-input {
- width: 100%;
- height: 44px;
- padding: 0 14px 0 42px;
- border: 1px solid var(--border-color);
- border-radius: var(--border-radius);
- font-size: 15px;
- font-family: var(--font-family);
- color: var(--text-primary);
- background: var(--bg-white);
- transition: border-color var(--transition), box-shadow var(--transition);
- outline: none;
- -webkit-appearance: none;
- }
- .phone-input::placeholder {
- color: var(--text-placeholder);
- }
- .phone-input:focus {
- border-color: var(--color-primary);
- box-shadow: 0 0 0 2px rgba(155, 4, 21, 0.12);
- }
- .phone-input.error {
- border-color: var(--color-danger);
- }
- .field-error {
- color: var(--color-danger);
- font-size: 12px;
- margin-top: 6px;
- display: none;
- align-items: center;
- gap: 4px;
- }
- .field-error.show {
- display: flex;
- }
- /* Buttons */
- .btn {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 44px;
- padding: 0 20px;
- font-size: 15px;
- font-weight: 500;
- font-family: var(--font-family);
- border: none;
- border-radius: var(--border-radius-round);
- cursor: pointer;
- transition: all var(--transition);
- outline: none;
- letter-spacing: 1px;
- margin-top: 20px;
- }
- .btn-primary {
- background: var(--color-primary);
- color: #fff;
- }
- .btn-primary:hover:not(:disabled) {
- background: var(--color-primary-light);
- box-shadow: 0 2px 8px rgba(155, 4, 21, 0.25);
- transform: translateY(-1px);
- }
- .btn-primary:active:not(:disabled) {
- transform: translateY(0);
- box-shadow: none;
- }
- .btn-primary:disabled {
- opacity: 0.55;
- cursor: not-allowed;
- }
- .btn-claim {
- background: var(--color-primary);
- color: #fff;
- margin-top: 16px;
- animation: fadeInUp 0.4s ease;
- }
- .btn-claim:hover:not(:disabled) {
- background: var(--color-primary-light);
- box-shadow: 0 2px 8px rgba(155, 4, 21, 0.25);
- }
- /* Loading */
- .loading-area {
- display: none;
- text-align: center;
- padding: 32px 20px;
- }
- .loading-area.active {
- display: block;
- animation: fadeIn 0.25s ease;
- }
- .spinner {
- display: inline-block;
- width: 32px;
- height: 32px;
- border: 3px solid var(--border-color-lighter);
- border-top-color: var(--color-primary);
- border-radius: 50%;
- animation: spin 0.8s linear infinite;
- }
- .loading-text {
- margin-top: 14px;
- font-size: 13px;
- color: var(--text-secondary);
- }
- /* Result Card */
- .result-card {
- display: none;
- padding: 20px;
- border-radius: var(--border-radius);
- margin-top: 20px;
- animation: fadeInUp 0.35s ease;
- }
- .result-card.show {
- display: block;
- }
- .result-card.success {
- background: var(--color-success-bg);
- border-left: 3px solid var(--color-success);
- }
- .result-card.warning {
- background: var(--color-warning-bg);
- border-left: 3px solid var(--color-warning);
- }
- .result-card.error {
- background: var(--color-danger-bg);
- border-left: 3px solid var(--color-danger);
- }
- .result-icon {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 12px;
- }
- .result-icon.success {
- background: var(--color-success);
- color: #fff;
- }
- .result-icon.warning {
- background: var(--color-warning);
- color: #fff;
- }
- .result-icon.error {
- background: var(--color-danger);
- color: #fff;
- }
- .result-icon svg {
- width: 20px;
- height: 20px;
- }
- .result-title {
- font-size: 16px;
- font-weight: 600;
- margin-bottom: 6px;
- color: var(--text-primary);
- }
- .result-desc {
- font-size: 13px;
- color: var(--text-regular);
- line-height: 1.6;
- }
- /* Hint */
- .hint-text {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 6px;
- margin-top: 18px;
- font-size: 12px;
- color: var(--text-placeholder);
- }
- .hint-text svg {
- width: 14px;
- height: 14px;
- flex-shrink: 0;
- }
- /* Footer */
- .page-footer {
- text-align: center;
- padding: 16px 20px 28px;
- font-size: 12px;
- color: var(--text-placeholder);
- letter-spacing: 1px;
- }
- /* Keyframes */
- @keyframes spin {
- from { transform: rotate(0deg); }
- to { transform: rotate(360deg); }
- }
- @keyframes fadeIn {
- from { opacity: 0; }
- to { opacity: 1; }
- }
- @keyframes fadeInUp {
- from { opacity: 0; transform: translateY(10px); }
- to { opacity: 1; transform: translateY(0); }
- }
- /* Mobile tweaks */
- @media (max-width: 440px) {
- .brand-header {
- padding: 24px 16px 32px;
- }
- .brand-title {
- font-size: 24px;
- }
- .page-wrapper {
- padding: 0 10px;
- margin-top: -12px;
- }
- .main-card {
- padding: 22px 18px;
- }
- }
- </style>
- </head>
- <body>
- <header class="brand-header">
- <div class="brand-logo">YESWASH</div>
- <h1 class="brand-title">停车减免查询</h1>
- <p class="brand-subtitle">查询是否符合停车费用减免条件</p>
- </header>
- <div class="page-wrapper">
- <div class="main-card">
- <form id="queryForm" novalidate>
- <div class="form-group">
- <label class="field-label" for="phoneNumber">手机号码</label>
- <div class="input-wrapper">
- <span class="input-prefix">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <rect x="5" y="2" width="14" height="20" rx="2" ry="2"/>
- <line x1="12" y1="18" x2="12.01" y2="18"/>
- </svg>
- </span>
- <input
- type="tel"
- id="phoneNumber"
- class="phone-input"
- placeholder="请输入注册时使用的手机号"
- maxlength="11"
- autocomplete="tel"
- inputmode="numeric"
- >
- </div>
- <div id="fieldError" class="field-error">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="12" cy="12" r="10"/>
- <line x1="15" y1="9" x2="9" y2="15"/>
- <line x1="9" y1="9" x2="15" y2="15"/>
- </svg>
- <span></span>
- </div>
- </div>
- <button type="submit" class="btn btn-primary" id="submitBtn">查 询</button>
- </form>
- <div class="hint-text">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="12" cy="12" r="10"/>
- <line x1="12" y1="16" x2="12" y2="12"/>
- <line x1="12" y1="8" x2="12.01" y2="8"/>
- </svg>
- <span>领取后请尽快出场,避免产生二次费用</span>
- </div>
- </div>
- <div class="loading-area" id="loadingArea">
- <div class="spinner"></div>
- <p class="loading-text">查询中,请稍候...</p>
- </div>
- <div id="resultCard" class="result-card">
- <div id="resultIcon" class="result-icon"></div>
- <h2 id="resultTitle" class="result-title"></h2>
- <p id="resultDesc" class="result-desc"></p>
- <button id="collectBtn" class="btn btn-claim" style="display:none;">领取停车券</button>
- </div>
- </div>
- <footer class="page-footer">
- YesWash 超级进化车生活
- </footer>
- <script>
- (function() {
- var phoneInput = document.getElementById('phoneNumber');
- var submitBtn = document.getElementById('submitBtn');
- var fieldError = document.getElementById('fieldError');
- var loadingArea = document.getElementById('loadingArea');
- var resultCard = document.getElementById('resultCard');
- var resultIcon = document.getElementById('resultIcon');
- var resultTitle = document.getElementById('resultTitle');
- var resultDesc = document.getElementById('resultDesc');
- var collectBtn = document.getElementById('collectBtn');
- var mainCard = document.querySelector('.main-card');
- var redirectUrl = null;
- var querying = false;
- var phoneRegex = /^1[3-9]\d{9}$/;
- function showFieldError(msg) {
- fieldError.querySelector('span').textContent = msg;
- fieldError.classList.add('show');
- phoneInput.classList.add('error');
- }
- function clearFieldError() {
- fieldError.classList.remove('show');
- phoneInput.classList.remove('error');
- }
- function setLoading(loading) {
- querying = loading;
- if (loading) {
- loadingArea.classList.add('active');
- mainCard.style.opacity = '0.6';
- mainCard.style.pointerEvents = 'none';
- submitBtn.disabled = true;
- resultCard.classList.remove('show');
- resultCard.className = 'result-card';
- collectBtn.style.display = 'none';
- } else {
- loadingArea.classList.remove('active');
- mainCard.style.opacity = '';
- mainCard.style.pointerEvents = '';
- submitBtn.disabled = false;
- }
- }
- function showResult(type, title, desc, showClaimBtn) {
- resultCard.className = 'result-card ' + type + ' show';
- resultIcon.className = 'result-icon ' + type;
- var iconSvg = '';
- if (type === 'success') {
- iconSvg = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';
- } else if (type === 'warning') {
- iconSvg = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>';
- } else {
- iconSvg = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>';
- }
- resultIcon.innerHTML = iconSvg;
- resultTitle.textContent = title;
- resultDesc.textContent = desc;
- if (showClaimBtn) {
- collectBtn.style.display = 'inline-flex';
- } else {
- collectBtn.style.display = 'none';
- }
- resultCard.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
- }
- document.getElementById('queryForm').addEventListener('submit', function(e) {
- e.preventDefault();
- if (querying) return;
- var phone = phoneInput.value.replace(/\D/g, '');
- clearFieldError();
- if (!phoneRegex.test(phone)) {
- showFieldError('请输入正确的11位手机号码');
- phoneInput.focus();
- return;
- }
- setLoading(true);
- fetch('https://dev.kuaiyuman.cn/api/parking-coupon/checkParkingCoupon?mobilePhone=' + encodeURIComponent(phone))
- .then(function(res) {
- if (!res.ok) {
- throw new Error('服务繁忙,请稍后重试');
- }
- return res.json();
- })
- .then(function(data) {
- setLoading(false);
- if (data.code === 200) {
- redirectUrl = data.data;
- showResult('success',
- '符合减免条件',
- '您的手机号符合停车费用减免资格,点击下方按钮领取停车优惠券。',
- true
- );
- } else {
- showResult('warning',
- '暂不符合条件',
- data.message || '暂不符合停车减免条件,如有疑问请联系客服。',
- false
- );
- }
- })
- .catch(function(err) {
- setLoading(false);
- showResult('error',
- '网络异常',
- err.message || '网络连接失败,请检查网络后重试。',
- false
- );
- });
- });
- collectBtn.addEventListener('click', function() {
- if (redirectUrl && !querying) {
- setLoading(true);
- location.href = redirectUrl;
- }
- });
- phoneInput.addEventListener('input', function() {
- this.value = this.value.replace(/\D/g, '');
- if (this.value.length >= 11) {
- clearFieldError();
- }
- });
- phoneInput.focus();
- })();
- </script>
- </body>
- </html>
|