Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs_vsofpm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
cs_vsofpm
Commits
bc3f7250
Commit
bc3f7250
authored
Jun 06, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shit
parent
7b82c2bf
Pipeline
#3637
passed with stages
in 2 minutes and 29 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
52 deletions
+99
-52
index.jsx
src/components/OnlineChat/index.jsx
+7
-0
stucard.jsx
src/components/ProductCard/stucard.jsx
+42
-5
index.jsx
src/layouts/dashboard/nav/index.jsx
+48
-45
index.jsx
src/pages/dobustrain/index.jsx
+1
-1
index.jsx
src/pages/domybustrain/index.jsx
+1
-1
No files found.
src/components/OnlineChat/index.jsx
View file @
bc3f7250
import
difftime
from
"@/utils/difftime"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
Avatar
,
Box
,
Stack
}
from
"@mui/material"
;
import
{
useModel
}
from
"@umijs/max"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
Input
}
from
"antd"
;
import
dayjs
from
"dayjs"
;
...
...
@@ -9,6 +10,10 @@ import { Scrollbars } from "react-custom-scrollbars";
import
"./index.less"
;
function
OnlineChat
({
trainId
})
{
const
{
initialState
:
{
menuNum
},
setInitialState
,
}
=
useModel
(
"@@initialState"
);
const
currentUserId
=
localStorage
.
getItem
(
"ID"
);
const
[
value
,
setvalue
]
=
useState
();
...
...
@@ -34,6 +39,7 @@ function OnlineChat({ trainId }) {
}
}
};
const
{
data
,
loading
,
refresh
}
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
...
...
@@ -48,6 +54,7 @@ function OnlineChat({ trainId }) {
scrollRef
?.
current
?.
scrollToBottom
();
},
10
);
},
refreshDeps
:
[
menuNum
],
}
);
...
...
src/components/ProductCard/stucard.jsx
View file @
bc3f7250
...
...
@@ -16,9 +16,9 @@ import IconFont from "@/components/IconFont";
import
Label
from
"@/components/label"
;
import
difftime
from
"@/utils/difftime"
;
import
AccessTimeFilledIcon
from
"@mui/icons-material/AccessTimeFilled"
;
import
{
history
}
from
"@umijs/max"
;
import
{
history
,
useModel
}
from
"@umijs/max"
;
import
dayjs
from
"dayjs"
;
import
{
useState
}
from
"react"
;
import
{
use
Effect
,
use
State
}
from
"react"
;
// ----------------------------------------------------------------------
...
...
@@ -35,9 +35,7 @@ ShopProductCard.propTypes = {
product
:
PropTypes
.
object
,
};
export
default
function
ShopProductCard
({
product
,
})
{
export
default
function
ShopProductCard
({
product
})
{
const
{
trainName
,
picUrl
,
...
...
@@ -48,13 +46,52 @@ export default function ShopProductCard({
sectionNum
,
experimentNum
,
startTime
,
unReadMsgCount
,
trainId
,
}
=
product
;
const
[
confirm
,
setconfirm
]
=
useState
(
false
);
const
[
Numcount
,
setNumcount
]
=
useState
({});
const
[
shut
,
setshut
]
=
useState
(
false
);
const
{
initialState
:
{
menuNum
},
setInitialState
,
}
=
useModel
(
"@@initialState"
);
let
{
STUDY_TRAIN_LIST
}
=
menuNum
??
{};
useEffect
(()
=>
{
if
(
!
STUDY_TRAIN_LIST
)
{
return
;
}
setNumcount
((
s
)
=>
({
...
s
,
[
STUDY_TRAIN_LIST
.
id
]:
STUDY_TRAIN_LIST
?.
unReadMsgCount
,
}));
},
[
STUDY_TRAIN_LIST
]);
let
num
=
Numcount
?.[
trainId
]
??
unReadMsgCount
;
return
(
<
Card
sx=
{
{
borderRadius
:
3
}
}
className=
"hovered"
id=
"jikl"
>
<
div
style=
{
{
width
:
24
,
height
:
24
,
backgroundColor
:
"#ff4800"
,
position
:
"absolute"
,
right
:
6
,
top
:
6
,
zIndex
:
999
,
borderRadius
:
30
,
color
:
"#fff"
,
fontSize
:
12
,
display
:
!
num
?
"none"
:
"flex"
,
}
}
className=
"center"
>
{
num
>
100
?
"99+"
:
num
}
</
div
>
<
Box
sx=
{
{
pt
:
"66%"
,
position
:
"relative"
}
}
className=
"center"
>
{
typeName
&&
(
<
Label
...
...
src/layouts/dashboard/nav/index.jsx
View file @
bc3f7250
...
...
@@ -28,7 +28,7 @@ export default function Nav({ openNav, onCloseNav }) {
const
[
navConfigs
,
setNavConfigs
]
=
useState
(
navConfig
);
const
{
initialState
:
{
nav
,
currentUser
,
menuNum
},
initialState
:
{
nav
,
currentUser
,
menuNum
},
setInitialState
,
}
=
useModel
(
"@@initialState"
);
...
...
@@ -50,55 +50,58 @@ export default function Nav({ openNav, onCloseNav }) {
});
useEffect
(()
=>
{
if
(
!
data
)
{
return
if
(
!
data
)
{
return
;
}
setNavConfigs
((
s
)
=>
{
let
news
=
navConfig
?.
map
((
it
)
=>
{
return
{
...
it
,
children
:
it
?.
children
?.
map
((
item
,
i
)
=>
{
const
info
=
menuNum
?.[
item
?.
key
??
""
]?
{
info
:
(
<
div
style=
{
{
marginRight
:
12
,
backgroundColor
:
"#ff4800"
,
width
:
20
,
height
:
20
,
textAlign
:
"center"
,
lineHeight
:
"20px"
,
color
:
"#fff"
,
borderRadius
:
12
,
fontSize
:
12
,
}
}
>
{
menuNum
[
item
?.
key
??
""
]
}
</
div
>
),
}
:
data
[
item
?.
key
??
""
]
?
{
info
:
(
<
div
style=
{
{
marginRight
:
12
,
backgroundColor
:
"#ff4800"
,
width
:
20
,
height
:
20
,
textAlign
:
"center"
,
lineHeight
:
"20px"
,
color
:
"#fff"
,
borderRadius
:
12
,
fontSize
:
12
,
}
}
>
{
data
[
item
?.
key
]
}
</
div
>
),
}
:
{};
const
info
=
menuNum
?.[
item
?.
key
??
""
]
===
0
?
{}
:
menuNum
?.[
item
?.
key
??
""
]
?
{
info
:
(
<
div
style=
{
{
marginRight
:
12
,
backgroundColor
:
"#ff4800"
,
width
:
20
,
height
:
20
,
textAlign
:
"center"
,
lineHeight
:
"20px"
,
color
:
"#fff"
,
borderRadius
:
12
,
fontSize
:
12
,
}
}
>
{
menuNum
[
item
?.
key
??
""
]
}
</
div
>
),
}
:
data
[
item
?.
key
??
""
]
?
{
info
:
(
<
div
style=
{
{
marginRight
:
12
,
backgroundColor
:
"#ff4800"
,
width
:
20
,
height
:
20
,
textAlign
:
"center"
,
lineHeight
:
"20px"
,
color
:
"#fff"
,
borderRadius
:
12
,
fontSize
:
12
,
}
}
>
{
data
[
item
?.
key
]
}
</
div
>
),
}
:
{};
return
{
...
item
,
...
info
,
...
...
@@ -120,7 +123,7 @@ export default function Nav({ openNav, onCloseNav }) {
});
}
});
},
[
data
,
currentUser
?.
type
,
menuNum
]);
},
[
data
,
currentUser
?.
type
,
menuNum
]);
useEffect
(()
=>
{
if
(
openNav
)
{
...
...
src/pages/dobustrain/index.jsx
View file @
bc3f7250
...
...
@@ -349,7 +349,7 @@ function Dolessons() {
{
key
:
"4"
,
label
:
"在线沟通"
,
children
:
<
OnlineChat
trainId=
{
params
?.
id
}
></
OnlineChat
>,
children
:
active
==
"4"
&&
<
OnlineChat
trainId=
{
params
?.
id
}
></
OnlineChat
>,
},
];
...
...
src/pages/domybustrain/index.jsx
View file @
bc3f7250
...
...
@@ -270,7 +270,7 @@ function Dolessons() {
{
key
:
"4"
,
label
:
"在线沟通"
,
children
:
<
OnlineChat
trainId=
{
params
?.
id
}
></
OnlineChat
>,
children
:
active
==
"4"
&&
<
OnlineChat
trainId=
{
params
?.
id
}
></
OnlineChat
>,
},
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment