Compare commits
2 Commits
7c5e4917dd
...
87534c4d22
| Author | SHA1 | Date |
|---|---|---|
|
|
87534c4d22 | |
|
|
37c8518289 |
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -128,11 +128,13 @@ const ListPage: React.FC = () => {
|
|||
},
|
||||
{
|
||||
key: 'refund_approved',
|
||||
label: '退款申请已通过',
|
||||
label: "已退款",
|
||||
// label: '退款申请已通过',
|
||||
},
|
||||
{
|
||||
key: 'refund_cancelled',
|
||||
label: '已取消退款',
|
||||
label: "已完成"
|
||||
// label: '已取消退款',
|
||||
},
|
||||
// {
|
||||
// key: 'pending_refund',
|
||||
|
|
@ -289,7 +291,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" />
|
||||
</>
|
||||
) : (
|
||||
|
|
@ -419,7 +421,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} />,
|
||||
|
|
@ -763,16 +765,17 @@ const Detail: React.FC<{
|
|||
valueEnum={ORDER_STATUS_ENUM}
|
||||
/>
|
||||
<ProDescriptions.Item label="金额" dataIndex="total" />
|
||||
<ProDescriptions.Item label="客户邮箱" dataIndex="customer_email" />
|
||||
<ProDescriptions.Item label="联系电话" span={3}
|
||||
render={(_, record) => { return (
|
||||
<div>
|
||||
<span>
|
||||
{record?.shipping?.phone || record?.billing?.phone || '-'}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}} />
|
||||
<ProDescriptions.Item label="客户邮箱" dataIndex="customer_email" />
|
||||
<ProDescriptions.Item label="联系电话" span={3}
|
||||
render={(_, record) => {
|
||||
return (
|
||||
<div>
|
||||
<span>
|
||||
{record?.shipping?.phone || record?.billing?.phone || '-'}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}} />
|
||||
<ProDescriptions.Item label="交易Id" dataIndex="transaction_id" />
|
||||
<ProDescriptions.Item label="IP" dataIndex="customer_id_address" />
|
||||
<ProDescriptions.Item label="设备" dataIndex="device_type" />
|
||||
|
|
@ -1389,16 +1392,16 @@ const Shipping: React.FC<{
|
|||
<ProFormList
|
||||
label="发货产品"
|
||||
name="sales"
|
||||
// rules={[
|
||||
// {
|
||||
// required: true,
|
||||
// message: '至少需要一个商品',
|
||||
// validator: (_, value) =>
|
||||
// value && value.length > 0
|
||||
// ? Promise.resolve()
|
||||
// : Promise.reject('至少需要一个商品'),
|
||||
// },
|
||||
// ]}
|
||||
// rules={[
|
||||
// {
|
||||
// required: true,
|
||||
// message: '至少需要一个商品',
|
||||
// validator: (_, value) =>
|
||||
// value && value.length > 0
|
||||
// ? Promise.resolve()
|
||||
// : Promise.reject('至少需要一个商品'),
|
||||
// },
|
||||
// ]}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
|
|
@ -1970,14 +1973,14 @@ const SalesChange: React.FC<{
|
|||
});
|
||||
if (!success || !data) return {};
|
||||
data.sales = data.sales?.reduce((acc: API.OrderSale[], cur: API.OrderSale) => {
|
||||
let idx = acc.findIndex((v: any) => v.productId === cur.productId);
|
||||
if (idx === -1) {
|
||||
acc.push(cur);
|
||||
} else {
|
||||
acc[idx].quantity += cur.quantity;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
let idx = acc.findIndex((v: any) => v.productId === cur.productId);
|
||||
if (idx === -1) {
|
||||
acc.push(cur);
|
||||
} else {
|
||||
acc[idx].quantity += cur.quantity;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[],
|
||||
);
|
||||
// setOptions(
|
||||
|
|
@ -1990,7 +1993,7 @@ const SalesChange: React.FC<{
|
|||
}}
|
||||
onFinish={async (formData: any) => {
|
||||
const { sales } = formData;
|
||||
const res = await ordercontrollerUpdateorderitems({orderId:id}, sales);
|
||||
const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales);
|
||||
if (!res.success) {
|
||||
message.error(`更新货物信息失败: ${res.message}`);
|
||||
return false;
|
||||
|
|
@ -2006,7 +2009,7 @@ const SalesChange: React.FC<{
|
|||
>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
params={{ }}
|
||||
params={{}}
|
||||
request={async ({ keyWords }) => {
|
||||
try {
|
||||
const { data } = await productcontrollerSearchproducts({
|
||||
|
|
|
|||
Loading…
Reference in New Issue