Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
e7202770
Commit
e7202770
authored
May 15, 2021
by
chenshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:初始化
parent
64c4f679
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
13 deletions
+55
-13
src/core/function.js
+1
-0
src/core/global.less
+0
-1
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
+21
-5
src/modules/course-manage/offline-course/components/OfflineCourseList.jsx
+7
-2
src/modules/course-manage/offline-course/components/OfflineCourseList.less
+2
-2
src/modules/course-manage/offline-course/index.jsx
+1
-1
src/modules/course-manage/offline-course/modal/QRCodeModal.jsx
+22
-1
src/routes/config/menuList.tsx
+1
-1
No files found.
src/core/function.js
View file @
e7202770
...
...
@@ -6,6 +6,7 @@
import
domtoimage
from
'dom-to-image'
import
{
Popover
}
from
'antd'
import
React
from
'react'
import
$
from
'jquery'
;
// 时间控件优化方法
window
.
setCorrectDate
=
date
=>
{
...
...
src/core/global.less
View file @
e7202770
...
...
@@ -1305,7 +1305,6 @@ input:focus {
.ant-modal-content {
.ant-modal-body {
min-height: 130px;
max-height: 600px;
overflow: auto;
// padding-top:0px!important;
.xm-page-control {
...
...
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
View file @
e7202770
...
...
@@ -954,10 +954,10 @@ class AddOfflineCourse extends React.Component {
<
span
className=
"switch-label"
>
报名日期:
</
span
>
<
RangePicker
id=
"course_date_picker"
showTime=
{
true
}
showTime=
{
{
showTime
:
'HH:mm'
}
}
allowClear=
{
false
}
value=
{
startTimeApply
?
[
moment
(
startTimeApply
),
moment
(
endTimeApply
)]
:
null
}
format=
{
"YYYY-MM-DD"
}
format=
{
"YYYY-MM-DD
HH:mm
"
}
onChange=
{
(
dates
)
=>
{
this
.
handleChangeDates
(
dates
)
}
}
style=
{
{
width
:
"calc(100% - 70px)"
}
}
/>
...
...
@@ -968,7 +968,8 @@ class AddOfflineCourse extends React.Component {
value=
{
quota
}
style=
{
{
margin
:
'0 4px'
}
}
onChange=
{
(
value
)
=>
{
this
.
setState
({
quota
:
value
})
const
number
=
(
value
+
''
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
quota
:
number
})
}
}
/>
<
span
className=
"switch-label"
>
人
</
span
>
...
...
@@ -988,7 +989,7 @@ class AddOfflineCourse extends React.Component {
style=
{
{
display
:
'inline-block'
}
}
value=
{
signInType
}
onChange=
{
(
e
)
=>
{
this
.
setState
({
offlineCourse
Type
:
e
.
target
.
value
});
this
.
setState
({
signIn
Type
:
e
.
target
.
value
});
}
}
className=
"mt5"
>
...
...
@@ -1006,7 +1007,8 @@ class AddOfflineCourse extends React.Component {
value=
{
signInTimeNum
}
style=
{
{
margin
:
'0 4px'
}
}
onChange=
{
(
value
)
=>
{
this
.
setState
({
signInTimeNum
:
value
});
const
number
=
(
value
+
''
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
signInTimeNum
:
number
});
}
}
/>
<
Select
...
...
@@ -1054,10 +1056,17 @@ class AddOfflineCourse extends React.Component {
<
InputNumber
value=
{
signOutStartTimeNum
}
style=
{
{
margin
:
'0 4px'
}
}
onChange=
{
(
value
)
=>
{
const
number
=
(
value
+
''
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
signOutStartTimeNum
:
number
});
}
}
/>
<
Select
style=
{
{
width
:
72
,
marginRight
:
4
}
}
value=
{
signOutStartTimeUnit
}
onChange=
{
(
value
)
=>
{
this
.
setState
({
signOutStartTimeUnit
:
value
});
}
}
>
{
unitList
.
map
(
item
=>
(
<
Option
value=
{
item
.
key
}
key=
{
item
.
key
}
>
{
item
.
value
}
</
Option
>
...
...
@@ -1067,10 +1076,17 @@ class AddOfflineCourse extends React.Component {
<
InputNumber
value=
{
signOutEndTimeNum
}
style=
{
{
margin
:
'0 4px'
}
}
onChange=
{
(
value
)
=>
{
const
number
=
(
value
+
''
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
signOutEndTimeNum
:
number
});
}
}
/>
<
Select
style=
{
{
width
:
72
,
marginRight
:
4
}
}
value=
{
signOutEndTimeUnit
}
onChange=
{
(
value
)
=>
{
this
.
setState
({
signOutEndTimeUnit
:
value
});
}
}
>
{
unitList
.
map
(
item
=>
(
<
Option
value=
{
item
.
key
}
key=
{
item
.
key
}
>
{
item
.
value
}
</
Option
>
...
...
src/modules/course-manage/offline-course/components/OfflineCourseList.jsx
View file @
e7202770
...
...
@@ -69,6 +69,7 @@ class OfflineCourseList extends React.Component {
render
:
(
val
,
record
)
=>
{
const
{
courseMediaVOS
,
courseName
,
offlinePlace
,
calendarTime
,
startTime
,
endTime
}
=
record
;
const
coverUrl
=
(
_
.
find
(
courseMediaVOS
,
data
=>
data
.
contentType
===
'COVER'
)
||
{}).
mediaUrl
;
const
time
=
`
${
calendarTime
.
map
(
item
=>
moment
(
item
).
format
(
'MM-DD'
)).
join
(
'、'
)}
${
moment
(
startTime
).
format
(
'HH:mm'
)}
~
${
moment
(
endTime
).
format
(
'HH:mm'
)}
`
;
return
(
<
div
className=
"record__item"
>
<
img
className=
"course-cover"
src=
{
coverUrl
||
defaultCoverUrl
}
/>
...
...
@@ -76,8 +77,12 @@ class OfflineCourseList extends React.Component {
<
Tooltip
title=
{
courseName
}
>
<
div
className=
"course-name"
>
{
courseName
}
</
div
>
</
Tooltip
>
<
div
className=
"course-text"
>
地点:
{
offlinePlace
}
</
div
>
<
div
className=
"course-text"
>
{
calendarTime
.
map
(
item
=>
moment
(
item
).
format
(
'MM-DD'
)).
join
(
'、'
)
}
{
moment
(
startTime
).
format
(
'HH:mm'
)
}
~
{
moment
(
endTime
).
format
(
'HH:mm'
)
}
</
div
>
<
Tooltip
title=
{
`地点:${offlinePlace}`
}
>
<
div
className=
"course-text"
>
地点:
{
offlinePlace
}
</
div
>
</
Tooltip
>
<
Tooltip
title=
{
time
}
>
<
div
className=
"course-text"
>
{
time
}
</
div
>
</
Tooltip
>
</
div
>
</
div
>
)
...
...
src/modules/course-manage/offline-course/components/OfflineCourseList.less
View file @
e7202770
...
...
@@ -65,7 +65,7 @@
.course-name {
color: #333;
max-width:
262px
;
max-width:
~'calc(100% - 32px)'
;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
...
...
@@ -76,7 +76,7 @@
.course-text {
color: #666;
max-width:
262px
;
max-width:
~'calc(100% - 32px)'
;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
...
...
src/modules/course-manage/offline-course/index.jsx
View file @
e7202770
...
...
@@ -58,7 +58,7 @@ class OfflineCoursePage extends React.Component {
/>
{
/* 操作模块 */
}
<
OfflineCourseOpt
/>
{
window
.
ctx
.
xmState
.
storeUserPermissionList
.
includes
(
'AddOfflineClass'
)
&&
<
OfflineCourseOpt
/>
}
{
/* 线下课列表模块 */
}
<
OfflineCourseList
...
...
src/modules/course-manage/offline-course/modal/QRCodeModal.jsx
View file @
e7202770
import
React
from
'react'
;
import
{
Button
,
Modal
,
Select
}
from
'antd'
;
import
moment
from
'moment'
;
import
html2canvas
from
'html2canvas'
;
import
{
LIVE_SHARE
}
from
"@/domains/course-domain/constants"
;
import
QRCode
from
'../../../../libs/qrcode/qrcode'
;
import
User
from
'@/common/js/user'
;
...
...
@@ -30,7 +31,6 @@ export default class QRCodeModal extends React.Component {
if
(
data
.
whetherSetSignIn
===
'YES'
)
{
const
qrcodeWrapDom
=
document
.
querySelector
(
'#qrcodeWrap1'
);
const
htmlUrl
=
`
${
LIVE_SHARE
}
sign_in?id=
${
User
.
getCustomerStoreId
()
||
User
.
getStoreId
()}
&userId=
${
User
.
getUserId
()}
&calendar=
${
selectedDate
}
&courseId=
${
data
.
courseId
}
&from=work_weixin`
;
console
.
log
(
htmlUrl
,
666666
)
Service
.
Sales
(
'public/businessShow/convertShortUrls'
,
{
urls
:
[
htmlUrl
]
}).
then
((
res
)
=>
{
...
...
@@ -79,6 +79,24 @@ export default class QRCodeModal extends React.Component {
});
}
downloadQRCode
=
()
=>
{
const
domList
=
document
.
querySelectorAll
(
'.image-box'
);
for
(
let
index
=
0
;
index
<
domList
.
length
;
index
++
)
{
const
dom
=
domList
[
index
];
html2canvas
(
dom
,
{
useCORS
:
true
,
}).
then
(
canvas
=>
{
this
.
downloadImg
(
canvas
,
'二维码'
);
});
}
}
downloadImg
=
(
canvas
,
type
)
=>
{
const
dataUrl
=
canvas
.
toDataURL
(
'image/png'
);
const
fileName
=
`
${
type
}
.png`
;
window
.
downloadFile
(
dataUrl
,
fileName
);
}
render
()
{
const
{
visible
,
onCancel
}
=
this
.
props
;
const
{
selectedDate
,
data
=
{}
}
=
this
.
state
;
...
...
@@ -110,6 +128,9 @@ export default class QRCodeModal extends React.Component {
<
Button
type=
"primary"
style=
{
{
marginLeft
:
8
}
}
onClick=
{
()
=>
{
this
.
downloadQRCode
();
}
}
>
下载二维码
</
Button
>
</
div
>
{
whetherSetSignIn
===
'YES'
&&
<
div
className=
"image-box"
>
...
...
src/routes/config/menuList.tsx
View file @
e7202770
...
...
@@ -35,7 +35,7 @@ export const menuList: any = [
},
{
groupName
:
"线下课"
,
groupCode
:
"
GraphicLesson
"
,
groupCode
:
"
OfflineClass
"
,
link
:
'/offline-course'
},
]
...
...
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