11import dayjs from 'dayjs' ;
22import { useState } from 'react' ;
3- import { Ellipsis , Modal } from '@c-x/ui' ;
4- import { Box , Button , Link , Stack } from '@mui/material' ;
3+ import { Modal } from '@c-x/ui' ;
4+ import HelpCenter from '@/assets/json/help-center.json' ;
5+ import Takeoff from '@/assets/json/takeoff.json' ;
6+ import IconUpgrade from '@/assets/json/upgrade.json' ;
7+ import { Box , Button , Stack } from '@mui/material' ;
58import { DomainLicenseResp } from '@/api/types' ;
69import ChangeLicense from './changeLicense' ;
10+ import LottieIcon from '../lottieIcon' ;
711
812interface LicenseModalProps {
913 open : boolean ;
@@ -36,7 +40,7 @@ const AboutModal = ({
3640 }
3741
3842 return (
39- < Modal
43+ < Modal
4044 title = '关于 MonkeyCode'
4145 width = { 600 }
4246 open = { open }
@@ -45,43 +49,93 @@ const AboutModal = ({
4549 < Stack direction = { 'column' } gap = { 2 } sx = { {
4650 fontSize : '14px'
4751 } } >
48- < Stack direction = { 'row' } >
52+ < Stack direction = { 'row' } gap = { 2 } alignItems = { 'center' } >
4953 < Box sx = { {
5054 width : '120px'
5155 } } > 当前版本</ Box >
5256 < Box sx = { {
5357 width : '120px' ,
5458 fontWeight : 700
5559 } } > { curVersion } </ Box >
60+
61+ { latestVersion === `v${ curVersion } ` ? (
62+ < Box sx = { { color : 'text.auxiliary' , fontSize : 12 } } >
63+ 已是最新版本,无需更新
64+ </ Box >
65+ ) : (
66+ < Button
67+ size = 'small'
68+ startIcon = {
69+ < Box >
70+ < LottieIcon
71+ id = 'version'
72+ src = { latestVersion === '' ? HelpCenter : IconUpgrade }
73+ style = { { width : 16 , height : 16 , display : 'flex' } }
74+ />
75+ </ Box >
76+ }
77+ onClick = { ( ) => {
78+ window . open (
79+ 'https://monkeycode.docs.baizhi.cloud/node/01980d22-db84-73b4-ae13-6a188e318048' ,
80+ ) ;
81+ } }
82+ >
83+ 立即更新
84+ </ Button >
85+ ) }
5686 </ Stack >
57- < Stack direction = { 'row' } >
87+
88+ < Stack direction = { 'row' } gap = { 2 } alignItems = { 'center' } >
5889 < Box sx = { {
5990 width : '120px' ,
6091 } } > 产品型号</ Box >
61- < Box sx = { {
62- mr : '20px'
63- } } > { editionText ( license ?. edition ) } </ Box >
64- < Link href = "#" sx = { {
65- color : 'info.main' ,
66- '&:hover' : {
67- fontWeight : 700
92+ < Box > { editionText ( license ?. edition ) } </ Box >
93+
94+ < Button
95+ size = 'small'
96+ startIcon = {
97+ < Box >
98+ < LottieIcon
99+ id = 'version'
100+ src = { Takeoff }
101+ style = { { width : 16 , height : 16 , display : 'flex' } }
102+ />
103+ </ Box >
104+ }
105+ onClick = { ( ) => setOpenChangeLicense ( true ) }
106+ >
107+ 切换授权
108+ </ Button >
109+
110+ < Button
111+ size = 'small'
112+ startIcon = {
113+ < Box >
114+ < LottieIcon
115+ id = 'consult'
116+ src = { HelpCenter }
117+ style = { { width : 16 , display : 'flex' } }
118+ />
119+ </ Box >
68120 }
69- } }
70- onClick = { ( ) => {
71- setOpenChangeLicense ( true ) ;
72- } } > 切换授权</ Link >
121+ onClick = { ( ) => {
122+ window . open ( 'https://baizhi.cloud/consult' ) ;
123+ } }
124+ >
125+ 商务咨询
126+ </ Button >
73127 </ Stack >
74- { license && license ?. edition !== 0 && < Stack direction = { 'row' } >
128+ { license && license ?. edition !== 0 && < Stack direction = { 'row' } gap = { 2 } >
75129 < Box sx = { {
76130 width : '120px'
77131 } } > 授权时间</ Box >
78132 < Box sx = { {
79133 } } > { dayjs . unix ( license . started_at ! ) . format ( 'YYYY-MM-DD' ) } ~ { dayjs . unix ( license . expired_at ! ) . format ( 'YYYY-MM-DD' ) } </ Box >
80134 </ Stack > }
81135 </ Stack >
82- < ChangeLicense
136+ < ChangeLicense
83137 open = { openChangeLicense }
84- onClose = { ( ) => { setOpenChangeLicense ( false ) } } />
138+ onClose = { ( ) => { setOpenChangeLicense ( false ) } } />
85139 </ Modal >
86140 ) ;
87141} ;
0 commit comments