feat(worker-platform): 抢单大厅首页新增联系客服胶囊入口并抽象通用客服弹窗组件
1. 抽离打手端通用联系客服弹窗组件 WorkerContactModal,统一维护微信二维码、打手账号/状态/余额回显、一键复制及沟通提示; 2. 抢单大厅移动端顶部状态栏(余额上限右侧首屏黄金位)新增精致微动效【联系客服】胶囊按钮,大幅缩短找客服沟通链路; 3. 抢单大厅桌面端头部操作栏同步补齐【联系客服】按钮,并在个人中心账号弹窗中统一复用 WorkerContactModal; 4. 适配移动端与超窄屏自适应响应式样式,完成前端59项测试与全量打包构建验证。
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ArrowRightOutlined,
|
||||
CheckCircleOutlined,
|
||||
ClockCircleOutlined,
|
||||
CustomerServiceOutlined,
|
||||
FireOutlined,
|
||||
PushpinOutlined,
|
||||
QuestionCircleOutlined,
|
||||
@@ -35,6 +36,8 @@ import {
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import { WorkerContactModal } from '@/components/worker/WorkerContactModal'
|
||||
|
||||
import {
|
||||
fetchWorkerHallCategories,
|
||||
fetchWorkerHallOrders,
|
||||
@@ -83,6 +86,7 @@ export default function WorkerHallPage() {
|
||||
const [grabbingId, setGrabbingId] = useState(0)
|
||||
const [sharingOrder, setSharingOrder] = useState<WorkOrder | null>(null)
|
||||
const [leaderboardOpen, setLeaderboardOpen] = useState(false)
|
||||
const [contactOpen, setContactOpen] = useState(false)
|
||||
const [leaderboardPeriod, setLeaderboardPeriod] = useState<WorkerLeaderboardPeriod>('all')
|
||||
const [sharingQuantity, setSharingQuantity] = useState(1)
|
||||
const [submittingSharing, setSubmittingSharing] = useState(false)
|
||||
@@ -236,6 +240,7 @@ export default function WorkerHallPage() {
|
||||
setFailedImageKeys({})
|
||||
}, [allCategories.length, allIconUrl])
|
||||
const worker = profileQuery.data?.data.worker
|
||||
const financeConfig = profileQuery.data?.data.financeConfig
|
||||
const isInternalWorker = worker?.workerType === 'internal'
|
||||
const activeCount = Number(profileQuery.data?.data.summary.activeOrderCount || 0)
|
||||
const pendingAcceptanceCount = hallSummaryQuery.data?.pendingAcceptanceCount || 0
|
||||
@@ -411,6 +416,16 @@ export default function WorkerHallPage() {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="worker-hall-mobile-contact-pill"
|
||||
onClick={() => setContactOpen(true)}
|
||||
aria-label="联系客服"
|
||||
>
|
||||
<CustomerServiceOutlined className="worker-hall-mobile-contact-icon" />
|
||||
<span>联系客服</span>
|
||||
</button>
|
||||
|
||||
<div className="worker-hall-mobile-top-actions">
|
||||
<Tooltip title={`抢单确认已${grabConfirmEnabled ? '开启' : '关闭'}`}>
|
||||
<Button
|
||||
@@ -784,6 +799,9 @@ export default function WorkerHallPage() {
|
||||
<Button icon={<TrophyOutlined />} onClick={() => setLeaderboardOpen(true)}>
|
||||
接单排行榜
|
||||
</Button>
|
||||
<Button icon={<CustomerServiceOutlined />} onClick={() => setContactOpen(true)}>
|
||||
联系客服
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1298,6 +1316,14 @@ export default function WorkerHallPage() {
|
||||
) : null}
|
||||
</div>
|
||||
</Drawer>
|
||||
|
||||
<WorkerContactModal
|
||||
open={contactOpen}
|
||||
onClose={() => setContactOpen(false)}
|
||||
isMobile={isMobile}
|
||||
worker={worker}
|
||||
financeConfig={financeConfig}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ import type { WorkerFinanceConfig, WorkerSessionDevice, WorkerUser } from '@/typ
|
||||
import { formatDateTime } from '@/utils/date-time'
|
||||
import { isWorkerPasswordStrong, WORKER_PASSWORD_RULE_MESSAGE } from '@/utils/worker-password'
|
||||
|
||||
import { formatMoney, formatWorkerStatus } from './worker-profile-view-utils'
|
||||
import { WorkerContactModal } from '@/components/worker/WorkerContactModal'
|
||||
import { formatWorkerStatus } from './worker-profile-view-utils'
|
||||
|
||||
export type PasswordFormValues = {
|
||||
currentPassword?: string
|
||||
@@ -184,60 +185,13 @@ export function WorkerProfileAccountModals({
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title="联系管理员"
|
||||
<WorkerContactModal
|
||||
open={contactOpen}
|
||||
width={isMobile ? '92%' : 500}
|
||||
destroyOnHidden
|
||||
footer={
|
||||
<Button type="primary" onClick={() => setContactOpen(false)}>
|
||||
我知道了
|
||||
</Button>
|
||||
}
|
||||
onCancel={() => setContactOpen(false)}
|
||||
>
|
||||
<Space direction="vertical" size={16} className="full-width">
|
||||
<Alert
|
||||
showIcon
|
||||
type="info"
|
||||
message="如需取消已接订单,请扫码联系管理员处理。充值、提现与审核问题也由后台管理员人工处理。"
|
||||
/>
|
||||
{financeConfig?.adminContact?.wechatQrCodeImage ? (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<Image
|
||||
width={200}
|
||||
src={
|
||||
financeConfig.adminContact.wechatQrCodeImage.mediumUrl ||
|
||||
financeConfig.adminContact.wechatQrCodeImage.url
|
||||
}
|
||||
alt="管理员微信二维码"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<Typography.Text type="secondary">
|
||||
管理员暂未配置微信二维码,请按下方账号信息联系。
|
||||
</Typography.Text>
|
||||
)}
|
||||
<Descriptions column={1} bordered size="small">
|
||||
<Descriptions.Item label="账号">
|
||||
<Typography.Text copyable>{worker?.username || '-'}</Typography.Text>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="昵称">{worker?.displayName || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="手机号">
|
||||
<Typography.Text copyable>{worker?.phone || '-'}</Typography.Text>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="账号状态">
|
||||
{formatWorkerStatus(worker?.status || '')}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="当前余额">
|
||||
{formatMoney(worker?.wallet.availableAmount)}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Typography.Paragraph className="worker-profile-help-text">
|
||||
建议沟通时一起提供:申请类型、金额、订单号或转账备注、收款方式,以及当前账号信息。
|
||||
</Typography.Paragraph>
|
||||
</Space>
|
||||
</Modal>
|
||||
onClose={() => setContactOpen(false)}
|
||||
isMobile={isMobile}
|
||||
worker={worker}
|
||||
financeConfig={financeConfig}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
title="修改昵称"
|
||||
|
||||
Reference in New Issue
Block a user