yingsa/miniprogram/pages/match/challenge/index.wxss
Ethanfly d07ebb735a fix(env): Update API URL and enhance HTML structure
- Change VITE_API_URL in .env from localhost:3000 to localhost:3001 for backend access.
- Update index.html to replace favicon with logo.png and ensure proper HTML structure.
- Add new dependencies for WangEditor in package.json and package-lock.json to support rich text editing features.
2026-02-06 19:04:16 +08:00

1125 lines
19 KiB
Plaintext

/* ==========================================
挑战赛页面 - 全新设计
========================================== */
.page-container {
min-height: 100vh;
background: linear-gradient(
180deg,
var(--primary-soft) 0%,
var(--bg-page) 30%,
var(--bg-soft) 100%
);
position: relative;
overflow: hidden;
}
/* 顶部装饰背景 */
.hero-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 420rpx;
background: transparent;
pointer-events: none;
overflow: hidden;
}
.hero-bg::before {
display: none;
}
.hero-bg::after {
display: none;
}
.hero-pattern {
position: absolute;
top: 40rpx;
left: 50%;
transform: translateX(-50%);
width: 200rpx;
height: 200rpx;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='2' stroke-dasharray='10 5'/%3E%3C/svg%3E");
background-size: contain;
animation: spin 20s linear infinite;
}
@keyframes spin {
to {
transform: translateX(-50%) rotate(360deg);
}
}
/* 主要内容 */
.main-content {
position: relative;
z-index: 1;
padding: 24rpx;
}
/* 页面标题 */
.page-header {
text-align: center;
padding: 32rpx 0 40rpx;
margin-bottom: 8rpx;
}
.page-title {
display: block;
font-size: 52rpx;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 12rpx;
letter-spacing: 1rpx;
}
.page-subtitle {
display: block;
font-size: 26rpx;
color: var(--text-muted);
font-weight: 400;
letter-spacing: 0.5rpx;
}
/* 当前门店栏 */
.store-bar {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
padding: 20rpx 24rpx;
background: var(--bg-white);
border-radius: 16rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
margin: 0 auto 24rpx;
width: fit-content;
border: 1rpx solid var(--border-soft);
}
.store-icon {
width: 28rpx;
height: 28rpx;
}
.store-name {
font-size: 26rpx;
font-weight: 600;
color: var(--text-primary);
max-width: 300rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.store-arrow {
font-size: 32rpx;
color: var(--primary);
font-weight: 600;
}
/* 提示卡片 */
.notice-card {
display: flex;
align-items: center;
gap: 20rpx;
padding: 28rpx 24rpx;
background: linear-gradient(
135deg,
var(--primary-soft) 0%,
var(--bg-white) 100%
);
border: 2rpx solid var(--border-primary);
border-radius: 24rpx;
margin-bottom: 24rpx;
box-shadow: 0 4rpx 16rpx rgba(255, 152, 0, 0.1);
}
.notice-icon {
width: 80rpx;
height: 80rpx;
background: var(--primary-gradient-soft);
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.notice-icon-img {
width: 44rpx;
height: 44rpx;
}
.notice-content {
flex: 1;
}
.notice-title {
display: block;
font-size: 30rpx;
font-weight: 700;
color: var(--primary-dark);
margin-bottom: 6rpx;
}
.notice-desc {
display: block;
font-size: 24rpx;
color: var(--primary);
}
.notice-action {
padding: 16rpx 28rpx;
background: var(--primary-gradient);
border-radius: 50rpx;
box-shadow: var(--shadow-primary);
}
.notice-action:active {
transform: scale(0.95);
}
.refresh-text {
font-size: 26rpx;
color: #fff;
font-weight: 600;
}
/* ==========================================
用户信息卡片 - 全新设计
========================================== */
.user-card {
background: linear-gradient(
135deg,
var(--bg-white) 0%,
var(--bg-card-hover) 100%
);
border-radius: 28rpx;
padding: 0;
margin-bottom: 24rpx;
box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.08);
overflow: hidden;
border: 1rpx solid var(--border-primary);
}
.user-card-inner {
display: flex;
align-items: center;
gap: 24rpx;
padding: 28rpx;
position: relative;
}
.user-card-inner::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 6rpx;
background: var(--primary-gradient);
}
.user-avatar-box {
width: 120rpx;
height: 120rpx;
flex-shrink: 0;
position: relative;
}
.user-avatar-box::before {
content: "";
position: absolute;
inset: -6rpx;
background: var(--primary-gradient);
border-radius: 50%;
z-index: 0;
}
.user-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
border: 4rpx solid #fff;
position: relative;
z-index: 1;
}
.user-info-box {
flex: 1;
min-width: 0;
}
.user-name-row {
display: flex;
align-items: center;
gap: 14rpx;
margin-bottom: 16rpx;
}
.user-name {
font-size: 36rpx;
font-weight: 800;
color: var(--text-primary);
letter-spacing: 2rpx;
}
.user-level {
padding: 6rpx 18rpx;
border-radius: 50rpx;
font-size: 24rpx;
font-weight: 700;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.user-level.lv1 {
background: linear-gradient(135deg, #81c784, #66bb6a);
color: #fff;
}
.user-level.lv2 {
background: linear-gradient(135deg, #64b5f6, #42a5f5);
color: #fff;
}
.user-level.lv3 {
background: linear-gradient(135deg, #ffb74d, #ffa726);
color: #fff;
}
.user-level.lv4 {
background: linear-gradient(135deg, #f06292, #ec407a);
color: #fff;
}
.user-level.lv5 {
background: linear-gradient(135deg, #ba68c8, #ab47bc);
color: #fff;
}
.user-stats-row {
display: flex;
gap: 32rpx;
}
.mini-stat {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.mini-stat-value {
font-size: 36rpx;
font-weight: 800;
color: var(--text-primary);
line-height: 1.2;
}
.mini-stat-value.win {
color: #00c853;
}
.mini-stat-label {
font-size: 22rpx;
color: var(--text-muted);
margin-top: 4rpx;
}
/* ==========================================
扫码入口 - 全新设计
========================================== */
.scan-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20rpx;
margin-bottom: 24rpx;
}
.scan-card {
background: #fff;
border-radius: 28rpx;
padding: 32rpx 20rpx;
text-align: center;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
position: relative;
overflow: hidden;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
border: 2rpx solid transparent;
}
.scan-card.challenge {
border-color: rgba(255, 107, 53, 0.15);
}
.scan-card.ranking {
border-color: rgba(255, 193, 7, 0.2);
}
.scan-card::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
opacity: 0;
transition: opacity 0.25s;
}
.scan-card.challenge::before {
background: linear-gradient(
180deg,
rgba(255, 107, 53, 0.08) 0%,
transparent 50%
);
}
.scan-card.ranking::before {
background: linear-gradient(
180deg,
rgba(255, 193, 7, 0.1) 0%,
transparent 50%
);
}
.scan-card:active {
transform: scale(0.95);
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
}
.scan-card:active::before {
opacity: 1;
}
.scan-icon-wrapper {
width: 100rpx;
height: 100rpx;
margin: 0 auto 20rpx;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.scan-card.challenge .scan-icon-wrapper {
background: linear-gradient(135deg, #ffe8dd, #ffccbc);
}
.scan-card.ranking .scan-icon-wrapper {
background: linear-gradient(135deg, #fff8e1, #ffe082);
}
.scan-icon-img {
width: 56rpx;
height: 56rpx;
}
.scan-title {
display: block;
font-size: 34rpx;
font-weight: 800;
color: var(--text-primary);
margin-bottom: 8rpx;
letter-spacing: 2rpx;
}
.scan-desc {
display: block;
font-size: 24rpx;
color: var(--text-muted);
margin-bottom: 16rpx;
}
.scan-badge {
display: inline-block;
padding: 8rpx 20rpx;
background: linear-gradient(135deg, #ff8a65, #ff6b35);
color: #fff;
font-size: 22rpx;
font-weight: 700;
border-radius: 50rpx;
box-shadow: 0 4rpx 12rpx rgba(255, 107, 53, 0.25);
}
.scan-badge.accent {
background: linear-gradient(135deg, #ffd54f, #ffb300);
color: #5d4037;
box-shadow: 0 4rpx 12rpx rgba(255, 179, 0, 0.3);
}
/* ==========================================
进行中的比赛
========================================== */
.ongoing-card {
background: #fff;
border-radius: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
overflow: hidden;
border: 2rpx solid rgba(255, 87, 34, 0.15);
}
.ongoing-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 24rpx;
background: linear-gradient(90deg, #fff3e0, #ffffff);
border-bottom: 1rpx solid rgba(255, 152, 0, 0.1);
}
.ongoing-header-left {
display: flex;
align-items: center;
gap: 10rpx;
}
.ongoing-icon-img {
width: 28rpx;
height: 28rpx;
opacity: 0.9;
}
.ongoing-title {
font-size: 28rpx;
font-weight: 700;
color: var(--text-primary);
}
.ongoing-count {
min-width: 40rpx;
height: 40rpx;
padding: 0 14rpx;
background: linear-gradient(135deg, #ff5722, #ff8a65);
color: #fff;
font-size: 24rpx;
font-weight: 700;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(255, 87, 34, 0.3);
}
.ongoing-list {
padding: 16rpx;
}
.ongoing-item {
background: linear-gradient(135deg, #fafafa, #f5f5f5);
border-radius: 20rpx;
margin-bottom: 16rpx;
overflow: hidden;
border: 2rpx solid transparent;
transition: all 0.2s;
}
.ongoing-item:last-child {
margin-bottom: 0;
}
.ongoing-item.challenge {
border-color: rgba(255, 107, 53, 0.15);
}
.ongoing-item.ranking {
border-color: rgba(255, 193, 7, 0.2);
}
.ongoing-item:active {
transform: scale(0.98);
}
.ongoing-item-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14rpx 18rpx;
background: rgba(255, 255, 255, 0.6);
}
.match-type-tag {
padding: 6rpx 16rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 700;
}
.match-type-tag.challenge {
background: linear-gradient(135deg, #ffe8dd, #ffccbc);
color: #e65100;
}
.match-type-tag.ranking {
background: linear-gradient(135deg, #fff8e1, #ffe082);
color: #f57c00;
}
.match-status-tag {
padding: 6rpx 14rpx;
border-radius: 8rpx;
font-size: 20rpx;
font-weight: 600;
}
.match-status-tag.waiting {
background: #e3f2fd;
color: #1565c0;
}
.match-status-tag.playing {
background: #e8f5e9;
color: #2e7d32;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.ongoing-item-body {
padding: 18rpx;
}
/* 挑战赛对手信息 */
.opponent-info {
display: flex;
align-items: center;
gap: 16rpx;
}
.opponent-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
border: 3rpx solid #ffe0b2;
}
.opponent-detail {
flex: 1;
}
.opponent-name {
font-size: 30rpx;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 6rpx;
display: block;
}
.opponent-stats {
display: flex;
gap: 16rpx;
}
.opponent-level {
padding: 4rpx 12rpx;
background: linear-gradient(135deg, #ffb74d, #ffa726);
color: #fff;
font-size: 20rpx;
font-weight: 600;
border-radius: 6rpx;
}
.opponent-power {
font-size: 22rpx;
color: var(--text-muted);
}
/* 排位赛信息 */
.ranking-info {
display: flex;
flex-direction: column;
gap: 10rpx;
}
.ranking-name {
font-size: 30rpx;
font-weight: 700;
color: var(--text-primary);
}
.ranking-meta {
display: flex;
gap: 16rpx;
font-size: 22rpx;
color: var(--text-muted);
}
.ranking-stage {
padding: 4rpx 12rpx;
background: #e3f2fd;
color: #1565c0;
border-radius: 6rpx;
font-weight: 600;
}
.ranking-players {
color: var(--text-secondary);
}
.current-opponent {
display: flex;
align-items: center;
gap: 8rpx;
font-size: 24rpx;
}
.current-label {
color: var(--text-muted);
}
.current-name {
color: var(--primary);
font-weight: 600;
}
.my-status {
font-size: 24rpx;
font-weight: 600;
}
.my-status.waiting {
color: #1565c0;
}
.my-status.playing {
color: #2e7d32;
}
.my-status.finished {
color: var(--text-muted);
}
.ongoing-item-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14rpx 18rpx;
background: rgba(255, 255, 255, 0.8);
border-top: 1rpx solid rgba(0, 0, 0, 0.04);
}
.match-weight {
padding: 4rpx 12rpx;
background: linear-gradient(135deg, #ff8a65, #ff6b35);
color: #fff;
font-size: 20rpx;
font-weight: 600;
border-radius: 6rpx;
}
.enter-btn {
font-size: 24rpx;
color: var(--primary);
font-weight: 600;
}
/* ==========================================
待确认比赛
========================================== */
.pending-card {
background: #fff;
border-radius: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
overflow: hidden;
border: 2rpx solid rgba(255, 107, 53, 0.15);
}
/* 最近比赛 */
.recent-card {
margin-top: 24rpx;
margin-bottom: 24rpx;
padding: 24rpx;
border-radius: 20rpx;
background: #ffffff;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
}
.recent-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12rpx;
}
.recent-header-left {
display: flex;
align-items: center;
gap: 8rpx;
}
.recent-icon-img {
width: 32rpx;
height: 32rpx;
}
.recent-title {
font-size: 28rpx;
font-weight: 600;
color: var(--text-primary);
}
.recent-actions {
font-size: 24rpx;
color: var(--primary, #ff6b35);
}
.recent-more-pill {
padding: 8rpx 20rpx;
border-radius: 999rpx;
border: 2rpx solid rgba(255, 107, 53, 0.4);
color: #ff6b35;
background: rgba(255, 248, 243, 0.9);
font-size: 22rpx;
}
.recent-list {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.recent-item {
border-radius: 16rpx;
background: #fafafa;
padding: 16rpx 18rpx;
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.02);
}
.recent-item:last-child {
}
.recent-item-inner {
flex: 1;
}
.recent-line-1 {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 4rpx;
}
.recent-name {
font-size: 26rpx;
color: var(--text-primary);
max-width: 420rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.recent-type-tag {
font-size: 22rpx;
padding: 4rpx 12rpx;
border-radius: 999rpx;
background: rgba(25, 118, 210, 0.06);
color: #1565c0;
}
.recent-type-tag.challenge {
background: rgba(255, 152, 0, 0.08);
color: #e65100;
}
.recent-type-tag.ranking {
background: rgba(25, 118, 210, 0.08);
color: #1565c0;
}
.recent-line-2 {
display: flex;
align-items: center;
gap: 10rpx;
font-size: 22rpx;
color: var(--text-muted);
}
.recent-status {
font-weight: 500;
padding: 4rpx 10rpx;
border-radius: 16rpx;
font-size: 20rpx;
}
.status-pending {
background: rgba(255, 193, 7, 0.12);
color: #ff8f00;
}
.status-ongoing {
background: rgba(76, 175, 80, 0.12);
color: #2e7d32;
}
.status-finished {
background: rgba(158, 158, 158, 0.12);
color: #616161;
}
.status-cancelled {
background: rgba(244, 67, 54, 0.12);
color: #c62828;
}
.recent-line-3 {
font-size: 22rpx;
color: var(--text-muted);
margin-top: 4rpx;
}
.pending-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 24rpx;
background: linear-gradient(90deg, #fff5f2, #ffffff);
border-bottom: 1rpx solid rgba(255, 107, 53, 0.1);
}
.pending-title {
font-size: 28rpx;
font-weight: 700;
color: var(--text-primary);
}
.pending-count {
min-width: 40rpx;
height: 40rpx;
padding: 0 14rpx;
background: linear-gradient(135deg, #ff8a65, #ff6b35);
color: #fff;
font-size: 24rpx;
font-weight: 700;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(255, 107, 53, 0.3);
}
.pending-list {
padding: 16rpx;
}
.pending-item {
display: flex;
align-items: center;
padding: 18rpx 20rpx;
background: linear-gradient(135deg, #fafafa, #f5f5f5);
border-radius: 16rpx;
margin-bottom: 12rpx;
transition: all 0.2s;
}
.pending-item:last-child {
margin-bottom: 0;
}
.pending-item:active {
background: linear-gradient(135deg, #f5f5f5, #eeeeee);
}
.game-info {
flex: 1;
display: flex;
align-items: center;
gap: 12rpx;
}
.vs-tag {
padding: 6rpx 14rpx;
background: linear-gradient(135deg, #ff8a65, #ff6b35);
color: #fff;
font-size: 20rpx;
font-weight: 800;
border-radius: 8rpx;
}
.opponent-name {
font-size: 28rpx;
font-weight: 700;
color: var(--text-primary);
}
.game-score {
font-size: 32rpx;
font-weight: 800;
color: var(--text-primary);
padding: 0 20rpx;
font-family: "SF Mono", "Monaco", monospace;
}
.confirm-btn {
padding: 14rpx 28rpx;
background: linear-gradient(135deg, #00c853, #00e676);
color: #fff;
font-size: 24rpx;
font-weight: 700;
border-radius: 50rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 200, 83, 0.3);
}
.confirm-btn:active {
transform: scale(0.95);
}
/* ==========================================
规则卡片
========================================== */
.rules-card {
background: #fff;
border-radius: 28rpx;
padding: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
margin-top: 0;
}
.rules-header {
display: flex;
align-items: center;
gap: 12rpx;
padding-bottom: 18rpx;
margin-bottom: 20rpx;
border-bottom: 2rpx dashed rgba(0, 0, 0, 0.06);
}
.rules-icon {
width: 48rpx;
height: 48rpx;
background: linear-gradient(135deg, #fff3e0, #ffe0b2);
border-radius: 14rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rules-icon-img {
width: 28rpx;
height: 28rpx;
}
.rules-title {
font-size: 30rpx;
font-weight: 700;
color: var(--text-primary);
}
.rules-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 14rpx;
}
.rule-item {
display: flex;
align-items: center;
gap: 14rpx;
padding: 18rpx;
background: linear-gradient(135deg, #fafafa, #f5f5f5);
border-radius: 18rpx;
transition: all 0.2s;
}
.rule-item:active {
transform: scale(0.98);
}
.rule-icon {
width: 48rpx;
height: 48rpx;
border-radius: 14rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
font-weight: 800;
flex-shrink: 0;
}
.rule-icon-img {
width: 28rpx;
height: 28rpx;
}
.rule-icon.win {
background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
color: #2e7d32;
}
.rule-icon.lose {
background: linear-gradient(135deg, #ffebee, #ffcdd2);
color: #c62828;
}
.rule-icon.bonus {
background: linear-gradient(135deg, #fff8e1, #ffecb3);
color: #f57c00;
}
.rule-icon.shield {
background: linear-gradient(135deg, #e3f2fd, #bbdefb);
color: #1565c0;
}
.rule-text {
flex: 1;
min-width: 0;
}
.rule-label {
display: block;
font-size: 22rpx;
color: var(--text-muted);
margin-bottom: 4rpx;
}
.rule-value {
display: block;
font-size: 26rpx;
font-weight: 700;
color: var(--text-primary);
}
.rule-value.positive {
color: #2e7d32;
}
.rule-value.negative {
color: #c62828;
}
.rules-note {
margin-top: 18rpx;
padding: 18rpx;
background: linear-gradient(135deg, #fff8e1, #fffde7);
border-radius: 14rpx;
text-align: center;
font-size: 24rpx;
color: #f57c00;
font-weight: 600;
border: 1rpx solid rgba(255, 152, 0, 0.15);
}
/* 动画 */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fadeInUp {
animation: fadeInUp 0.5s ease-out forwards;
}