forked from yoone/WEB
1
0
Fork 0

Compare commits

..

No commits in common. "adbc0871714e003e73e5309685e2fbc586b8c6f9" and "e5794c3d25fdab5ee2c674906ddde285478881b7" have entirely different histories.

6 changed files with 40 additions and 79 deletions

2
.gitignore vendored
View File

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

View File

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

View File

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

View File

@ -128,15 +128,12 @@ const ListPage: React.FC = () => {
label: '已申请退款', label: '已申请退款',
}, },
{ {
key: 'refund_approved', key: 'refund_approved',
label: "已退款", label: '退款申请已通过',
// label: '退款申请已通过',
}, },
{ {
key: 'refund_cancelled', key: 'refund_cancelled',
label: "已完成" label: '已取消退款',
// label: '已取消退款',
}, },
// { // {
// key: 'pending_refund', // key: 'pending_refund',
@ -298,7 +295,7 @@ const ListPage: React.FC = () => {
record.orderStatus, 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" /> <Divider type="vertical" />
</> </>
) : ( ) : (
@ -428,7 +425,7 @@ const ListPage: React.FC = () => {
actionRef={actionRef} actionRef={actionRef}
rowKey="id" rowKey="id"
rowClassName={(record) => { rowClassName={(record) => {
return record.id === activeLine ? styles['selected-line-order-protable'] : ''; return record.id === activeLine ? styles['selected-line-order-protable']: '';
}} }}
toolBarRender={() => [ toolBarRender={() => [
<CreateOrder tableRef={actionRef} />, <CreateOrder tableRef={actionRef} />,
@ -772,17 +769,16 @@ const Detail: React.FC<{
valueEnum={ORDER_STATUS_ENUM} valueEnum={ORDER_STATUS_ENUM}
/> />
<ProDescriptions.Item label="金额" dataIndex="total" /> <ProDescriptions.Item label="金额" dataIndex="total" />
<ProDescriptions.Item label="客户邮箱" dataIndex="customer_email" /> <ProDescriptions.Item label="客户邮箱" dataIndex="customer_email" />
<ProDescriptions.Item label="联系电话" span={3} <ProDescriptions.Item label="联系电话" span={3}
render={(_, record) => { render={(_, record) => { return (
return ( <div>
<div> <span>
<span> {record?.shipping?.phone || record?.billing?.phone || '-'}
{record?.shipping?.phone || record?.billing?.phone || '-'} </span>
</span> </div>
</div> );
); }} />
}} />
<ProDescriptions.Item label="交易Id" dataIndex="transaction_id" /> <ProDescriptions.Item label="交易Id" dataIndex="transaction_id" />
<ProDescriptions.Item label="IP" dataIndex="customer_id_address" /> <ProDescriptions.Item label="IP" dataIndex="customer_id_address" />
<ProDescriptions.Item label="设备" dataIndex="device_type" /> <ProDescriptions.Item label="设备" dataIndex="device_type" />
@ -915,7 +911,7 @@ const Detail: React.FC<{
); );
}} }}
/> />
<ProDescriptions.Item <ProDescriptions.Item
label="换货" label="换货"
span={3} span={3}
render={(_, record) => { render={(_, record) => {
@ -1399,16 +1395,16 @@ const Shipping: React.FC<{
<ProFormList <ProFormList
label="发货产品" label="发货产品"
name="sales" name="sales"
// rules={[ // rules={[
// { // {
// required: true, // required: true,
// message: '至少需要一个商品', // message: '至少需要一个商品',
// validator: (_, value) => // validator: (_, value) =>
// value && value.length > 0 // value && value.length > 0
// ? Promise.resolve() // ? Promise.resolve()
// : Promise.reject('至少需要一个商品'), // : Promise.reject('至少需要一个商品'),
// }, // },
// ]} // ]}
> >
<ProForm.Group> <ProForm.Group>
<ProFormSelect <ProFormSelect
@ -1980,14 +1976,14 @@ const SalesChange: React.FC<{
}); });
if (!success || !data) return {}; if (!success || !data) return {};
data.sales = data.sales?.reduce((acc: API.OrderSale[], cur: API.OrderSale) => { data.sales = data.sales?.reduce((acc: API.OrderSale[], cur: API.OrderSale) => {
let idx = acc.findIndex((v: any) => v.productId === cur.productId); let idx = acc.findIndex((v: any) => v.productId === cur.productId);
if (idx === -1) { if (idx === -1) {
acc.push(cur); acc.push(cur);
} else { } else {
acc[idx].quantity += cur.quantity; acc[idx].quantity += cur.quantity;
} }
return acc; return acc;
}, },
[], [],
); );
@ -2001,12 +1997,13 @@ const SalesChange: React.FC<{
return { ...data}; return { ...data};
}} }}
onFinish={async (formData: any) => { onFinish={async (formData: any) => {
const { sales } = formData; const { sales,items } = formData;
const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales); const data ={sales,items }
const res = await ordercontrollerUpdateorderitems({orderId:id}, data);
if (!res.success) { if (!res.success) {
message.error(`更新货物信息失败: ${res.message}`); message.error(`更新货物信息失败: ${res.message}`);
return false; return false;
} }
message.success('更新成功') message.success('更新成功')
detailRef?.current?.reload(); detailRef?.current?.reload();
return true; return true;
@ -2070,7 +2067,7 @@ const SalesChange: React.FC<{
<ProFormSelect <ProFormSelect
params={{}} params={{ }}
request={async ({ keyWords }) => { request={async ({ keyWords }) => {
try { try {
const { data } = await productcontrollerSearchproducts({ const { data } = await productcontrollerSearchproducts({

View File

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

View File

@ -36,21 +36,6 @@ 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} */ /** 此处后端没有提供注释 PUT /wp_product/siteId/${param1}/products/${param0} */
export async function wpproductcontrollerUpdateproduct( export async function wpproductcontrollerUpdateproduct(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)