|
|
@@ -6,14 +6,12 @@ import { z } from 'zod'
|
|
|
import { useEffect } from 'react'
|
|
|
import Taro, { useRouter } from '@tarojs/taro'
|
|
|
import { deliveryAddressClient } from '@/api'
|
|
|
-import { InferResponseType, InferRequestType } from 'hono'
|
|
|
import { Navbar } from '@/components/ui/navbar'
|
|
|
import { Card } from '@/components/ui/card'
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from '@/components/ui/form'
|
|
|
import { Input } from '@/components/ui/input'
|
|
|
import { Switch } from '@/components/ui/switch'
|
|
|
-import { useAuth } from '@/utils/auth'
|
|
|
import { CitySelector } from '@/components/ui/city-selector'
|
|
|
|
|
|
|
|
|
@@ -31,7 +29,6 @@ const addressSchema = z.object({
|
|
|
type AddressFormData = z.infer<typeof addressSchema>
|
|
|
|
|
|
export default function AddressEditPage() {
|
|
|
- const { user } = useAuth()
|
|
|
const queryClient = useQueryClient()
|
|
|
|
|
|
// 使用useRouter钩子获取路由参数
|
|
|
@@ -192,10 +189,10 @@ export default function AddressEditPage() {
|
|
|
cityValue={form.watch('city')}
|
|
|
districtValue={form.watch('district')}
|
|
|
townValue={form.watch('town')}
|
|
|
- onProvinceChange={(value) => form.setValue('province', value)}
|
|
|
- onCityChange={(value) => form.setValue('city', value)}
|
|
|
- onDistrictChange={(value) => form.setValue('district', value)}
|
|
|
- onTownChange={(value) => form.setValue('town', value)}
|
|
|
+ onProvinceChange={(value) => value !== undefined && form.setValue('province', value)}
|
|
|
+ onCityChange={(value) => value !== undefined && form.setValue('city', value)}
|
|
|
+ onDistrictChange={(value) => value !== undefined && form.setValue('district', value)}
|
|
|
+ onTownChange={(value) => value !== undefined && form.setValue('town', value)}
|
|
|
showLabels={false}
|
|
|
/>
|
|
|
</View>
|