refactor(components): 重构 SimpleQRCodeModal 组件

- 移除了未使用的 QRCodeGenerator 组件
- 在 SimpleQRCodeModal组件中添加了礼品卡名称和面值的显示
- 更新了 SimpleQRCodeModal 的样式,使其更加居中
- 在 gift/detail.tsx 中传递了礼品卡名称和面值给 SimpleQRCodeModal
This commit is contained in:
2025-08-17 12:25:43 +08:00
parent ee28aeeff9
commit 79aeca87cc
3 changed files with 30 additions and 291 deletions

View File

@@ -10,13 +10,19 @@ export interface SimpleQRCodeModalProps {
onClose: () => void
/** 二维码内容礼品卡code码 */
qrContent: string
/** 礼品卡名称 */
giftName?: string
/** 礼品卡面值 */
faceValue?: string
}
const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
visible,
onClose,
qrContent
}) => {
visible,
onClose,
qrContent,
giftName,
faceValue
}) => {
return (
@@ -39,13 +45,28 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
</Text>
</View>
{/* 礼品卡信息 */}
{(giftName || faceValue) && (
<View className="bg-gray-50 rounded-lg p-3 mb-4">
{giftName && (
<Text className="font-medium text-center mb-1">
{giftName}
</Text>
)}
{faceValue && (
<Text className="text-lg font-bold text-red-500 text-center">
¥{faceValue}
</Text>
)}
</View>
)}
{/* 二维码区域 */}
<View className="text-center mb-4">
<View className="p-4 bg-white border border-gray-200 rounded-lg">
<View className="bg-gray-100 rounded flex items-center justify-center"
style={{width: '200px', height: '200px', margin: '0 auto'}}>
<View className="bg-gray-100 rounded flex items-center justify-center mx-auto"
style={{width: '200px', height: '200px'}}>
<View className="text-center">
<QrCode size="48" className="text-gray-400 mb-2"/>
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-xs text-gray-400 mt-1">ID: {qrContent ? qrContent.slice(-6) : '------'}</Text>
</View>