feat(ux): after-sale multi-step, ban appeal, message types, coupon wallet
Orders center gains after-sale tickets (return ship/cancel/timeline), coupon wallet list, ban-appeal page, and expanded message center tabs.
This commit is contained in:
1 parent
3a883bc3d0
commit
1337664ed3
15 files changed
+999
-37
No files matched your search
@@ -53,7 +53,11 @@ $type_groups = [
|
||||
'all' => null, // special: all
|
||||
'comment' => ['comment_reply', 'comment_approved', 'pending_comments'],
|
||||
'credits' => ['credits_added', 'credits_deducted'],
|
||||
'system' => ['notice', 'download_ready', 'upload_moderation', 'verify_email'],
|
||||
'pay' => ['pay', 'order_paid', 'order_refund', 'shop_order', 'after_sale'],
|
||||
'vip' => ['vip', 'pay_vip', 'vip_expire', 'vip_upgrade'],
|
||||
'medal' => ['medal', 'badge', 'level_up'],
|
||||
'ban_appeal' => ['ban_appeal', 'user_ban', 'restriction'],
|
||||
'system' => ['notice', 'download_ready', 'upload_moderation', 'verify_email', 'auth_apply', 'auth_apply_reply'],
|
||||
'conversation' => ['conversation'],
|
||||
];
|
||||
|
||||
@@ -94,27 +98,31 @@ $offset = ($current_page - 1) * $per_page;
|
||||
$paged_items = array_slice($filtered, $offset, $per_page);
|
||||
|
||||
// 统计
|
||||
$type_counts = [
|
||||
'all' => count($all_notifications),
|
||||
'unread' => 0,
|
||||
'comment'=> 0,
|
||||
'credits'=> 0,
|
||||
'system' => 0,
|
||||
'conversation' => 0,
|
||||
];
|
||||
foreach ($all_notifications as $n) {
|
||||
$t = (string) ($n['type'] ?? 'notice');
|
||||
if (empty($n['read'])) {
|
||||
$type_counts['unread']++;
|
||||
}
|
||||
foreach (['comment', 'credits', 'system', 'conversation'] as $group) {
|
||||
if (in_array($t, $type_groups[$group], true)) {
|
||||
$type_counts[$group]++;
|
||||
$type_counts = [
|
||||
'all' => count($all_notifications),
|
||||
'unread' => 0,
|
||||
'comment' => 0,
|
||||
'credits' => 0,
|
||||
'pay' => 0,
|
||||
'vip' => 0,
|
||||
'medal' => 0,
|
||||
'ban_appeal' => 0,
|
||||
'system' => 0,
|
||||
'conversation' => 0,
|
||||
];
|
||||
foreach ($all_notifications as $n) {
|
||||
$t = (string) ($n['type'] ?? 'notice');
|
||||
if (empty($n['read'])) {
|
||||
$type_counts['unread']++;
|
||||
}
|
||||
foreach (['comment', 'credits', 'pay', 'vip', 'medal', 'ban_appeal', 'system', 'conversation'] as $group) {
|
||||
if (!empty($type_groups[$group]) && is_array($type_groups[$group]) && in_array($t, $type_groups[$group], true)) {
|
||||
$type_counts[$group]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($pm_enabled && class_exists('\AKSRT\Messages\PrivateMessage')) {
|
||||
if ($pm_enabled && class_exists('\AKSRT\Messages\PrivateMessage')) {
|
||||
// conversation count prefers live PM conversations when available
|
||||
$pm_tmp = \AKSRT\Messages\PrivateMessage::get_instance();
|
||||
if (method_exists($pm_tmp, 'get_conversations')) {
|
||||
@@ -126,17 +134,21 @@ if ($pm_enabled && class_exists('\AKSRT\Messages\PrivateMessage')) {
|
||||
}
|
||||
|
||||
$nav_items = [
|
||||
'unread' => __('未读消息', 'aksrt'),
|
||||
'all' => __('全部消息', 'aksrt'),
|
||||
'comment' => __('评论互动', 'aksrt'),
|
||||
'credits' => __('积分动态', 'aksrt'),
|
||||
'system' => __('系统通知', 'aksrt'),
|
||||
];
|
||||
if ($pm_enabled) {
|
||||
$nav_items['conversation'] = __('私信消息', 'aksrt');
|
||||
}
|
||||
'unread' => __('未读消息', 'aksrt'),
|
||||
'all' => __('全部消息', 'aksrt'),
|
||||
'comment' => __('评论互动', 'aksrt'),
|
||||
'credits' => __('积分动态', 'aksrt'),
|
||||
'pay' => __('交易通知', 'aksrt'),
|
||||
'vip' => __('会员动态', 'aksrt'),
|
||||
'medal' => __('徽章等级', 'aksrt'),
|
||||
'ban_appeal' => __('禁封申诉', 'aksrt'),
|
||||
'system' => __('系统通知', 'aksrt'),
|
||||
];
|
||||
if ($pm_enabled) {
|
||||
$nav_items['conversation'] = __('私信消息', 'aksrt');
|
||||
}
|
||||
|
||||
$icon_map = [
|
||||
$icon_map = [
|
||||
'comment_reply' => 'fas fa-comment-dots',
|
||||
'comment_approved' => 'fas fa-check-circle',
|
||||
'credits_added' => 'fas fa-coins',
|
||||
@@ -146,6 +158,18 @@ $icon_map = [
|
||||
'verify_email' => 'fas fa-envelope-open-text',
|
||||
'pending_comments' => 'fas fa-clock',
|
||||
'conversation' => 'fas fa-envelope',
|
||||
'pay' => 'fas fa-receipt',
|
||||
'order_paid' => 'fas fa-receipt',
|
||||
'order_refund' => 'fas fa-undo',
|
||||
'after_sale' => 'fas fa-undo-alt',
|
||||
'vip' => 'fas fa-crown',
|
||||
'pay_vip' => 'fas fa-crown',
|
||||
'medal' => 'fas fa-medal',
|
||||
'badge' => 'fas fa-certificate',
|
||||
'ban_appeal' => 'fas fa-gavel',
|
||||
'user_ban' => 'fas fa-ban',
|
||||
'auth_apply' => 'fas fa-id-badge',
|
||||
'auth_apply_reply' => 'fas fa-id-badge',
|
||||
'notice' => 'fas fa-bell',
|
||||
];
|
||||
|
||||
|
||||
Reference in new issue
Block a user