diff --git a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
index a4e29da2..0aceadea 100644
--- a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
+++ b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
@@ -5,7 +5,7 @@ import {
QrcodeOutlined,
ReloadOutlined,
} from '@ant-design/icons'
-import { Alert, App, Button, Image, Input, Progress, Segmented, Space, Spin } from 'antd'
+import { Alert, App, Button, Image, Input, Progress, Space, Spin } from 'antd'
import QRCode from 'qrcode'
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { useParams } from 'react-router'
@@ -290,20 +290,20 @@ export default function DouyuFulfillmentPage() {
-
setPlatform(value as DouyuCustomerPlatform)}
+ onChange={setPlatform}
options={[
{ label: '微信', value: 'wechat' },
{ label: 'QQ', value: 'qq' },
]}
/>
- setSystem(value as DouyuCustomerSystem)}
+ onChange={setSystem}
options={[
{ label: '安卓', value: 'android' },
{ label: '苹果', value: 'ios' },
@@ -450,6 +450,33 @@ export default function DouyuFulfillmentPage() {
)
}
+function ChoiceSwitch(input: {
+ value: T
+ options: ReadonlyArray<{ label: string; value: T }>
+ ariaLabel: string
+ onChange: (value: T) => void
+}) {
+ return (
+
+ {input.options.map((option) => {
+ const selected = input.value === option.value
+ return (
+
+ )
+ })}
+
+ )
+}
+
function CustomerFrame({ title, children }: { title: string; children: ReactNode }) {
return (
diff --git a/apps/frontend/src/styles/client.css b/apps/frontend/src/styles/client.css
index 89ab9be6..c92a741a 100644
--- a/apps/frontend/src/styles/client.css
+++ b/apps/frontend/src/styles/client.css
@@ -2978,66 +2978,46 @@
padding-top: 12px;
}
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented {
- overflow: hidden;
+.customer-choice-switch {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 4px;
padding: 4px;
+ overflow: hidden;
border: 1px solid #354052;
border-radius: 12px;
background: #171d27;
}
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-group {
- overflow: hidden;
- border-radius: 9px;
-}
-
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-item {
+.customer-choice-option {
+ height: 48px;
+ min-width: 0;
+ padding: 0 12px;
color: #aeb8c8;
+ border: 0;
border-radius: 9px;
- transition: color 140ms ease;
+ outline: none;
+ background: transparent;
+ font: inherit;
+ font-size: 15px;
+ cursor: pointer;
+ transition: color 100ms ease;
}
-.customer-auth-page.is-douyu
- .customer-collect-body
- .ant-segmented-item:hover:not(.ant-segmented-item-selected) {
+.customer-choice-option:hover {
color: #e2e8f0;
background: #242c39;
}
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-item-selected {
+.customer-choice-option.is-selected {
color: #fff;
background: #2f6fed;
- box-shadow: none;
-}
-
-.customer-auth-page.is-douyu
- .customer-collect-body
- .ant-segmented-item-selected
- .ant-segmented-item-label {
- color: #fff;
font-weight: 700;
}
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-thumb {
- background: #2f6fed;
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
- backface-visibility: hidden;
- transform: translateZ(0);
-}
-
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-thumb-motion-appear-active {
- will-change: transform;
- transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
-}
-
-.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-item-label {
- transition: color 140ms ease;
-}
-
-@media (prefers-reduced-motion: reduce) {
- .customer-auth-page.is-douyu .customer-collect-body .ant-segmented-thumb-motion-appear-active {
- transition: none !important;
- }
+.customer-choice-option:focus-visible {
+ outline: 2px solid #60a5fa;
+ outline-offset: 2px;
}
.customer-auth-page.is-douyu .customer-collect-submit.ant-btn {