bug(custom):

This commit is contained in:
zhangjing1
2025-09-24 18:19:48 +08:00
parent fe1630aaab
commit 24881f09c4
2 changed files with 5 additions and 10 deletions

View File

@@ -28,9 +28,10 @@ const initialState = {
}
const SpLogin = forwardRef((props, ref) => {
const { children, className, newUser = false, visible, onPolicyClose, onChange, onClose } = props
const { children, className, visible, onPolicyClose, onChange, onClose } = props
const { updateAddress } = useLocation()
const { shopInfo } = useSelector((state) => state.shop)
const { isNewUser } = useSelector((state) => state.user)
const { isLogin, login, setToken, checkPolicyChange } = useLogin({
policyUpdateHook: (isUpdate) => {
@@ -41,7 +42,6 @@ const SpLogin = forwardRef((props, ref) => {
!visible && updateAddress && updateAddress()
}
})
const [isNewUser, setIsNewUser] = useState(false)
const [policyModal, setPolicyModal] = useState(false)
const [loginModal, setLoginModal] = useState(false)
const [state, setState] = useImmer(initialState)
@@ -54,12 +54,7 @@ const SpLogin = forwardRef((props, ref) => {
}
}, [visible])
useEffect(() => {
if (newUser) {
setIsNewUser(true)
}
}, [newUser])
useEffect(() => {
if (loginModal) {
fetchPrivacyData()

View File

@@ -112,7 +112,7 @@ function MemberIndex(props) {
// console.log('===>getCurrentPages==>', getCurrentPages(), getCurrentInstance())
const $instance = getCurrentInstance()
const { updateAddress } = useLocation()
const { isLogin, isNewUser, getUserInfo } = useLogin({
const { isLogin, getUserInfo } = useLogin({
autoLogin: false,
// policyUpdateHook: (isUpdate) => {
// // isUpdate && setPolicyModal(true)
@@ -541,7 +541,7 @@ function MemberIndex(props) {
</View>
</>
) : (
<SpLogin newUser={isNewUser}>
<SpLogin>
<Text className='login-text font-medium text-34'>点击登录</Text>
</SpLogin>
)}