Explorar el Código

♻️ refactor(address-edit): 移除未使用的导入并优化城市选择器回调

- 移除未使用的 `InferResponseType`、`InferRequestType` 和 `useAuth` 导入以简化代码
- 优化 `CitySelector` 组件的回调函数,增加对 `undefined` 值的检查,提升代码健壮性

🐛 fix(profile): 更新客服电话号码

- 将客服电话号码从 `057985101558` 更新为 `0574-65120616`
yourname hace 2 semanas
padre
commit
6dc5c04d4c
Se han modificado 2 ficheros con 5 adiciones y 8 borrados
  1. 4 7
      mini/src/pages/address-edit/index.tsx
  2. 1 1
      mini/src/pages/profile/index.tsx

+ 4 - 7
mini/src/pages/address-edit/index.tsx

@@ -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>

+ 1 - 1
mini/src/pages/profile/index.tsx

@@ -224,7 +224,7 @@ const ProfilePage: React.FC = () => {
 
   const handleCallCustomerService = () => {
     Taro.makePhoneCall({
-      phoneNumber: '057985101558'
+      phoneNumber: '0574-65120616'
     })
   }