Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
2b3e9680
Commit
2b3e9680
authored
Nov 02, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新popup通用组件
parent
0814d87a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
65 deletions
+55
-65
src/common/closable-popup/index.js
+33
-38
src/components/blessingPreheat/index.js
+0
-0
src/components/blessingPreheat/live/index.js
+4
-11
src/components/blessingPreheat/live/index.scss
+18
-16
No files found.
src/common/closable-popup/index.js
View file @
2b3e9680
import
React
,
{
Component
}
from
'react'
import
React
from
'react'
import
ReactDOM
from
'react-dom'
import
'./index.scss'
import
'./index.scss'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
propTypes
from
'prop-types'
class
ClosablePopup
extends
Component
{
function
ClosablePopup
({
title
,
content
,
className
,
closable
=
true
,
close
=
function
()
{
state
=
{
visible
:
this
.
props
.
visible
}
}
}
=
{})
{
close
=
()
=>
{
function
unmountComponent
()
{
const
{
close
}
=
this
.
props
ReactDOM
.
unmountComponentAtNode
(
div
)
close
?
close
()
:
this
.
setState
({
visible
:
false
})
if
(
div
&&
div
.
parentNode
)
{
div
.
parentNode
.
removeChild
(
div
)
}
}
}
componentDidUpdate
(
prevProps
,
prevState
)
{
function
_close
(
)
{
const
{
visible
}
=
this
.
props
let
_c
=
close
()
if
(
prevState
.
visible
!==
this
.
props
.
visible
)
{
if
(
_c
&&
_c
.
then
)
{
this
.
setState
(
{
_c
.
then
(()
=>
{
visible
unmountComponent
()
})
})
}
else
{
unmountComponent
()
}
}
}
}
render
()
{
const
closablePopup
=
(
const
{
title
,
className
,
children
,
closable
=
true
}
=
this
.
props
<
div
className
=
{
'closable-popup-mask'
}
>
return
(
<
div
className
=
{
classnames
([
'popup-container'
,
className
])}
>
this
.
state
.
visible
<
div
className
=
"title"
>
{
title
}
<
/div
>
?
<
div
className
=
"content"
>
<
div
className
=
{
'closable-popup-mask'
}
>
{
content
}
<
div
className
=
{
classnames
([
'popup-container'
,
className
])}
>
<
div
className
=
"title"
>
{
title
}
<
/div
>
<
div
className
=
"content"
>
{
children
}
<
/div
>
{
closable
&&
<
i
className
=
{
'close iconfont iconiconfront-2'
}
onClick
=
{
this
.
close
}
/
>
}
<
/div
>
<
/div
>
<
/div
>
:
null
{
)
closable
&&
<
i
className
=
{
'close iconfont iconiconfront-2'
}
onClick
=
{
_close
}
/
>
}
}
}
<
/div
>
<
/div
>
)
const
div
=
document
.
createElement
(
'div'
)
document
.
body
.
appendChild
(
div
)
ClosablePopup
.
propTypes
=
{
ReactDOM
.
render
(
closablePopup
,
div
)
title
:
propTypes
.
string
.
isRequired
,
visible
:
propTypes
.
bool
,
closable
:
propTypes
.
string
,
close
:
propTypes
.
func
}
}
export
default
ClosablePopup
export
default
ClosablePopup
src/components/blessingPreheat/index.js
View file @
2b3e9680
This diff is collapsed.
Click to expand it.
src/components/blessingPreheat/live/index.js
View file @
2b3e9680
...
@@ -16,8 +16,6 @@ class Live extends Component {
...
@@ -16,8 +16,6 @@ class Live extends Component {
tabs
:
[],
tabs
:
[],
lives
:
{},
lives
:
{},
preheatLives
:
[],
preheatLives
:
[],
visible
:
false
,
qrcode
:
''
,
today
:
''
,
today
:
''
,
isApp
:
getParam
(
'version'
)
isApp
:
getParam
(
'version'
)
}
}
...
@@ -80,9 +78,9 @@ class Live extends Component {
...
@@ -80,9 +78,9 @@ class Live extends Component {
const
{
data
}
=
res
const
{
data
}
=
res
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
QRCode
.
toDataURL
(
data
.
data
.
url
,
(
err
,
url
)
=>
{
QRCode
.
toDataURL
(
data
.
data
.
url
,
(
err
,
url
)
=>
{
this
.
setState
({
Popup
({
qrcode
:
url
,
title
:
'扫码关注“七月在线”服务号即可预约'
,
visible
:
true
content
:
<
img
id
=
{
'live-qr-code'
}
src
=
{
url
}
alt
=
""
/>
})
})
})
})
}
else
{
}
else
{
...
@@ -92,14 +90,9 @@ class Live extends Component {
...
@@ -92,14 +90,9 @@ class Live extends Component {
}
}
render
()
{
render
()
{
const
{
tabs
,
lives
,
visible
,
qrcode
,
preheatLives
,
today
}
=
this
.
state
const
{
tabs
,
lives
,
preheatLives
,
today
}
=
this
.
state
return
(
return
(
<
div
id
=
{
'live'
}
>
<
div
id
=
{
'live'
}
>
<
Popup
title
=
{
'扫码关注“七月在线”服务号即可预约'
}
visible
=
{
visible
}
>
<
img
id
=
{
'live-qr-code'
}
src
=
{
qrcode
}
alt
=
""
/>
<
/Popup
>
<
div
className
=
"title"
>
<
div
className
=
"title"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-left.png"
alt
=
""
/>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-left.png"
alt
=
""
/>
<
span
>
大咖直播
<
/span
>
<
span
>
大咖直播
<
/span
>
...
...
src/components/blessingPreheat/live/index.scss
View file @
2b3e9680
#live
{
#live
{
margin-top
:
30px
;
margin-top
:
30px
;
.title
{
.title
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
...
@@ -175,22 +176,6 @@
...
@@ -175,22 +176,6 @@
}
}
.popup-container
{
.title
{
color
:
#525C65
;
}
.content
{
display
:
flex
;
justify-content
:
center
;
img
{
width
:
120px
;
height
:
120px
;
}
}
}
.am-tabs
{
.am-tabs
{
width
:
330px
;
width
:
330px
;
margin
:
0
auto
;
margin
:
0
auto
;
...
@@ -234,3 +219,20 @@
...
@@ -234,3 +219,20 @@
}
}
}
}
.popup-container
{
.title
{
color
:
#525C65
;
}
.content
{
display
:
flex
;
justify-content
:
center
;
img
{
width
:
120px
;
height
:
120px
;
}
}
}
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