diff --git a/src/common/constant.js b/src/common/constant.js index 9a4f083..d044f8e 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -9,13 +9,8 @@ export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境 // export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境 -<<<<<<< HEAD -// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞 -export const BASE_URL = `http://192.168.1.7:50001/lymarket` // 添 -======= // export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 ->>>>>>> f38df6f9f11edcef0ff8efb9504e2f5df8df4078 // export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰 // CDN diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 9912444..eafe883 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -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 ( - checkShow()}> + setShowShopCart(!showShopCart)}> diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 7709a0c..23d14d6 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -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 (
- + checkGo()} />
{/* {(adminUserInfo as any)?.authentication_status==1&&} */} {/* 测试暂时添加 */} @@ -216,7 +237,6 @@ const Header = memo((props: any) => { }) // 我的资产 const Assets = (props: any) => { - console.log(props, 'propsprops') return ( 我的资产 @@ -236,8 +256,8 @@ const Assets = (props: any) => { 优惠券 - - + props.checkShow()}> + ¥ {formatPriceDiv(props.data.data.credit_line || 0)} {/* .-00 */} @@ -251,9 +271,9 @@ 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" }, - { text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }] + 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 (