用户端和服务端增加地址功能(三个地址共存)
This commit is contained in:
@@ -5,7 +5,7 @@ import AppImage from '@dukang/shared-ui/AppImage';
|
||||
import { request } from '../lib/api';
|
||||
import { buildProductDetailUrl } from '../lib/navigation';
|
||||
import { STITCH_ORDER_PRODUCT_IMAGE } from '../lib/order-images';
|
||||
import { getProductMainImage } from '../lib/product-images';
|
||||
import { tryGetClientGpsLocation } from '../lib/client-location';
|
||||
|
||||
type Address = {
|
||||
id: string;
|
||||
@@ -119,9 +119,15 @@ export default function OrderConfirmPage() {
|
||||
setLoading(true);
|
||||
setMsg('');
|
||||
try {
|
||||
const clientLocation = await tryGetClientGpsLocation();
|
||||
const order = await request<{ id: string }>('USER_H5', '/trade/orders', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ productId, quantity, addressId }),
|
||||
body: JSON.stringify({
|
||||
productId,
|
||||
quantity,
|
||||
addressId,
|
||||
...(clientLocation ? { clientLocation } : {}),
|
||||
}),
|
||||
});
|
||||
const qs = new URLSearchParams();
|
||||
qs.set('orderId', order.id);
|
||||
|
||||
Reference in New Issue
Block a user