|
|
@@ -1,4 +1,5 @@
|
|
|
import { useState, useEffect } from 'react'
|
|
|
+import { View, Text } from '@tarojs/components'
|
|
|
import {
|
|
|
Dialog,
|
|
|
DialogContent,
|
|
|
@@ -113,11 +114,11 @@ export default function CancelReasonDialog({
|
|
|
</DialogDescription>
|
|
|
</DialogHeader>
|
|
|
|
|
|
- <div className="grid gap-4 py-4">
|
|
|
+ <View className="grid gap-4 py-4">
|
|
|
{/* 预定义原因选项 */}
|
|
|
- <div className="space-y-2">
|
|
|
+ <View className="space-y-2">
|
|
|
{CANCEL_REASONS.map((reasonText) => (
|
|
|
- <div
|
|
|
+ <View
|
|
|
key={reasonText}
|
|
|
data-testid={`cancel-reason-${reasonText}`}
|
|
|
className={`px-3 py-2 rounded border cursor-pointer transition-colors select-none ${
|
|
|
@@ -126,10 +127,8 @@ export default function CancelReasonDialog({
|
|
|
: 'border-gray-300 bg-white hover:bg-gray-50'
|
|
|
}`}
|
|
|
onClick={() => handleReasonSelect(reasonText)}
|
|
|
- // 添加Taro小程序兼容的点击事件处理
|
|
|
- onTap={() => handleReasonSelect(reasonText)}
|
|
|
>
|
|
|
- <span
|
|
|
+ <Text
|
|
|
className={`text-sm ${
|
|
|
selectedReason === reasonText
|
|
|
? 'text-primary'
|
|
|
@@ -137,17 +136,17 @@ export default function CancelReasonDialog({
|
|
|
}`}
|
|
|
>
|
|
|
{reasonText}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
))}
|
|
|
- </div>
|
|
|
+ </View>
|
|
|
|
|
|
{/* 自定义原因输入 */}
|
|
|
- <div className="grid grid-cols-4 items-center gap-4">
|
|
|
+ <View className="grid grid-cols-4 items-center gap-4">
|
|
|
<Label htmlFor="reason" className="text-right">
|
|
|
其他原因
|
|
|
</Label>
|
|
|
- <div className="col-span-3">
|
|
|
+ <View className="col-span-3">
|
|
|
<Input
|
|
|
id="reason"
|
|
|
placeholder="请输入其他取消原因..."
|
|
|
@@ -156,11 +155,11 @@ export default function CancelReasonDialog({
|
|
|
className={error ? 'border-destructive' : ''}
|
|
|
/>
|
|
|
{error && (
|
|
|
- <p className="text-sm text-destructive mt-1">{error}</p>
|
|
|
+ <Text className="text-sm text-destructive mt-1">{error}</Text>
|
|
|
)}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
|
|
|
<DialogFooter>
|
|
|
<Button variant="outline" onClick={handleCancel} disabled={loading}>
|