调整文件结构;跑通admin端;初步设计页面结构

This commit is contained in:
2026-01-22 18:19:15 +08:00
parent 67ef2d6d6d
commit 2b0ee0c8b6
31 changed files with 5798 additions and 198 deletions

View File

@@ -1,64 +1,68 @@
<!-- 后台管理端首页 - UTS Android 兼容 -->
<!-- 后台管理端首页 - 基于CRMEB设计 -->
<template>
<view class="admin-container">
<!-- 头部导航 -->
<view class="header">
<view class="header-left">
<text class="app-title">商城管理后台</text>
<text class="welcome-text">欢迎回来,{{ adminInfo.nickname }}</text>
</view>
<view class="header-right">
<text class="notification-btn" @click="goToNotifications">🔔</text>
<text class="profile-btn" @click="goToProfile">👤</text>
</view>
</view>
<!-- 核心指标概览 -->
<view class="metrics-section">
<text class="section-title">核心指标</text>
<view class="metrics-grid">
<view class="metric-card">
<text class="metric-value">¥{{ platformStats.total_gmv }}</text>
<text class="metric-label">总GMV</text>
<text class="metric-change positive">+{{ platformStats.gmv_growth }}%</text>
</view>
<view class="metric-card">
<text class="metric-value">{{ platformStats.total_orders }}</text>
<text class="metric-label">总订单数</text>
<text class="metric-change positive">+{{ platformStats.order_growth }}%</text>
</view>
<view class="metric-card">
<text class="metric-value">{{ platformStats.total_users }}</text>
<text class="metric-label">注册用户</text>
<text class="metric-change positive">+{{ platformStats.user_growth }}%</text>
</view>
<view class="metric-card">
<text class="metric-value">{{ platformStats.total_merchants }}</text>
<text class="metric-label">入驻商家</text>
<text class="metric-change positive">+{{ platformStats.merchant_growth }}%</text>
<view class="admin-dashboard">
<!-- 基础信息统计卡片 -->
<view class="base-info-section">
<view class="info-grid">
<view class="info-card" v-for="(item, index) in infoList" :key="index">
<view class="card-header">
<text class="card-title">{{ item.title }}</text>
<text class="card-date">{{ item.date }}</text>
</view>
<view class="card-content">
<text class="today-number">{{ item.today }}</text>
<view class="comparison-info">
<text class="yesterday-text">昨日 {{ item.yesterday }}</text>
<text class="ratio-text" :class="{ positive: item.today_ratio >= 0, negative: item.today_ratio < 0 }">
日环比 {{ item.today_ratio }}%
<text class="ratio-icon">{{ item.today_ratio >= 0 ? '↑' : '↓' }}</text>
</text>
</view>
<view class="divider"></view>
<view class="total-info">
<text class="total-label">{{ item.total_name }}</text>
<text class="total-value">{{ item.total }}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 今日数据 -->
<view class="today-section">
<text class="section-title">今日数据</text>
<view class="today-grid">
<view class="today-item">
<text class="today-value">¥{{ todayStats.sales }}</text>
<text class="today-label">销售额</text>
<!-- 功能导航网格 -->
<view class="grid-menu-section">
<text class="section-title">功能导航</text>
<view class="menu-grid">
<view class="menu-item" @click="go('/pages/mall/admin/user-management')">
<view class="menu-icon user-icon">👥</view>
<text class="menu-text">用户管理</text>
</view>
<view class="today-item">
<text class="today-value">{{ todayStats.orders }}</text>
<text class="today-label">订单数</text>
<view class="menu-item" @click="go('/pages/mall/admin/product-management')">
<view class="menu-icon product-icon">📦</view>
<text class="menu-text">商品管理</text>
</view>
<view class="today-item">
<text class="today-value">{{ todayStats.new_users }}</text>
<text class="today-label">新增用户</text>
<view class="menu-item" @click="go('/pages/mall/admin/order-management')">
<view class="menu-icon order-icon">📋</view>
<text class="menu-text">订单管理</text>
</view>
<view class="today-item">
<text class="today-value">{{ todayStats.active_users }}</text>
<text class="today-label">活跃用户</text>
<view class="menu-item" @click="go('/pages/mall/admin/finance-management')">
<view class="menu-icon finance-icon">💰</view>
<text class="menu-text">财务管理</text>
</view>
<view class="menu-item" @click="go('/pages/mall/admin/marketing-management')">
<view class="menu-icon marketing-icon">📢</view>
<text class="menu-text">营销管理</text>
</view>
<view class="menu-item" @click="go('/pages/mall/admin/system-settings')">
<view class="menu-icon settings-icon">⚙️</view>
<text class="menu-text">系统设置</text>
</view>
<view class="menu-item" @click="go('/pages/mall/admin/coupon-management')">
<view class="menu-icon coupon-icon">🎫</view>
<text class="menu-text">优惠券管理</text>
</view>
<view class="menu-item" @click="go('/pages/mall/admin/activity-log')">
<view class="menu-icon log-icon">📊</view>
<text class="menu-text">活动日志</text>
</view>
</view>
</view>
@@ -67,7 +71,7 @@
<view class="pending-section">
<text class="section-title">待处理事项</text>
<view class="pending-list">
<view class="pending-item urgent" @click="goToMerchantReview">
<view class="pending-item urgent" @click="go('/pages/mall/admin/merchant-review')">
<text class="pending-icon">🏪</text>
<view class="pending-content">
<text class="pending-title">商家入驻审核</text>
@@ -75,8 +79,8 @@
</view>
<text class="pending-count">{{ pendingCounts.merchant_review }}</text>
</view>
<view class="pending-item" @click="goToProductReview">
<view class="pending-item" @click="go('/pages/mall/admin/product-review')">
<text class="pending-icon">📦</text>
<view class="pending-content">
<text class="pending-title">商品审核</text>
@@ -84,8 +88,8 @@
</view>
<text class="pending-count">{{ pendingCounts.product_review }}</text>
</view>
<view class="pending-item" @click="goToRefundReview">
<view class="pending-item" @click="go('/pages/mall/admin/refund-review')">
<text class="pending-icon">💰</text>
<view class="pending-content">
<text class="pending-title">退款处理</text>
@@ -93,8 +97,8 @@
</view>
<text class="pending-count">{{ pendingCounts.refund_review }}</text>
</view>
<view class="pending-item" @click="goToComplaints">
<view class="pending-item" @click="go('/pages/mall/admin/complaints')">
<text class="pending-icon">⚠️</text>
<view class="pending-content">
<text class="pending-title">投诉处理</text>
@@ -136,43 +140,43 @@
<view class="shortcuts-section">
<text class="section-title">快捷管理</text>
<view class="shortcuts-grid">
<view class="shortcut-item" @click="goToUserManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/user-management')">
<text class="shortcut-icon">👥</text>
<text class="shortcut-text">用户管理</text>
</view>
<view class="shortcut-item" @click="goToMerchantManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/merchant-management')">
<text class="shortcut-icon">🏪</text>
<text class="shortcut-text">商家管理</text>
</view>
<view class="shortcut-item" @click="goToProductManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/product-management')">
<text class="shortcut-icon">📦</text>
<text class="shortcut-text">商品管理</text>
</view>
<view class="shortcut-item" @click="goToOrderManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/order-management')">
<text class="shortcut-icon">📋</text>
<text class="shortcut-text">订单管理</text>
</view>
<view class="shortcut-item" @click="goToCouponManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/coupon-management')">
<text class="shortcut-icon">🎫</text>
<text class="shortcut-text">优惠券管理</text>
</view>
<view class="shortcut-item" @click="goToDeliveryManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/delivery-management')">
<text class="shortcut-icon">🚚</text>
<text class="shortcut-text">配送管理</text>
</view>
<view class="shortcut-item" @click="goToFinanceManagement">
<view class="shortcut-item" @click="go('/pages/mall/admin/finance-management')">
<text class="shortcut-icon">💳</text>
<text class="shortcut-text">财务管理</text>
</view>
<view class="shortcut-item" @click="goToSystemSettings">
<view class="shortcut-item" @click="go('/pages/mall/admin/system-settings')">
<text class="shortcut-icon">⚙️</text>
<text class="shortcut-text">系统设置</text>
</view>
<view class="shortcut-item" @click="goToAdminUserSubscriptions">
<view class="shortcut-item" @click="go('/pages/mall/admin/subscription/user-subscriptions')">
<text class="shortcut-icon">📑</text>
<text class="shortcut-text">用户订阅</text>
</view>
<view class="shortcut-item" @click="goToSubscriptionPlans">
<view class="shortcut-item" @click="go('/pages/mall/admin/subscription/plan-management')">
<text class="shortcut-icon">🧾</text>
<text class="shortcut-text">订阅方案</text>
</view>
@@ -183,7 +187,7 @@
<view class="activities-section">
<view class="section-header">
<text class="section-title">最新动态</text>
<text class="section-more" @click="goToActivityLog">查看全部</text>
<text class="section-more" @click="go('/pages/mall/admin/activity-log')">查看全部</text>
</view>
<view class="activities-list">
<view v-for="activity in recentActivities" :key="activity.id" class="activity-item">
@@ -284,6 +288,16 @@
delivering_orders: 0,
system_load: 0
} as RealTimeStatsType,
infoList:{
title: '总用户数',
date: '2025-01-08',
today: '1000',
yesterday: '900',
today_ratio: 10,
total_name: '总用户数',
total: '10000'
} as Array<InfoListType>,
recentActivities: [] as Array<ActivityType>
}
@@ -402,6 +416,7 @@
default: return '📝'
}
},
// 格式化时间
formatTime(timeStr: string): string {
@@ -418,108 +433,12 @@
return `${Math.floor(minutes / 1440)}天前`
}
},
// 导航方法
goToNotifications() {
uni.navigateTo({
url: '/pages/mall/admin/notifications'
})
},
goToProfile() {
uni.navigateTo({
url: '/pages/mall/admin/profile'
})
},
goToMerchantReview() {
uni.navigateTo({
url: '/pages/mall/admin/merchant-review'
})
},
goToProductReview() {
uni.navigateTo({
url: '/pages/mall/admin/product-review'
})
},
goToRefundReview() {
uni.navigateTo({
url: '/pages/mall/admin/refund-review'
})
},
goToComplaints() {
uni.navigateTo({
url: '/pages/mall/admin/complaints'
})
},
goToUserManagement() {
uni.navigateTo({
url: '/pages/mall/admin/user-management'
})
},
goToMerchantManagement() {
uni.navigateTo({
url: '/pages/mall/admin/merchant-management'
})
},
goToProductManagement() {
uni.navigateTo({
url: '/pages/mall/admin/product-management'
})
},
goToOrderManagement() {
uni.navigateTo({
url: '/pages/mall/admin/order-management'
})
},
goToCouponManagement() {
uni.navigateTo({
url: '/pages/mall/admin/coupon-management'
})
},
goToDeliveryManagement() {
uni.navigateTo({
url: '/pages/mall/admin/delivery-management'
})
},
goToFinanceManagement() {
uni.navigateTo({
url: '/pages/mall/admin/finance-management'
})
},
goToSystemSettings() {
uni.navigateTo({
url: '/pages/mall/admin/system-settings'
})
},
goToActivityLog() {
uni.navigateTo({
url: '/pages/mall/admin/activity-log'
})
},
goToSubscriptionPlans() {
uni.navigateTo({
url: '/pages/mall/admin/subscription/plan-management'
})
},
goToAdminUserSubscriptions() {
uni.navigateTo({
url: '/pages/mall/admin/subscription/user-subscriptions'
})
// 统一的导航方法
go(url: string) {
// 1) 目标页面必须是非 tabBar 页面
// 2) 必须在 pages.json / subPackages 注册
uni.navigateTo({ url })
}
}
}