|
|
@@ -1,5 +1,5 @@
|
|
|
import { useState } from 'react'
|
|
|
-import { View, Text, ScrollView } from '@tarojs/components'
|
|
|
+import { View, Text, ScrollView, Picker } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro'
|
|
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
|
|
import { Navbar } from '@/components/ui/navbar'
|
|
|
@@ -7,7 +7,6 @@ import { Button } from '@/components/ui/button'
|
|
|
import { Card, CardContent } from '@/components/ui/card'
|
|
|
import { Input as ShadcnInput } from '@/components/ui/input'
|
|
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'
|
|
|
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
|
|
import { Label } from '@/components/ui/label'
|
|
|
import { useAuth } from '@/utils/auth'
|
|
|
import { passengerClient } from '@/api'
|
|
|
@@ -32,6 +31,18 @@ const PassengersPage: React.FC = () => {
|
|
|
phone: ''
|
|
|
})
|
|
|
|
|
|
+ // 证件类型选项
|
|
|
+ const idTypeOptions = [
|
|
|
+ { label: '身份证', value: IdType.ID_CARD },
|
|
|
+ { label: '港澳通行证', value: IdType.HONG_KONG_MACAO_PASS },
|
|
|
+ { label: '台湾通行证', value: IdType.TAIWAN_PASS },
|
|
|
+ { label: '护照', value: IdType.PASSPORT },
|
|
|
+ { label: '其他证件', value: IdType.OTHER }
|
|
|
+ ]
|
|
|
+
|
|
|
+ // 获取当前证件类型的索引
|
|
|
+ const currentIdTypeIndex = idTypeOptions.findIndex(option => option.value === formData.idType)
|
|
|
+
|
|
|
// 获取乘客列表
|
|
|
const { data: passengersResponse, isLoading } = useQuery({
|
|
|
queryKey: ['passengers'],
|
|
|
@@ -401,21 +412,21 @@ const PassengersPage: React.FC = () => {
|
|
|
|
|
|
<View className="space-y-2">
|
|
|
<Label htmlFor="idType">证件类型</Label>
|
|
|
- <Select
|
|
|
- value={formData.idType}
|
|
|
- onValueChange={(value: IdType) => setFormData({ ...formData, idType: value })}
|
|
|
+ <Picker
|
|
|
+ mode="selector"
|
|
|
+ range={idTypeOptions.map(option => option.label)}
|
|
|
+ value={currentIdTypeIndex}
|
|
|
+ onChange={(e) => {
|
|
|
+ const index = Number(e.detail.value)
|
|
|
+ setFormData({ ...formData, idType: idTypeOptions[index].value })
|
|
|
+ }}
|
|
|
>
|
|
|
- <SelectTrigger>
|
|
|
- <SelectValue placeholder="选择证件类型" />
|
|
|
- </SelectTrigger>
|
|
|
- <SelectContent>
|
|
|
- {Object.values(IdType).map((type) => (
|
|
|
- <SelectItem key={type} value={type}>
|
|
|
- {type}
|
|
|
- </SelectItem>
|
|
|
- ))}
|
|
|
- </SelectContent>
|
|
|
- </Select>
|
|
|
+ <View className="border border-gray-300 rounded-lg px-3 py-2 bg-white">
|
|
|
+ <Text className="text-gray-900">
|
|
|
+ {idTypeOptions[currentIdTypeIndex]?.label || '选择证件类型'}
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ </Picker>
|
|
|
</View>
|
|
|
|
|
|
<View className="space-y-2">
|