Files
wordpress-theme-aksrt/inc/helpers/user-center-renderers/profile-tickets.php
T
kate522andClaude Opus 5 35bb96e82f refactor: rename the theme brand and every identifier from AKSRT to Jio
Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-01 20:05:04 +08:00

114 lines
5.1 KiB
PHP

<?php
/**
* User center ticket (工单) panel.
*
* 数据全部来自 /jio/v1/tickets* REST;本文件只输出容器、筛选控件与首屏骨架,
* 交互在 assets/js/ticket-center.js(附件 / 公告 / 催单配置取自 jioData.ticket)。
*
* @package Jio
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'jio') . '</div>';
return;
}
$enabled = class_exists('\Jio\Ticket\TicketSettings') && \Jio\Ticket\TicketSettings::enabled();
if (!$enabled) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('工单功能暂未开启', 'jio') . '</div>';
return;
}
$statuses = class_exists('\Jio\Ticket\TicketStatusService')
? \Jio\Ticket\TicketStatusService::all()
: [];
$types = class_exists('\Jio\Ticket\TicketTypeService')
? \Jio\Ticket\TicketTypeService::public_list()
: [];
?>
<div class="jio-tickets-page uc-tickets-panel" data-jio-ticket-center>
<header class="uc-tickets-panel__head">
<div class="uc-tickets-panel__title-wrap">
<p class="jio-tickets-page__eyebrow"><?php esc_html_e('我的服务', 'jio'); ?></p>
<div class="uc-tickets-panel__title font-bold em12">
<i class="fa fas fa-headset uc-tickets-panel__title-icon" aria-hidden="true"></i>
<?php esc_html_e('工单中心', 'jio'); ?>
</div>
<p class="muted-2-color em09 mt3"><?php esc_html_e('提交问题工单,跟踪处理进度并与客服沟通。', 'jio'); ?></p>
</div>
<button class="btn-primary jio-tickets-page__create" type="button" data-jio-ticket-create>
<i class="fa fas fa-plus" aria-hidden="true"></i><?php esc_html_e('提交工单', 'jio'); ?>
</button>
</header>
<?php // 统计卡同时是状态快捷筛选:点击按该状态过滤,再次点击取消。 ?>
<div class="jio-tickets-page__stats" data-jio-ticket-stats role="group" aria-label="<?php esc_attr_e('按状态筛选', 'jio'); ?>">
<button type="button" class="jio-tickets-page__stat is-active" data-jio-ticket-stat="" aria-pressed="true">
<span><?php esc_html_e('全部', 'jio'); ?></span><strong>0</strong>
</button>
<?php foreach ($statuses as $status) : ?>
<button
type="button"
class="jio-tickets-page__stat"
data-jio-ticket-stat="<?php echo esc_attr((string) $status['status_key']); ?>"
style="--jio-ticket-color: <?php echo esc_attr((string) $status['color']); ?>"
aria-pressed="false"
>
<span><i class="jio-tickets-page__stat-dot" aria-hidden="true"></i><?php echo esc_html((string) $status['name']); ?></span><strong>0</strong>
</button>
<?php endforeach; ?>
</div>
<form class="jio-tickets-page__search" data-jio-tickets-search role="search">
<label class="jio-tickets-page__search-box">
<span class="screen-reader-text"><?php esc_html_e('按工单号或标题查找', 'jio'); ?></span>
<i class="fa fas fa-search" aria-hidden="true"></i>
<input type="search" maxlength="60" autocomplete="off" placeholder="<?php esc_attr_e('搜索工单号或标题', 'jio'); ?>">
</label>
<select data-jio-ticket-filter="status" aria-label="<?php esc_attr_e('工单状态', 'jio'); ?>">
<option value=""><?php esc_html_e('全部状态', 'jio'); ?></option>
<?php foreach ($statuses as $status) : ?>
<option value="<?php echo esc_attr((string) $status['status_key']); ?>"><?php echo esc_html((string) $status['name']); ?></option>
<?php endforeach; ?>
</select>
<?php if ($types !== []) : ?>
<select data-jio-ticket-filter="ticket_type_id" aria-label="<?php esc_attr_e('工单部门', 'jio'); ?>">
<option value=""><?php esc_html_e('全部部门', 'jio'); ?></option>
<?php foreach ($types as $type) : ?>
<option value="<?php echo esc_attr((string) $type['id']); ?>"><?php echo esc_html((string) $type['name']); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<button class="jio-tickets-page__reset" type="button" data-jio-ticket-reset hidden><?php esc_html_e('清除筛选', 'jio'); ?></button>
</form>
<div class="jio-tickets-page__list" data-jio-ticket-list aria-live="polite" aria-busy="true">
<?php // 首屏骨架:沿用全站 .post_ajax_loader + .is-loading 契约,JS 拿到数据后整体替换。 ?>
<div class="post_ajax_loader is-loading" aria-hidden="true">
<?php for ($i = 0; $i < 3; $i++) : ?>
<div class="jio-tickets-page__card is-placeholder">
<div class="placeholder s1"></div>
<div class="placeholder k1"></div>
<div class="placeholder k3" style="width: 42%;"></div>
</div>
<?php endfor; ?>
</div>
</div>
<nav class="jio-tickets-page__pagination" data-jio-ticket-pagination aria-label="<?php esc_attr_e('工单分页', 'jio'); ?>" hidden></nav>
<?php
// 人机验证挂载点(提交工单 / 回复):场景未启用时 jio_render_captcha 无输出,
// ticket-center.js 以挂载点存在与否决定是否先过验证。
if (function_exists('jio_render_captcha')) {
jio_render_captcha('ticket_create');
jio_render_captcha('ticket_reply');
}
?>
</div>