diff --git a/README.md b/README.md index 1e12405d..d5dd1b71 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,9 @@ docker compose -f docker-compose.dev.yml down `order_site` 根目录提供 `./dev.sh` 快捷入口。默认直接启动源码挂载开发环境: ```bash -./dev.sh # 启动/更新 dev 环境 -./dev.sh logs # 跟踪全部 dev 日志 +./dev.sh # 启动/更新并直接跟踪应用日志 +./dev.sh up # 只启动/更新,不占用终端 +./dev.sh logs # 跟踪 backend / frontend / web 日志 ./dev.sh logs frontend # 只看 Vite HMR 日志 ./dev.sh logs backend # 只看后端热重载日志 ./dev.sh ps # 查看 dev 容器 diff --git a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx index 004c2b53..c6b32370 100644 --- a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx +++ b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx @@ -25,6 +25,11 @@ import type { import { formatAdminDateTime } from '@/utils/admin-time' const POLL_INTERVAL_MS = 3000 +const BINDING_FAILURE_ISSUES = new Set([ + 'binding_failed', + 'account_role_cooldown', + 'customer_role_cooldown', +]) const STATUS_LABELS: Record = { waiting_profile: '等待填写资料', @@ -116,9 +121,11 @@ export default function DouyuFulfillmentPage() { const task = data?.task const live = data?.live const needsProfile = Boolean(task && !task.customer_role_name) + const bindingFailed = Boolean(live && BINDING_FAILURE_ISSUES.has(live.issueCode)) const activeBinding = Boolean( task && !needsProfile && + !bindingFailed && !['completed', 'cancelled'].includes(task.status) && !live?.bindConfirmed, ) @@ -201,19 +208,27 @@ export default function DouyuFulfillmentPage() { const waitingForSupport = Boolean( task && (live?.bindConfirmed || task.status === 'waiting_operator' || task.status === 'bound'), ) + const bindingFailureMessage = + live?.issueCode === 'account_role_cooldown' + ? '当前斗鱼账号暂不可换绑,本次绑定未生效。' + : live?.issueCode === 'customer_role_cooldown' + ? '该游戏角色仍处于换绑冷却期,本次绑定未生效。' + : '本次游戏角色绑定失败。' const bindingDescription = live?.bindConfirmed ? '角色绑定已完成,待客服处理。' : live?.bindReadyForConfirm ? '已识别游戏角色,请核对并确认绑定。' - : qrExpired - ? '当前二维码已过期,请刷新二维码后重新扫码。' - : live?.issueCode === 'binding_failed' - ? '暂未识别到绑定角色,请继续使用当前二维码完成扫码。' - : !live?.accountReady - ? '系统正在自动准备账号和二维码,请稍候,无需重复操作。' - : live?.qrUrl - ? '必须使用微信扫码。请选择与资料一致的和平精英角色,QQ 扫码或其他方式无效。' - : live?.message || '正在准备绑定二维码,请稍候。' + : bindingFailed + ? bindingFailureMessage + : qrExpired + ? '当前二维码已过期,请刷新二维码后重新扫码。' + : live?.issueCode === 'binding_failed' + ? '暂未识别到绑定角色,请继续使用当前二维码完成扫码。' + : !live?.accountReady + ? '系统正在自动准备账号和二维码,请稍候,无需重复操作。' + : live?.qrUrl + ? '必须使用微信扫码。请选择与资料一致的和平精英角色,QQ 扫码或其他方式无效。' + : live?.message || '正在准备绑定二维码,请稍候。' const bindingStageTitle = task?.status === 'qr_pending' && live?.qrUrl ? '必须使用微信扫码绑定' @@ -330,7 +345,9 @@ export default function DouyuFulfillmentPage() { return ( @@ -388,15 +405,27 @@ export default function DouyuFulfillmentPage() { ) : (
- + {bindingFailed ? ( +
+ +

请截图本页面并联系客服处理,客服会根据截图重新安排绑定。

+
+ ) : ( + + )} - {canRevealBindingQr ? ( + {!bindingFailed && canRevealBindingQr ? ( ) : null} - {!live?.qrUrl && task.status !== 'completed' ? ( + {!bindingFailed && + !live?.qrUrl && + !live?.bindReadyForConfirm && + task.status !== 'completed' ? (

游戏角色绑定二维码

@@ -442,7 +474,7 @@ export default function DouyuFulfillmentPage() {
) : null} - {live?.qrUrl && showBindingQr ? ( + {!bindingFailed && live?.qrUrl && showBindingQr ? (

游戏角色绑定二维码

@@ -497,7 +529,7 @@ export default function DouyuFulfillmentPage() {
) : null} - {live?.bindReadyForConfirm ? ( + {!bindingFailed && live?.bindReadyForConfirm ? (

核对绑定角色

diff --git a/apps/frontend/src/styles/client.css b/apps/frontend/src/styles/client.css index d8cd5a64..c5fb03e7 100644 --- a/apps/frontend/src/styles/client.css +++ b/apps/frontend/src/styles/client.css @@ -3249,6 +3249,24 @@ color: #ff8a92; } +.customer-douyu-binding-failure { + display: flex; + flex-direction: column; + gap: 10px; +} + +.customer-douyu-binding-failure > p { + margin: 0; + padding: 12px 14px; + color: #fecaca; + font-size: 13px; + line-height: 1.6; + text-align: center; + border: 1px solid rgba(248, 113, 113, 0.3); + border-radius: 10px; + background: rgba(127, 29, 29, 0.18); +} + .customer-auth-page.is-douyu.is-compact { height: 100vh; height: 100dvh; diff --git a/dev.sh b/dev.sh index 3c11104d..a1d12a5c 100755 --- a/dev.sh +++ b/dev.sh @@ -3,6 +3,12 @@ set -Eeuo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" COMPOSE_FILE="${ROOT_DIR}/docker-compose.dev.yml" +LOG_TAIL="${DEV_LOG_TAIL:-120}" + +follow_app_logs() { + printf '\n[dev] 跟踪 backend / frontend / web 日志(Ctrl+C 只退出日志,不停止容器)\n' + docker compose -f "${COMPOSE_FILE}" logs -f --tail="${LOG_TAIL}" backend frontend web +} case "${1:-}" in up|start) @@ -10,7 +16,10 @@ case "${1:-}" in ;; logs) shift - exec docker compose -f "${COMPOSE_FILE}" logs -f --tail=200 "$@" + if [[ $# -eq 0 ]]; then + set -- backend frontend web + fi + exec docker compose -f "${COMPOSE_FILE}" logs -f --tail="${LOG_TAIL}" "$@" ;; down|stop) exec docker compose -f "${COMPOSE_FILE}" down @@ -18,6 +27,10 @@ case "${1:-}" in ps|status) exec docker compose -f "${COMPOSE_FILE}" ps ;; + "") + bash "${ROOT_DIR}/deploy/mac-dev.sh" + follow_app_logs + ;; *) exec bash "${ROOT_DIR}/deploy/mac-dev.sh" "$@" ;;