merge: 同步 origin/ui-optimization(d224d5b6),保留 weiyuan 功能与 Semi 迁移

- 冲突以 weiyuan 功能(小程序登录、i18n 文案)为准,并保留远端 lint 重构与依赖收敛
- 删除 weiyuan 已移除、远端仅做 lint 修正的 3 个图片相关文件
- 适配远端零警告 ESLint:Monitoring/Subscription 改用 useEffectEvent,EditChannelModal 注明 t 依赖
- effect-events 单测补充 react-i18next mock
- 对合并后仍不符合 Prettier 的文件做纯格式化
This commit is contained in:
qiubaishen
2026-11-10 14:59:34 +08:00
211 changed files with 29252 additions and 12724 deletions
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import {
Button,
@@ -184,10 +185,11 @@ export default function SettingsMembership() {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
fetchPlans();
fetchSetting();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 表格列定义
const columns = [
@@ -17,13 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useState } from 'react';
import {
Form,
Button,
Typography,
Space,
Divider,
} from '@/components/ui';
import { Form, Button, Typography, Space, Divider } from '@/components/ui';
import { API, showError, showSuccess } from '../../../helpers';
import { useTranslation } from 'react-i18next';
@@ -110,7 +104,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
href='https://open.alipay.com'
target='_blank'
rel='noopener noreferrer'
>{t('支付宝开放平台')}</a>{' '}
>
{t('支付宝开放平台')}
</a>{' '}
{t('获取相关配置信息。')}
</Text>
@@ -156,7 +152,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
placeholder={
options.AlipayPrivateKey === '***ALREADY_SET***'
? t('已设置(留空不修改,填写新内容则更新)')
: t('请粘贴完整的 RSA2 私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)')
: t(
'请粘贴完整的 RSA2 私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)',
)
}
rows={6}
extraText={
@@ -240,7 +238,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
/>
<Space style={{ marginTop: 20 }}>
<Button type='primary' htmlType='submit' loading={loading}>{t('保存配置')}</Button>
<Button type='primary' htmlType='submit' loading={loading}>
{t('保存配置')}
</Button>
</Space>
</Form>
</>
@@ -750,7 +750,9 @@ export default function SettingsPaymentGatewayPayPal(props) {
operations
? t(
operations.can_change_config
? t('配置切换预检:{{n}} 笔 PayPal pending 订单;可以切换环境或应用配置')
? t(
'配置切换预检:{{n}} 笔 PayPal pending 订单;可以切换环境或应用配置',
)
: '配置切换预检:{{n}} 笔 PayPal pending 订单;请先隐藏新订单并完成历史订单排空',
{ n: operations.pending_count || 0 },
)
@@ -951,7 +953,9 @@ export default function SettingsPaymentGatewayPayPal(props) {
</Form>
<Modal
title={
forceExpire ? t('确认强制过期 PayPal 订单') : t('确认 PayPal 订单过期')
forceExpire
? t('确认强制过期 PayPal 订单')
: t('确认 PayPal 订单过期')
}
visible={Boolean(expireOrder)}
onCancel={() => setExpireOrder(null)}
@@ -968,8 +972,12 @@ export default function SettingsPaymentGatewayPayPal(props) {
type={forceExpire ? 'danger' : 'warning'}
description={
forceExpire
? t('强制过期会绕过远端查询失败或仍可支付状态,可能导致 PayPal 后续付款无法入账。已确认完成支付的订单仍会被拒绝。')
: t('系统会再次查询 PayPal 远端状态;如果已完成支付,将拒绝过期操作。请确认未付款后再提交。')
? t(
'强制过期会绕过远端查询失败或仍可支付状态,可能导致 PayPal 后续付款无法入账。已确认完成支付的订单仍会被拒绝。',
)
: t(
'系统会再次查询 PayPal 远端状态;如果已完成支付,将拒绝过期操作。请确认未付款后再提交。',
)
}
/>
{forceExpire && (
@@ -1022,8 +1030,12 @@ export default function SettingsPaymentGatewayPayPal(props) {
type={batchExpire.force ? 'danger' : 'warning'}
description={
batchExpire.force
? t('批量强制过期会绕过远端查询失败或仍可支付状态;已确认完成支付的订单仍会逐笔拒绝。')
: t('系统会逐笔查询 PayPal 远端状态,已完成或仍可支付的订单会逐笔失败并返回原因。')
? t(
'批量强制过期会绕过远端查询失败或仍可支付状态;已确认完成支付的订单仍会逐笔拒绝。',
)
: t(
'系统会逐笔查询 PayPal 远端状态,已完成或仍可支付的订单会逐笔失败并返回原因。',
)
}
/>
{batchExpire.force && (
@@ -172,11 +172,19 @@ export default function SettingsPaymentGateway(props) {
href='https://dashboard.stripe.com/developers'
target='_blank'
rel='noreferrer'
>{t('点击此处')}</a>{t('进行设置,最好先在')}<a
>
{t('点击此处')}
</a>
{t('进行设置,最好先在')}
<a
href='https://dashboard.stripe.com/test/developers'
target='_blank'
rel='noreferrer'
>{t('测试环境')}</a>{t('进行测试。')}<br />
>
{t('测试环境')}
</a>
{t('进行测试。')}
<br />
</Text>
<Banner
type='info'
@@ -17,13 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useState } from 'react';
import {
Form,
Button,
Typography,
Space,
Divider,
} from '@/components/ui';
import { Form, Button, Typography, Space, Divider } from '@/components/ui';
import { API, showError, showSuccess } from '../../../helpers';
import { useTranslation } from 'react-i18next';
@@ -136,7 +130,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
href='https://pay.weixin.qq.com'
target='_blank'
rel='noopener noreferrer'
>{t('微信支付商户平台')}</a>{' '}
>
{t('微信支付商户平台')}
</a>{' '}
{t('获取相关配置信息。')}
</Text>
@@ -227,7 +223,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
placeholder={
options.WechatPrivateKey === '***ALREADY_SET***'
? t('已设置(留空不修改,填写新内容则更新)')
: t('请粘贴完整的 PEM 格式私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)')
: t(
'请粘贴完整的 PEM 格式私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)',
)
}
rows={6}
extraText={
@@ -239,7 +237,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
<Divider margin='12px' />
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>{t('公钥模式(2024年新商户必选)')}</Title>
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>
{t('公钥模式(2024年新商户必选)')}
</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>
{t(
'2024年后注册的微信支付商户默认使用公钥模式。如果初始化失败提示"无可用的平台证书",请从商户平台下载微信支付公钥并启用此模式。',
@@ -256,7 +256,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
field='WechatPublicKeyID'
label={t('微信支付公钥 ID')}
placeholder='PUB_KEY_ID_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
extraText={t('从商户平台【API安全】→【微信支付公钥】获取,格式如 PUB_KEY_ID_xxx')}
extraText={t(
'从商户平台【API安全】→【微信支付公钥】获取,格式如 PUB_KEY_ID_xxx',
)}
/>
<Form.TextArea
@@ -265,7 +267,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
placeholder={
options.WechatPublicKeyPEM === '***ALREADY_SET***'
? t('已设置(留空不修改,填写新内容则更新)')
: t('请粘贴完整的微信支付公钥 PEM 内容(包含 -----BEGIN PUBLIC KEY----- 等)')
: t(
'请粘贴完整的微信支付公钥 PEM 内容(包含 -----BEGIN PUBLIC KEY----- 等)',
)
}
rows={6}
extraText={
@@ -277,13 +281,21 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
<Divider margin='12px' />
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>{t('高级配置:手动平台证书模式(可选)')}</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>{t('默认情况下,SDK 会自动下载微信平台证书,无需手动配置。仅在离线环境或网络受限时启用此选项。')}</Text>
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>
{t('高级配置:手动平台证书模式(可选)')}
</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>
{t(
'默认情况下,SDK 会自动下载微信平台证书,无需手动配置。仅在离线环境或网络受限时启用此选项。',
)}
</Text>
<Form.Switch
field='WechatUseManualCert'
label={t('启用手动证书模式')}
extraText={t('开启后需要手动配置平台证书,关闭则使用自动下载模式(推荐)')}
extraText={t(
'开启后需要手动配置平台证书,关闭则使用自动下载模式(推荐)',
)}
/>
<Form.Input
@@ -299,7 +311,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
placeholder={
options.WechatPlatformCertPEM === '***ALREADY_SET***'
? t('已设置(留空不修改,填写新内容则更新)')
: t('请粘贴完整的平台证书 PEM 内容(包含 -----BEGIN CERTIFICATE----- 等)')
: t(
'请粘贴完整的平台证书 PEM 内容(包含 -----BEGIN CERTIFICATE----- 等)',
)
}
rows={6}
extraText={
@@ -348,7 +362,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
/>
<Space style={{ marginTop: 20 }}>
<Button type='primary' htmlType='submit' loading={loading}>{t('保存配置')}</Button>
<Button type='primary' htmlType='submit' loading={loading}>
{t('保存配置')}
</Button>
</Space>
</Form>
</>