forked from yoone/WEB
1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
zhuotianyuan adbc087171 20251014-zty-换货代码 2025-10-14 17:14:38 +08:00
tikkhun f78a68414d refactor(docs): 移除旧版项目文档和优化订单状态标签
删除不再使用的项目文档中心和相关技术文档
在订单列表页面添加退款状态标签的空行以改善代码可读性
2025-10-14 06:54:23 +00:00
tikkhun 77590f2b22 refactor(Order/List): 更新退款相关状态标签为更简洁的表达
refund_approved 已退款
refund_cancelled 已完成
2025-10-14 06:54:23 +00:00
tikkhun 972e127dc2 build: 添加 code-inspector-plugin 依赖及配置
添加 code-inspector-plugin 作为开发依赖,并在 webpack 配置中启用该插件以增强代码检查能力

refactor(Order/List): 更新退款相关状态标签为更简洁的表达

refund_approved 已退款
refund_cancelled 已完成

chore: 在.gitignore中添加docs目录

忽略生成的文档目录以避免将其提交到版本控制
2025-10-14 14:32:17 +08:00
6 changed files with 79 additions and 40 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@
/package-lock.json
/yarn.lock
*.yaml
#
/docs

View File

@ -4,6 +4,7 @@ const isDev = process.env.NODE_ENV === 'development';
const UMI_APP_API_URL = isDev
? 'http://localhost:7001'
: 'https://api.yoone.ca';
import { codeInspectorPlugin } from 'code-inspector-plugin';
export default defineConfig({
hash: true,
@ -18,6 +19,13 @@ export default defineConfig({
define: {
UMI_APP_API_URL,
},
chainWebpack(config) {
config.plugin('code-inspector-plugin').use(
codeInspectorPlugin({
bundler: 'webpack',
})
);
},
routes: [
{ path: '/', redirect: '/home' },
{ name: '追踪', path: '/track', component: './Track', layout: false },

View File

@ -32,6 +32,7 @@
"devDependencies": {
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"code-inspector-plugin": "^1.2.10",
"husky": "^9",
"lint-staged": "^13.2.0",
"prettier": "^2.8.7",

View File

@ -128,12 +128,15 @@ const ListPage: React.FC = () => {
label: '已申请退款',
},
{
key: 'refund_approved',
label: '退款申请已通过',
label: "已退款",
// label: '退款申请已通过',
},
{
key: 'refund_cancelled',
label: '已取消退款',
label: "已完成"
// label: '已取消退款',
},
// {
// key: 'pending_refund',
@ -295,7 +298,7 @@ const ListPage: React.FC = () => {
record.orderStatus,
) ? (
<>
<Shipping id={record.id as number} tableRef={actionRef} setActiveLine={setActiveLine}/>
<Shipping id={record.id as number} tableRef={actionRef} setActiveLine={setActiveLine} />
<Divider type="vertical" />
</>
) : (
@ -425,7 +428,7 @@ const ListPage: React.FC = () => {
actionRef={actionRef}
rowKey="id"
rowClassName={(record) => {
return record.id === activeLine ? styles['selected-line-order-protable']: '';
return record.id === activeLine ? styles['selected-line-order-protable'] : '';
}}
toolBarRender={() => [
<CreateOrder tableRef={actionRef} />,
@ -771,7 +774,8 @@ const Detail: React.FC<{
<ProDescriptions.Item label="金额" dataIndex="total" />
<ProDescriptions.Item label="客户邮箱" dataIndex="customer_email" />
<ProDescriptions.Item label="联系电话" span={3}
render={(_, record) => { return (
render={(_, record) => {
return (
<div>
<span>
{record?.shipping?.phone || record?.billing?.phone || '-'}
@ -1997,9 +2001,8 @@ const SalesChange: React.FC<{
return { ...data};
}}
onFinish={async (formData: any) => {
const { sales,items } = formData;
const data ={sales,items }
const res = await ordercontrollerUpdateorderitems({orderId:id}, data);
const { sales } = formData;
const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales);
if (!res.success) {
message.error(`更新货物信息失败: ${res.message}`);
return false;
@ -2067,7 +2070,7 @@ const SalesChange: React.FC<{
<ProFormSelect
params={{ }}
params={{}}
request={async ({ keyWords }) => {
try {
const { data } = await productcontrollerSearchproducts({

View File

@ -235,7 +235,6 @@ declare namespace API {
total_tax?: number;
customer_id?: number;
customer_email?: string;
billing_phone?: string;
order_key?: string;
billing?: OrderAddress;
shipping?: OrderAddress;
@ -258,6 +257,8 @@ declare namespace API {
device_type?: string;
source_type?: string;
utm_source?: string;
is_exchange?: boolean;
exchange_frequency?: number;
/** 创建时间 */
createdAt: string;
/** 更新时间 */
@ -377,7 +378,6 @@ declare namespace API {
total_tax?: number;
customer_id?: number;
customer_email?: string;
billing_phone?: string;
order_key?: string;
billing?: OrderAddress;
shipping?: OrderAddress;
@ -400,6 +400,8 @@ declare namespace API {
device_type?: string;
source_type?: string;
utm_source?: string;
is_exchange?: boolean;
exchange_frequency?: number;
/** 创建时间 */
createdAt: string;
/** 更新时间 */
@ -1415,6 +1417,8 @@ declare namespace API {
sale_price?: number;
/** 是否促销中 */
on_sale?: boolean;
/** 是否删除 */
on_delete?: boolean;
/** 创建时间 */
createdAt: string;
/** 更新时间 */
@ -1448,6 +1452,10 @@ declare namespace API {
| 'inherit';
};
type wpproductcontrollerSearchproductsParams = {
name?: string;
};
type wpproductcontrollerSetconstitutionParams = {
id: number;
};
@ -1500,6 +1508,8 @@ declare namespace API {
sale_price?: number;
/** 是否促销中 */
on_sale?: boolean;
/** 是否删除 */
on_delete?: boolean;
/** 产品类型 */
type?: 'simple' | 'variable' | 'woosb';
/** 创建时间 */

View File

@ -36,6 +36,21 @@ export async function wpproductcontrollerGetwpproducts(
});
}
/** 此处后端没有提供注释 GET /wp_product/search */
export async function wpproductcontrollerSearchproducts(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.wpproductcontrollerSearchproductsParams,
options?: { [key: string]: any },
) {
return request<API.ProductsRes>('/wp_product/search', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /wp_product/siteId/${param1}/products/${param0} */
export async function wpproductcontrollerUpdateproduct(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)