diff --git a/src/components/AdminPanel.scss b/src/components/AdminPanel.scss deleted file mode 100644 index 281d6fd..0000000 --- a/src/components/AdminPanel.scss +++ /dev/null @@ -1,89 +0,0 @@ -.admin-panel { - /* 面板动画 */ - .admin-panel-content { - animation: slideUp 0.3s ease-out; - } - - /* 网格布局优化 */ - .admin-feature-grid { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 12px; - - @media (max-width: 375px) { - grid-template-columns: 1fr; - } - } - - /* 功能卡片样式 */ - .admin-feature-card { - transition: all 0.2s ease; - cursor: pointer; - - &:active { - transform: scale(0.95); - } - - &:hover { - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); - } - } - - /* 图标容器 */ - .admin-feature-icon { - width: 32px; - height: 32px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 8px; - margin-right: 8px; - } - - /* 模式切换按钮动画 */ - .mode-toggle-btn { - transition: all 0.3s ease; - cursor: pointer; - - &:active { - transform: scale(0.95); - } - } - - /* 管理面板按钮 */ - .admin-panel-btn { - transition: all 0.2s ease; - cursor: pointer; - - &:active { - transform: scale(0.95); - background-color: rgba(59, 130, 246, 0.1); - } - } -} - -/* 滑入动画 */ -@keyframes slideUp { - from { - transform: translateY(100%); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } -} - -/* 遮罩层动画 */ -@keyframes fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } -} - -.admin-panel-overlay { - animation: fadeIn 0.3s ease-out; -} diff --git a/src/components/AdminPanel.tsx b/src/components/AdminPanel.tsx index 4f438ff..a019812 100644 --- a/src/components/AdminPanel.tsx +++ b/src/components/AdminPanel.tsx @@ -3,7 +3,6 @@ import { View, Text } from '@tarojs/components'; import { Button } from '@nutui/nutui-react-taro'; import { Scan, Setting, User, Shop } from '@nutui/icons-react-taro'; import navTo from '@/utils/common'; -import './AdminPanel.scss'; export interface AdminPanelProps { /** 是否显示面板 */ @@ -95,7 +94,7 @@ const AdminPanel: React.FC = ({ /> {/* 面板内容 */} - + {/* 面板头部 */} diff --git a/src/components/CouponCard.scss b/src/components/CouponCard.scss index 61f7316..9d00ba2 100644 --- a/src/components/CouponCard.scss +++ b/src/components/CouponCard.scss @@ -38,7 +38,7 @@ &.disabled { opacity: 0.6; - filter: grayscale(0.3); + /* filter: grayscale(0.3); 小程序不支持filter属性 */ } .coupon-left { @@ -199,11 +199,7 @@ line-height: 1.3; letter-spacing: -0.5px; - /* 添加文字渐变效果 */ - background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; + /* 文字渐变效果在小程序中不支持,使用纯色替代 */ } .coupon-validity { @@ -309,7 +305,7 @@ align-items: center; justify-content: center; z-index: 10; - backdrop-filter: blur(2px); + /* backdrop-filter: blur(2px); 小程序不支持backdrop-filter属性 */ .status-badge { background: rgba(0, 0, 0, 0.7); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 72e11cf..72425d7 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -2,7 +2,7 @@ import {NavBar} from '@nutui/nutui-react-taro' import {ArrowLeft} from '@nutui/icons-react-taro' import Taro from '@tarojs/taro' -function Header(props) { +function Header(props: any) { return ( <> = ({ } }; + console.log(onSuccess,'onSuccess') const disabled = !canScan() || isLoading; return ( diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 7b1d075..1f9d78f 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -1,6 +1,7 @@ import Header from './Header'; import BestSellers from './BestSellers'; import Taro from '@tarojs/taro'; +import { View, Text } from '@tarojs/components'; import {useShareAppMessage} from "@tarojs/taro" import {useEffect, useState} from "react"; import {getShopInfo, loginByOpenId} from "@/api/layout"; @@ -242,32 +243,32 @@ function Home() { // 如果还在加载中,显示加载页面 if (pageLoading) { return ( -
-
-
-
-
-
加载中...
-
-
站点信息: {initStatus.shopInfo ? '✅ 完成' : '⏳ 加载中'}
-
用户授权: {initStatus.userAuth ? '✅ 完成' : '⏳ 检查中'}
-
用户登录: {initStatus.userLogin ? '✅ 完成' : '⏳ 登录中'}
-
+ + + + + + 加载中... + + 站点信息: {initStatus.shopInfo ? '✅ 完成' : '⏳ 加载中'} + 用户授权: {initStatus.userAuth ? '✅ 完成' : '⏳ 检查中'} + 用户登录: {initStatus.userLogin ? '✅ 完成' : '⏳ 登录中'} + {/* 如果加载时间过长,显示帮助按钮 */} -
- -
+ + 如果长时间无响应,请点击网络诊断 -
-
-
-
+
+
+
+
); } diff --git a/src/pages/qr-login/index.tsx b/src/pages/qr-login/index.tsx index 0a34657..c2b4321 100644 --- a/src/pages/qr-login/index.tsx +++ b/src/pages/qr-login/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { View, Text } from '@tarojs/components'; -import { NavBar, Card, Divider, Button } from '@nutui/nutui-react-taro'; -import { ArrowLeft, Scan, Success, Failure, Tips } from '@nutui/icons-react-taro'; +import { Card, Divider, Button } from '@nutui/nutui-react-taro'; +import { Scan, Success, Failure, Tips } from '@nutui/icons-react-taro'; import Taro from '@tarojs/taro'; import QRLoginScanner from '@/components/QRLoginScanner'; import { useUser } from '@/hooks/useUser'; @@ -49,9 +49,9 @@ const QRLoginPage: React.FC = () => { }; // 返回上一页 - const handleBack = () => { - Taro.navigateBack(); - }; + // const handleBack = () => { + // Taro.navigateBack(); + // }; // 清除历史记录 const clearHistory = () => { @@ -65,16 +65,16 @@ const QRLoginPage: React.FC = () => { return ( {/* 导航栏 */} - } - className="bg-white" - /> + {/*}*/} + {/* className="bg-white"*/} + {/*/>*/} {/* 主要内容 */} - + {/* 用户信息卡片 */} @@ -109,7 +109,7 @@ const QRLoginPage: React.FC = () => { 使用说明 - + 1. 在电脑或其他设备上打开网页端登录页面 2. 点击"扫码登录"按钮,显示登录二维码 3. 使用此功能扫描二维码即可快速登录 @@ -134,7 +134,7 @@ const QRLoginPage: React.FC = () => { - + {loginHistory.map((record, index) => ( diff --git a/src/pages/user/components/UserCard.tsx b/src/pages/user/components/UserCard.tsx index 1f73338..18f1c1e 100644 --- a/src/pages/user/components/UserCard.tsx +++ b/src/pages/user/components/UserCard.tsx @@ -1,7 +1,6 @@ import {Button} from '@nutui/nutui-react-taro' import {Avatar, Tag} from '@nutui/nutui-react-taro' import {View, Text} from '@tarojs/components' -import {Scan} from '@nutui/icons-react-taro'; import {getUserInfo, getWxOpenId} from '@/api/layout'; import Taro from '@tarojs/taro'; import {useEffect, useState, forwardRef, useImperativeHandle} from "react"; @@ -26,6 +25,7 @@ const UserCard = forwardRef((_, ref) => { // 扫码登录Hook const { startScan, isLoading: isScanLoading } = useQRLogin(); + console.log(isScanLoading,'>isScanLoading>>>>') // 管理员模式Hook const { isAdminMode, toggleAdminMode } = useAdminMode(); @@ -189,6 +189,8 @@ const UserCard = forwardRef((_, ref) => { } }; + console.log(handleQRLogin,'handleQRLogin()') + // 打开管理员面板 const handleOpenAdminPanel = () => { setShowAdminPanel(true);