授信前添加限制
This commit is contained in:
@@ -8,7 +8,6 @@ import ShopCart from '@/components/shopCart'
|
||||
import { goLink } from '@/common/common'
|
||||
import styles from './index.module.scss'
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useSelector } from "@/reducers/hooks";
|
||||
import Taro, { Events, useDidShow, usePullDownRefresh } from '@tarojs/taro'
|
||||
import { GetProductKindListApi, GetProductListApi } from '@/api/material'
|
||||
import useLogin from '@/use/useLogin'
|
||||
@@ -100,67 +99,11 @@ export default () => {
|
||||
return dataLoadingStatus({ list: productData.list, total: productData.total, status: productState.loading })
|
||||
}, [productData, productState.loading])
|
||||
|
||||
useEffect(() => {
|
||||
getShow()
|
||||
}, [])
|
||||
// const [time, setShow] = useState(false)
|
||||
//拿状态存储的东西判断
|
||||
const { adminUserInfo } = useSelector(state => state.userInfo);
|
||||
const getShow = () => {
|
||||
if (adminUserInfo?.authentication_status === 0 || adminUserInfo?.authentication_status === 1 || adminUserInfo?.authentication_status === 2 || adminUserInfo?.authentication_status === 3) {
|
||||
//倒计时弹出去认证
|
||||
const countTime: any = 60
|
||||
//获取倒计时的变量
|
||||
var time = parseInt(countTime);
|
||||
const countDown = setInterval(() => {
|
||||
if (time == 0) {
|
||||
Taro.showModal({
|
||||
title: '提示',
|
||||
content: '你还未认证,认证后解锁更多功能',
|
||||
cancelText: '稍后认证',
|
||||
confirmText: '去认证',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
Taro.navigateTo({ url: '/pages/certification/index' })
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
//清除定时器
|
||||
clearInterval(countDown);
|
||||
} else {
|
||||
time--;
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
//检查认证是否认证
|
||||
const checkShow = () => {
|
||||
if (adminUserInfo.authentication_status === 0 || adminUserInfo.authentication_status === 1 || adminUserInfo.authentication_status === 2 || adminUserInfo.authentication_status === 3) {
|
||||
Taro.showModal({
|
||||
title: '提示',
|
||||
content: '你还未认证,认证后解锁更多功能',
|
||||
cancelText: '稍后认证',
|
||||
confirmText: '去认证',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
Taro.navigateTo({ url: '/pages/certification/index' })
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
setShowShopCart(!showShopCart)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<MoveBtn onClick={() => checkShow()}>
|
||||
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
|
||||
<View className={styles.main}>
|
||||
<Banner />
|
||||
<View className={styles.search}>
|
||||
|
||||
Reference in New Issue
Block a user