h5微信授权
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-07-14 20:09:36 +08:00
parent 9b13d02dde
commit 1ad49f1acf
14 changed files with 569 additions and 79 deletions
@@ -4,9 +4,10 @@ import Taro, { useRouter } from '@tarojs/taro';
import PageShell from '../../components/PageShell';
import SubPageHeader from '../../components/SubPageHeader';
import { buildAddressListUrl, buildPayUrl, readCheckoutContext } from '../../lib/checkout-nav';
import { tryGetClientGpsLocation } from '../../lib/client-location';
import { maskPhone } from '../../lib/phone';
import { ensurePayReady } from '../../lib/pay-ready';
import { request, toast } from '../../lib/api';
import { request } from '../../lib/api';
import { getProductMainImage } from '../../lib/product-images';
type Address = {
@@ -127,12 +128,19 @@ export default function OrderConfirmPage() {
}
async function doSubmit() {
let clientLocation = null;
try {
clientLocation = await tryGetClientGpsLocation();
} catch {
/* GPS 获取失败不阻塞下单 */
}
const order = await request<{ id: string }>('/trade/orders', {
method: 'POST',
data: {
productId,
quantity,
addressId,
...(clientLocation ? { clientLocation } : {}),
},
});
Taro.redirectTo({