fix(douyu): 移除领取页切换滑块动画
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
|||||||
QrcodeOutlined,
|
QrcodeOutlined,
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons'
|
} 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 QRCode from 'qrcode'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||||
import { useParams } from 'react-router'
|
import { useParams } from 'react-router'
|
||||||
@@ -290,20 +290,20 @@ export default function DouyuFulfillmentPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="customer-collect-body">
|
<div className="customer-collect-body">
|
||||||
<label className="customer-collect-label">登录方式</label>
|
<label className="customer-collect-label">登录方式</label>
|
||||||
<Segmented
|
<ChoiceSwitch
|
||||||
block
|
ariaLabel="登录方式"
|
||||||
value={platform}
|
value={platform}
|
||||||
onChange={(value) => setPlatform(value as DouyuCustomerPlatform)}
|
onChange={setPlatform}
|
||||||
options={[
|
options={[
|
||||||
{ label: '微信', value: 'wechat' },
|
{ label: '微信', value: 'wechat' },
|
||||||
{ label: 'QQ', value: 'qq' },
|
{ label: 'QQ', value: 'qq' },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<label className="customer-collect-label">设备系统</label>
|
<label className="customer-collect-label">设备系统</label>
|
||||||
<Segmented
|
<ChoiceSwitch
|
||||||
block
|
ariaLabel="设备系统"
|
||||||
value={system}
|
value={system}
|
||||||
onChange={(value) => setSystem(value as DouyuCustomerSystem)}
|
onChange={setSystem}
|
||||||
options={[
|
options={[
|
||||||
{ label: '安卓', value: 'android' },
|
{ label: '安卓', value: 'android' },
|
||||||
{ label: '苹果', value: 'ios' },
|
{ label: '苹果', value: 'ios' },
|
||||||
@@ -450,6 +450,33 @@ export default function DouyuFulfillmentPage() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ChoiceSwitch<T extends string>(input: {
|
||||||
|
value: T
|
||||||
|
options: ReadonlyArray<{ label: string; value: T }>
|
||||||
|
ariaLabel: string
|
||||||
|
onChange: (value: T) => void
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className="customer-choice-switch" role="radiogroup" aria-label={input.ariaLabel}>
|
||||||
|
{input.options.map((option) => {
|
||||||
|
const selected = input.value === option.value
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={option.value}
|
||||||
|
type="button"
|
||||||
|
role="radio"
|
||||||
|
aria-checked={selected}
|
||||||
|
className={`customer-choice-option${selected ? ' is-selected' : ''}`}
|
||||||
|
onClick={() => input.onChange(option.value)}
|
||||||
|
>
|
||||||
|
{option.label}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function CustomerFrame({ title, children }: { title: string; children: ReactNode }) {
|
function CustomerFrame({ title, children }: { title: string; children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<div className="customer-auth-page is-huya is-douyu">
|
<div className="customer-auth-page is-huya is-douyu">
|
||||||
|
|||||||
@@ -2978,66 +2978,46 @@
|
|||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-auth-page.is-douyu .customer-collect-body .ant-segmented {
|
.customer-choice-switch {
|
||||||
overflow: hidden;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 4px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
overflow: hidden;
|
||||||
border: 1px solid #354052;
|
border: 1px solid #354052;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
background: #171d27;
|
background: #171d27;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-group {
|
.customer-choice-option {
|
||||||
overflow: hidden;
|
height: 48px;
|
||||||
border-radius: 9px;
|
min-width: 0;
|
||||||
}
|
padding: 0 12px;
|
||||||
|
|
||||||
.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-item {
|
|
||||||
color: #aeb8c8;
|
color: #aeb8c8;
|
||||||
|
border: 0;
|
||||||
border-radius: 9px;
|
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-choice-option:hover {
|
||||||
.customer-collect-body
|
|
||||||
.ant-segmented-item:hover:not(.ant-segmented-item-selected) {
|
|
||||||
color: #e2e8f0;
|
color: #e2e8f0;
|
||||||
background: #242c39;
|
background: #242c39;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-item-selected {
|
.customer-choice-option.is-selected {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #2f6fed;
|
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;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-auth-page.is-douyu .customer-collect-body .ant-segmented-thumb {
|
.customer-choice-option:focus-visible {
|
||||||
background: #2f6fed;
|
outline: 2px solid #60a5fa;
|
||||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
|
outline-offset: 2px;
|
||||||
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-auth-page.is-douyu .customer-collect-submit.ant-btn {
|
.customer-auth-page.is-douyu .customer-collect-submit.ant-btn {
|
||||||
|
|||||||
Reference in New Issue
Block a user