Files
mp-10550/src/components/SimpleQRCodeModal.tsx
赵忠林 ee28aeeff9 refactor(components): 优化多个组件的样式和结构
-调整了多个组件的图标使用
- 优化了部分组件的布局结构
- 移除了不必要的空行和空格
-统一了部分样式类名的使用
2025-08-17 12:01:17 +08:00

62 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react'
import { View, Text } from '@tarojs/components'
import { Popup } from '@nutui/nutui-react-taro'
import { Close, QrCode } from '@nutui/icons-react-taro'
export interface SimpleQRCodeModalProps {
/** 是否显示弹窗 */
visible: boolean
/** 关闭弹窗回调 */
onClose: () => void
/** 二维码内容礼品卡code码 */
qrContent: string
}
const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
visible,
onClose,
qrContent
}) => {
return (
<Popup
visible={visible}
position="center"
closeable
closeIcon={<Close/>}
onClose={onClose}
style={{
width: '90%'
}}
>
<View className="p-6">
{/* 标题 */}
<View className="text-center mb-4">
<Text className="text-lg font-bold"></Text>
<Text className="text-sm text-gray-500 mt-1">
</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="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>
</View>
</View>
</View>
</View>
</Popup>
)
}
export default SimpleQRCodeModal