Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into dev
This commit is contained in:
commit
9782a90ceb
@ -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}>
|
||||
|
@ -27,10 +27,31 @@ export default () => {
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
}, [])
|
||||
const checkGo = () => {
|
||||
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 {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/creditLine/index"
|
||||
})
|
||||
}
|
||||
}
|
||||
return (
|
||||
<View className={styles.main}>
|
||||
<Header data={adminUserInfo} />
|
||||
<Assets data={state} />
|
||||
<Assets data={state} checkShow={() => checkGo()} />
|
||||
<Main />
|
||||
{/* {(adminUserInfo as any)?.authentication_status==1&&<Modal data={adminUserInfo}/>} */}
|
||||
{/* 测试暂时添加 */}
|
||||
@ -216,7 +237,6 @@ const Header = memo((props: any) => {
|
||||
})
|
||||
// 我的资产
|
||||
const Assets = (props: any) => {
|
||||
console.log(props, 'propsprops')
|
||||
return (
|
||||
<View className={`${styles.assets} ${styles.crad} ${styles['main-card']}`}>
|
||||
<View className={`${styles['assets-title']}`}>我的资产</View>
|
||||
@ -236,8 +256,8 @@ const Assets = (props: any) => {
|
||||
</View>
|
||||
<Text className={`${styles['assets-content-item-tips']}`}>优惠券</Text>
|
||||
</View>
|
||||
<Navigator hoverClass="none" url="/pages/creditLine/index">
|
||||
<View className={`${styles['assets-content-item-top']}`}>
|
||||
<Navigator hoverClass="none" onClick={() => props.checkShow()}>
|
||||
<View className={`${styles['assets-content-item-top']}`} >
|
||||
<Text className={`${styles['assets-content-item-top-before']}`}>¥</Text>
|
||||
<Text className={`${styles['assets-content-item-top-content']}`}>{formatPriceDiv(props.data.data.credit_line || 0)}</Text>
|
||||
{/* <Text className={`${styles['assets-content-item-top-after']}`}>.-00</Text> */}
|
||||
@ -251,8 +271,8 @@ const Assets = (props: any) => {
|
||||
|
||||
// 功能
|
||||
const Main = memo(() => {
|
||||
let menu = [{ text: "地址管理", icon: "icon-shoucang",url: "/pages/addressManager/index" },{ text: "码单管理", icon: "icon-shoucang",url: "/pages/weightList/index" },
|
||||
{ text: "我的收藏", icon: "icon-shoucang" }, { text: "颜色对比", icon: "icon-yanseduibi",url: "/pages/sampleComparison/index" },
|
||||
let menu = [{ text: "地址管理", icon: "icon-shoucang", url: "/pages/addressManager/index" }, { text: "码单管理", icon: "icon-shoucang", url: "/pages/weightList/index" },
|
||||
{ text: "我的收藏", icon: "icon-shoucang" }, { text: "颜色对比", icon: "icon-yanseduibi", url: "/pages/sampleComparison/index" },
|
||||
{ text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }]
|
||||
return (
|
||||
<View className={`${styles.crad} ${styles['card-main']} ${styles['card-feature']}`}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user