import { View, Image, Text, Navigator, Button } from "@tarojs/components" import { memo, useEffect, useState } from "react" import styles from './index.module.scss' import classnames from "classnames"; import { useSelector } from "@/reducers/hooks"; import { GetAdminUserInfoApi } from "@/api/user"; import { alert, goLink } from "@/common/common"; import useLogin from '@/use/useLogin' import {BASE_URL} from '@/common/constant' export default () => { // 用户信息 const { fetchData, state } = GetAdminUserInfoApi(); const {adminUserInfo, userInfo} = useSelector(state => state.userInfo); const [mUserInfo, setMUserInfo] = useState({ phone: "" }); const getData = ()=>{ fetchData(); } useEffect(()=>{ setMUserInfo({ ...mUserInfo, // phone: userInfo?.phone?.replace(userInfo?.phone?.substring(3,7), "****") as string }) getData(); },[]); return (
{/* 测试暂时添加 */} {BASE_URL} ) } const Modal = memo((props:any)=>{ const {data} = props; const [modalShow, setModalShow]=useState(true); const handleouter = ()=>{ } return( <> {!data?.is_authorize_phone&&modalShow&& e.stopPropagation()}> 首次登录提醒 To: 万丰园纺织科技 尊敬的老朋友,欢迎你使用小程序商城;由于您是我们长期合作的伙伴,你的组织已自动为你生成,关联后可查看历史订单哟。 信息错误请联系客服 setModalShow(false)}>我知道 } ) }) // 头部 | 订单 const Header = memo((props:any) => { const {data, userInfo} = props; let menu = [{ text: "待配布", icon: "icon-daipeibu" }, { text: "待付款", icon: "icon-daifukuan" }, { text: "待发货", icon: "icon-daifahuo" }, { text: "已发货", icon: "icon-yifahuo" }, { text: "退款/售后", icon: "icon-a-tuikuanshouhou" }]; const { getPhoneNumber } = useLogin(); const mGetPhoneNumber = (ev)=>{ try { getPhoneNumber(ev.detail.code); } catch (error) { alert.none("绑定失败!"); } } return ( {/* {state.data.user_name} */} {data?.user_name} {userInfo?.phone?.replace(userInfo?.phone?.substring(3,7), "****")||} 1 认证不通过 重新认证 {data?.company_name} 订单 goLink('/pages/orderList/index')}>全部 { menu.map((item, index) => { return ( {item.text} {index==2?"99+":10} ) }) } ) }) // 我的资产 const Assets = () => { return ( 我的资产 ¥ 0 .20 预存款 4 优惠券 ¥ 99999 .-00 授信额度 ) }; // 功能 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" }, { text: "分享推广", icon: "icon-fenxiang" }, { text: "团队邀请", icon: "icon-yaoqingtuandui" }] return ( { menu.map((item, index) => { return ( {item.text} ) }) } ) })