feat(admin): 完成门店核销功能
- 新增管理员页面和相关组件 - 实现用户认证和权限控制 - 添加用户订单、积分等功能 - 优化用户卡片和用户页面布局 - 实现礼品卡核销功能
This commit is contained in:
@@ -24,6 +24,20 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
|
||||
faceValue
|
||||
}) => {
|
||||
|
||||
// const copyToClipboard = () => {
|
||||
// if (qrContent) {
|
||||
// Taro.setClipboardData({
|
||||
// data: qrContent,
|
||||
// success: () => {
|
||||
// Taro.showToast({
|
||||
// title: '兑换码已复制',
|
||||
// icon: 'success'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
return (
|
||||
<Popup
|
||||
@@ -38,9 +52,9 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
|
||||
>
|
||||
<View className="p-6">
|
||||
{/* 标题 */}
|
||||
<View className="text-center mb-4">
|
||||
<View className="mb-4">
|
||||
<Text className="text-lg font-bold">礼品卡二维码</Text>
|
||||
<Text className="text-sm text-gray-500 mt-1">
|
||||
<Text className="text-sm text-gray-400 mt-1 px-2">
|
||||
请向商家出示此二维码
|
||||
</Text>
|
||||
</View>
|
||||
@@ -64,13 +78,22 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
|
||||
{/* 二维码区域 */}
|
||||
<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 mx-auto"
|
||||
style={{width: '200px', height: '200px'}}>
|
||||
<View className="text-center">
|
||||
<Text className="text-gray-500 text-sm">二维码</Text>
|
||||
<Text className="text-xs text-gray-400 mt-1">ID: {qrContent ? qrContent.slice(-6) : '------'}</Text>
|
||||
{qrContent ? (
|
||||
<img
|
||||
src={`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(qrContent)}`}
|
||||
alt="二维码"
|
||||
style={{width: '200px', height: '200px'}}
|
||||
className="mx-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>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user