用户端和服务端增加地址功能(三个地址共存)

This commit is contained in:
2026-07-01 00:52:44 +08:00
parent eb85e0926f
commit d3dd3a0ad1
15 changed files with 282 additions and 6 deletions
+8 -2
View File
@@ -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);