From 48e59860606bd7b32644dd236feb2908187af7b9 Mon Sep 17 00:00:00 2001 From: xuan Date: Tue, 13 Sep 2022 14:52:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E6=A0=B7=E5=93=81=E5=AF=B9?= =?UTF-8?q?=E6=AF=94):=20=E5=B7=B2=E7=A7=BB=E6=A4=8DEShop=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=93=81=E5=AF=B9=E6=AF=94=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 1 + src/api/product/index.ts | 1 + src/api/product/product.ts | 9 + src/app.config.ts | 7 +- src/components/iconCard/index.tsx | 9 +- .../compoents/bluetooth/LinkBlueTooth.tsx | 82 ++++++ .../compoents/bluetooth/Popup.tsx | 79 ++++++ .../css/linkBlueTooth.module.scss | 42 +++ .../sampleComparison/css/popup.module.scss | 90 +++++++ src/pages/sampleComparison/index.config.ts | 4 + src/pages/sampleComparison/index.module.scss | 251 ++++++++++++++++++ src/pages/sampleComparison/index.tsx | 186 +++++++++++++ src/pages/user/index.tsx | 181 ++++++------- 13 files changed, 848 insertions(+), 94 deletions(-) create mode 100644 src/api/product/index.ts create mode 100644 src/api/product/product.ts create mode 100644 src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx create mode 100644 src/pages/sampleComparison/compoents/bluetooth/Popup.tsx create mode 100644 src/pages/sampleComparison/css/linkBlueTooth.module.scss create mode 100644 src/pages/sampleComparison/css/popup.module.scss create mode 100644 src/pages/sampleComparison/index.config.ts create mode 100644 src/pages/sampleComparison/index.module.scss create mode 100644 src/pages/sampleComparison/index.tsx diff --git a/src/api/index.ts b/src/api/index.ts index 8068a8b..f8f41e4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,7 @@ export {LoginApi} from './login/index' +export { productabsorbcontrast } from './product/index' import { useRequest } from "@/use/useHttp" /** diff --git a/src/api/product/index.ts b/src/api/product/index.ts new file mode 100644 index 0000000..c256c79 --- /dev/null +++ b/src/api/product/index.ts @@ -0,0 +1 @@ +export { productabsorbcontrast } from './product' diff --git a/src/api/product/product.ts b/src/api/product/product.ts new file mode 100644 index 0000000..6d8354a --- /dev/null +++ b/src/api/product/product.ts @@ -0,0 +1,9 @@ +import { useRequest } from "@/use/useHttp" + +//取色对比 +export const productabsorbcontrast = () => { + return useRequest({ + url: `/v1/mall/product/color/absorb/contrast`, + method: 'get', + }) +} diff --git a/src/app.config.ts b/src/app.config.ts index f2eaed8..0a10a57 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -49,5 +49,10 @@ export default defineAppConfig({ 'custom-wrapper': '/custom-wrapper', ...useGlobalIconFont(), }, - subPackages: [], + subPackages: [ + { + root: 'pages/sampleComparison', + pages: ['index'], + }, + ], }) diff --git a/src/components/iconCard/index.tsx b/src/components/iconCard/index.tsx index 4c834a4..8008228 100644 --- a/src/components/iconCard/index.tsx +++ b/src/components/iconCard/index.tsx @@ -1,6 +1,6 @@ -import { View } from "@tarojs/components" -import { FC, ReactNode } from "react" -import IconFont from "../iconfont" +import { View } from '@tarojs/components' +import { FC, ReactNode } from 'react' +import IconFont from '../iconfont' import styles from './index.module.scss' import classname from 'classnames' @@ -16,8 +16,9 @@ interface PropsType { iconSize?: number } const IconCard: FC = (props) => { - const { iconName, title, onClick, customClass = '', iconSize=72 } = props + const { iconName, title, onClick, customClass = '', iconSize = 72 } = props const handleClick = (event) => { + console.log(event) onClick && onClick(event) } return ( diff --git a/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx b/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx new file mode 100644 index 0000000..a2c1478 --- /dev/null +++ b/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx @@ -0,0 +1,82 @@ +import { View } from '@tarojs/components' +import { memo, useEffect, useMemo, useState } from 'react' +import Taro from '@tarojs/taro' +import { useBluetooth } from '@/use/contextBlueTooth' +import SearchInput from '@/components/searchInput' +import Popup from './Popup' +import classnames from 'classnames' +import styles from '../../css/linkBlueTooth.module.scss' + +export default memo(() => { + const { state, init, startScan, connect, disconnect } = useBluetooth() + + useEffect(() => { + init() + }, []) + + const [linkStatus, setLinkStatus] = useState(1) + useEffect(() => { + if (!state.available) { + setLinkStatus(1) + } else if (state.available && state.connected?.name) { + setLinkStatus(3) + } else { + setLinkStatus(2) + } + }, [state.available, state.connected]) + + const linkName = useMemo(() => { + return state.connected?.localName || '' + }, [state.connected]) + + //链接设备 + const onLinkListen = (item) => { + if (!state.connected && !state.connecting) connect(item) + } + + const [popupShow, setPopupShow] = useState(false) + //显示设备列表 + const onFindDevice = () => { + if (linkStatus == 1) { + Taro.showToast({ + title: '请打开蓝牙', + icon: 'none', + }) + } else { + setPopupShow(true) + onFindEven() + } + } + const onFindEven = () => { + if (!state.discovering && !state.connected && !state.connecting) startScan() + } + + //断开链接 + const onDisconnect = () => { + disconnect() + setPopupShow(false) + } + + return ( + <> + + + + + {(linkStatus == 1 && 请开启蓝牙) || + (linkStatus == 2 && 未连接设备) || + (linkStatus == 3 && {linkName})} + + + setPopupShow(false)} + onLink={(item) => onLinkListen(item)} + onOff={onDisconnect} + onFind={onFindEven} + /> + + + ) +}) diff --git a/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx b/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx new file mode 100644 index 0000000..ad81e1f --- /dev/null +++ b/src/pages/sampleComparison/compoents/bluetooth/Popup.tsx @@ -0,0 +1,79 @@ +import { ScrollView, View } from '@tarojs/components' +import { memo, useEffect, useState } from 'react' +import Loading from '@/components/loading' +import style from '../../css/popup.module.scss' + +interface params { + state: any + show: Boolean + onClose: (Boolean) => void + onLink: (any) => void + children?: React.ReactNode + onOff: () => void + onFind: () => void +} + +export default memo(({ state, show = false, onClose, onLink, onOff, onFind }: params) => { + const [popupShow, setPopupShow] = useState(show) + useEffect(() => { + setPopupShow(show) + }, [show]) + const onCloseListener = () => { + onClose(false) + } + + return ( + <> + {popupShow && ( + + + 搜索设备 + + + {(state.devices && + state.devices.length > 0 && + state?.devices.map((item) => { + return ( + onLink(item)}> + {item.name} + {(!state.connecting && !state.connected && 链接) || + (state.connecting && item.deviceId == state.connecting.deviceId && 正在链接...) || + (state.connected && item.deviceId == state.connected.deviceId && 链接成功)} + + ) + })) || ( + + {(!state.discovering && ( + <> + 暂无设备,请按以下条件检查 + 1.请确保取色仪处于激活状态 + 2.请确保取色仪没有链接其他设备 + 3.请打开手机定位 + + )) || 设备搜索中} + + )} + + + {(state.connected && ( + + 断开链接 + + )) || + (!state.connected && state.discovering && ( + + 搜索中 + + + )) || ( + + 重新搜索 + + )} + + + + )} + + ) +}) diff --git a/src/pages/sampleComparison/css/linkBlueTooth.module.scss b/src/pages/sampleComparison/css/linkBlueTooth.module.scss new file mode 100644 index 0000000..0714b46 --- /dev/null +++ b/src/pages/sampleComparison/css/linkBlueTooth.module.scss @@ -0,0 +1,42 @@ +.main { + width: 690px; + height: 86px; + background: #ffffff; + border-radius: 10px; + margin-top: 24px; + margin-left: 30px; + + .bluetooth_link { + display: flex; + align-items: center; + + .link_status { + width: 12px; + height: 12px; + background: #f02409; + border-radius: 50%; + } + + .link_statused { + background: #07C160; + } + + .link_statused_no { + background: #f0ec09; + } + + .link_name { + font-size: $font_size; + margin-left: 20px; + + } + + .link_name_no { + color: #f02409; + } + + .link_name_no_link { + color: #f0ec09; + } + } +} \ No newline at end of file diff --git a/src/pages/sampleComparison/css/popup.module.scss b/src/pages/sampleComparison/css/popup.module.scss new file mode 100644 index 0000000..d6c273f --- /dev/null +++ b/src/pages/sampleComparison/css/popup.module.scss @@ -0,0 +1,90 @@ +.popup{ + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + left: 0; + .mask{ + width: 100%; + height: 100%; + background-color: rgba(0,0,0,0.5); + position: fixed; + top:0; + left:0; + z-index: 9; + } + .content{ + z-index: 99; + background-color: #fff; + width: 75vw; + height: 600px; + position: fixed; + top: 50%; + left: 50%; + border-radius: 20px; + transform: translateX(-50%) translateY(-50%); + display: flex; + flex-direction: column; + font-size: 28px; + .title{ + text-align: center; + margin: 20px; + } + .list{ + height: 480px; + padding: 0 20px; + .scroll{ + height: 100%; + } + .item{ + margin-bottom: 20px; + display: flex; + justify-content: space-between; + border-bottom: 1px dashed #ccc; + padding: 15px 0; + color: #3b3b3b; + @mixin link{ + font-size: 25px; + } + .link_success{ + @include link; + color: green; + } + .link_ing { + color: orange; + } + } + .noDevice{ + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + color: #a8a8a8; + .n_item{ + width: 100%; + text-align: left; + margin-top: 20px; + padding: 0 30px; + box-sizing: border-box; + } + } + + } + .footer{ + text-align: center; + padding: 20px 0; + background-color: #f1f1f1; + border-radius: 0 0 10px 10px; + display: flex; + justify-content: center; + align-items: center; + } + .finding{ + color: orange; + } + .footer_off{ + color: red; + } + } +} diff --git a/src/pages/sampleComparison/index.config.ts b/src/pages/sampleComparison/index.config.ts new file mode 100644 index 0000000..cfc4a8a --- /dev/null +++ b/src/pages/sampleComparison/index.config.ts @@ -0,0 +1,4 @@ +export default { + navigationBarTitleText: '样品对比', + enableShareAppMessage: false, +} diff --git a/src/pages/sampleComparison/index.module.scss b/src/pages/sampleComparison/index.module.scss new file mode 100644 index 0000000..52207f9 --- /dev/null +++ b/src/pages/sampleComparison/index.module.scss @@ -0,0 +1,251 @@ +page { + background: #f3f3f3; + overflow: hidden; +} + +.body { + overflow: hidden; + + .topBox { + margin-top: 24px; + margin-left: 30px; + width: 690px; + height: 86px; + background: #ffffff; + border-radius: 10px; + display: flex; + align-items: center; + justify-content: space-between; + + .leftBox { + display: flex; + align-items: center; + padding-left: 19px; + + .leftFont { + font-size: 28px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + text-align: left; + color: #707070; + margin-right: 14px; + } + + .borderBox { + width: 0px; + height: 62px; + border: 2px solid #f3f3f3; + margin-right: 39px; + } + + .cricleBox { + width: 12px; + height: 12px; + background: #cccccc; + border-radius: 50%; + margin-right: 12px; + } + + .notNet { + font-size: 28px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #aaaaaa; + } + } + + .iconMore { + margin-right: 30px; + font-size: 30px; + } + } + + .contBox { + margin-top: 53px; + display: flex; + padding-left: 56px; + + .firstBox { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + + .firstLeftName { + font-size: 26px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #707070; + } + + .firstLeftbox { + width: 290px; + height: 290px; + background: #dddddd; + margin-top: 13px; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + border-radius: 50%; + + .clickFont { + font-size: 28px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #707070; + } + } + + .color_bock { + width: 290px; + height: 290px; + border-radius: 50%; + } + + .color_bocktwo { + width: 290px; + height: 290px; + border-radius: 50%; + } + + .nameColor { + font-size: 24px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #707070; + margin-top: 30px; + } + } + } + + .reslutBox { + width: 692px; + height: 180px; + background: #ffffff; + margin-top: 30px; + margin-left: 29px; + border-radius: 20px; + overflow: hidden; + } + + .reslutTitle { + overflow: hidden; + width: 100%; + margin-top: 41px; + display: flex; + align-items: center; + justify-content: space-between; + + .titleLeft { + margin-left: 48px; + font-size: 26px; + font-family: Microsoft YaHei, Microsoft YaHei-Bold; + font-weight: 700; + color: #707070; + } + + .titleRiht { + margin-right: 37px; + width: 136px; + height: 46px; + background: #ffd9d9; + border-radius: 10px; + font-size: 28px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + text-align: center; + color: #ff4a4a; + line-height: 46px; + } + + .titleRiht1 { + background: #cdf3df; + margin-right: 37px; + width: 136px; + height: 46px; + border-radius: 10px; + font-size: 28px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + text-align: center; + line-height: 46px; + color: #07c160; + } + } + + .notResult { + width: 100%; + text-align: center; + font-size: 26px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #ababab; + margin-top: 14px; + } + + .notBox { + margin-top: 32px; + display: flex; + align-items: center; + justify-content: space-between; + overflow: hidden; + + .notLeft { + font-size: 26px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #707070; + margin-left: 40px; + } + + .notright { + font-size: 26px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + color: #707070; + margin-right: 37px; + } + } + + .bottomBox { + position: fixed; + bottom: 0; + width: 750px; + height: 182px; + background: #f3f3f3; + box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.16); + overflow: hidden; + display: flex; + + .leftBtn { + width: 264px; + height: 82px; + background: #ffffff; + border-radius: 42px; + font-size: 32px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + text-align: center; + color: #007aff; + line-height: 82px; + margin-top: 34px; + margin-left: 67px; + } + + .rightBtn { + width: 264px; + height: 82px; + background: #007aff; + border-radius: 42px; + font-size: 32px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; + text-align: center; + color: #ffffff; + line-height: 82px; + margin-top: 34px; + margin-left: 88px; + } + } +} diff --git a/src/pages/sampleComparison/index.tsx b/src/pages/sampleComparison/index.tsx new file mode 100644 index 0000000..c0f6885 --- /dev/null +++ b/src/pages/sampleComparison/index.tsx @@ -0,0 +1,186 @@ +import { Image, Text, Textarea, View } from '@tarojs/components' +import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { useBluetooth } from '../../use/contextBlueTooth' +import classnames from 'classnames' +import LinkBlueTooth from './compoents/bluetooth/LinkBlueTooth' +import { toRgb } from '../../common/bluetooth/color/colorSpace' +import styles from './index.module.scss' +import { productabsorbcontrast } from '@/api/index' +export default () => { + //搜索参数 + const [searchField, setSearchField] = useState({ + l1: '', + a1: '', + b1: '', + l2: '', + a2: '', + b2: '', + }) + type ColorList = { + one?: any + two?: any + } + const [colorList, setColorList] = useState({ + one: null, + two: null, + }) + const { state: colorState, measureAndGetLab } = useBluetooth() + + const getLab = async (val) => { + if (colorState.connected) { + let res = await measureAndGetLab() + if (val === 1) { + setColorList({ ...colorList, one: res }) + } else { + setColorList({ ...colorList, two: res }) + } + } else { + Taro.showToast({ + title: '请链接设备', + icon: 'none', + }) + } + } + const getNowTime = () => { + const yy = new Date().getFullYear() + const MM = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1 + const dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate() + const HH = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours() + const mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes() + const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds() + return yy + '-' + MM + '-' + dd + ' ' + HH + ':' + mm + ':' + ss + } + //监听lab数据变化 + const [blueToothColor, setBlueToothColor] = useState('') + const [blueToothColorTwo, setBlueToothColorTwo] = useState('') + const [time, setTime] = useState('') + const [timeTwo, setTimeTwo] = useState('') + useEffect(() => { + if (colorState.deviceLab) { + if ((colorList as any).one?.constructor === Object) { + const rgb = toRgb([(colorList as any).one?.L, (colorList as any).one?.a, (colorList as any).one?.b]) + setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) + setTime(getNowTime()) + setSearchField({ ...searchField, l1: rgb[0], a1: rgb[1], b1: rgb[2] }) + } + if ((colorList as any).two?.constructor === Object) { + const rgb = toRgb([(colorList as any).two?.L, (colorList as any).two?.a, (colorList as any).two?.b]) + setBlueToothColorTwo(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) + setTimeTwo(getNowTime()) + setSearchField({ ...searchField, l2: rgb[0], a2: rgb[1], b2: rgb[2] }) + } + } + }, [colorList]) + const reset = () => { + setColorList({}) + setBlueToothColor('') + setBlueToothColorTwo('') + setTime('') + setTimeTwo('') + setData('') + setResult('') + } + const [data, setData] = useState('') + const [result, setResult] = useState('') + const { fetchData } = productabsorbcontrast() + const handTake = async () => { + if (searchField.l1 === '') { + Taro.showToast({ + title: '请填充基础样品', + icon: 'none', + }) + return + } + if (searchField.l2 === '') { + Taro.showToast({ + title: '请填充对比样品', + icon: 'none', + }) + return + } + const query = { + ...searchField, + } + const res = await fetchData(query) + if (res.data) { + setData(res.data) + let diffarray = [ + res.data.reddish && '偏红', + res.data.yellowish && '偏黄', + res.data.greenish && '偏绿', + res.data.bluish && '偏蓝', + res.data.whitish && '偏亮', + res.data.darker && '偏暗', + ] + let resCont = diffarray.filter((item) => item).join(',') + setResult(resCont) + } + } + return ( + + {/* + + 蓝牙设备 + + + + + + */} + + + + 基础样品 + {blueToothColor === '' && ( + getLab(1)}> + 点击取色 + + )} + {blueToothColor && getLab(1)} style={{ background: blueToothColor }}>} + {time === '' && --} + {time && {time}} + + + 对比样品 + {blueToothColorTwo === '' && ( + getLab(2)}> + 点击取色 + + )} + {blueToothColorTwo && getLab(2)} style={{ background: blueToothColorTwo }}>} + {timeTwo === '' && --} + {timeTwo && {timeTwo}} + + + + + 测量结果 + {(data as any).ciede_2000 >= 1 && 不合格} + {(data as any).ciede_2000 <= 1 && 合格} + + {data === '' && 暂无数据} + {data && ( + + 色差值: {(data as any).ciede_2000} + {!(data as any).reddish && + !(data as any).yellowish && + !(data as any).greenish && + !(data as any).bluish && + !(data as any).whitish && + !(data as any).darker && 无明显色差} + {result && {result}} + + )} + + + reset()}> + 重置 + + handTake()}> + 提交 + + + + ) +} diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 92cbdd2..c12e407 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -13,11 +13,95 @@ import { goLink } from '@/common/common' type IconfontName = Parameters['0']['name'] type IconCardType = { - iconName: IconfontName, - name: string, + iconName: IconfontName + name: string path: string } +const feature: IconCardType[] = [ + { + iconName: 'icon-lingquseka', + name: '领取色卡', + path: '', + }, + { + iconName: 'icon-pandiansaoma', + name: '盘点扫码', + path: '', + }, + { + iconName: 'icon-fahuoliebiao', + name: '发货列表', + path: '', + }, + { + iconName: 'icon-yaoqingma', + name: '邀请码', + path: '', + }, + { + iconName: 'icon-tihuoliebiao', + name: '提货列表', + path: '', + }, + { + iconName: 'icon-shouhouzhongxin', + name: '退货退款', + path: '', + }, + { + iconName: 'icon-shoukuanliebiao', + name: '收款列表', + path: '', + }, + { + iconName: 'icon-kehuxinxi', + name: '客户列表', + path: '', + }, +] + +const fabric: IconCardType[] = [ + { + iconName: 'icon-yansequyang', + name: '颜色取样', + path: '', + }, + { + iconName: 'icon-qusechazhao', + name: '取色查找', + path: '', + }, + { + iconName: 'icon-yangpinduibi', + name: '样品对比', + path: '/pages/sampleComparison/index', + }, +] + +const statisticAnalysis: IconCardType[] = [ + { + iconName: 'icon-xiaoshou', + name: '销售', + path: '', + }, + { + iconName: 'icon-duizhang', + name: '对账', + path: '', + }, + { + iconName: 'icon-yuncangkucun', + name: '云仓库存', + path: '', + }, + { + iconName: 'icon-qianzhicangkucun', + name: '前置仓库存', + path: '', + }, +] + // 用户信息 const UserInfo: FC = () => { const { removeToken, removeUserInfo, userInfo } = useUserInfo() @@ -27,92 +111,6 @@ const UserInfo: FC = () => { // username: '', // userno: '', // }) - - - const feature: IconCardType[] = [ - { - iconName: 'icon-lingquseka', - name: '领取色卡', - path: '', - }, - { - iconName: 'icon-pandiansaoma', - name: '盘点扫码', - path: '', - }, - { - iconName: 'icon-fahuoliebiao', - name: '发货列表', - path: '', - }, - { - iconName: 'icon-yaoqingma', - name: '邀请码', - path: '', - }, - { - iconName: 'icon-tihuoliebiao', - name: '提货列表', - path: '', - }, - { - iconName: 'icon-shouhouzhongxin', - name: '退货退款', - path: '', - }, - { - iconName: 'icon-shoukuanliebiao', - name: '收款列表', - path: '', - }, - { - iconName: 'icon-kehuxinxi', - name: '客户列表', - path: '', - }, - ] - - const fabric: IconCardType[] = [ - { - iconName: 'icon-yansequyang', - name: '颜色取样', - path: '', - }, - { - iconName: 'icon-qusechazhao', - name: '取色查找', - path: '', - }, - { - iconName: 'icon-yangpinduibi', - name: '样品对比', - path: '', - }, - ] - - const statisticAnalysis: IconCardType[] = [ - { - iconName: 'icon-xiaoshou', - name: '销售', - path: '', - }, - { - iconName: 'icon-duizhang', - name: '对账', - path: '', - }, - { - iconName: 'icon-yuncangkucun', - name: '云仓库存', - path: '', - }, - { - iconName: 'icon-qianzhicangkucun', - name: '前置仓库存', - path: '', - }, - ] - // 退出登录 const handleLogout = () => { @@ -121,6 +119,11 @@ const UserInfo: FC = () => { goLink('/pages/login/index', {}, 'reLaunch') } + const handleClickIconCard = (item: IconCardType) => { + console.log('item==>', item) + goLink(item.path, {}, 'navigateTo') + } + return ( <> @@ -158,7 +161,7 @@ const UserInfo: FC = () => { 布料取色 {fabric.map((item) => { - return + return handleClickIconCard(item)}> })}