Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend
Project
Project
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
Schedules
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
h5-communicate
frontend
Commits
c36fc4a1
Commit
c36fc4a1
authored
Jun 08, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
3da7408a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
29 deletions
+40
-29
workspace.xml
.idea/workspace.xml
+0
-0
index.jsx
src/components/LogCard/index.jsx
+4
-4
CommonLayout.jsx
src/layout/CommonLayout.jsx
+12
-22
Backlog.jsx
src/pages/Backlog/Backlog.jsx
+24
-3
No files found.
.idea/workspace.xml
View file @
c36fc4a1
This diff is collapsed.
Click to expand it.
src/components/LogCard/index.jsx
View file @
c36fc4a1
...
...
@@ -12,9 +12,9 @@ const Index = (props) => {
className=
"todo-tag-png"
src=
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591252471425&di=85236ae603ca74553adaca6e8c161a39&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fb912bf96dc19b3b23530ae2259b60eb6cf70083f6680b-H9l0ri_fw658"
/>
收文管理
{
props
.
TYPE
}
</
div
>
<
p
>
《2020年上级党委文件7号》
</
p
>
<
p
>
{
props
.
TITLE
}
</
p
>
</
div
>
<
span
>
<
img
...
...
@@ -25,8 +25,8 @@ const Index = (props) => {
</
span
>
</
div
>
<
div
className=
"todo-content"
>
<
p
>
当前状态:
排版套头
</
p
>
<
p
style=
{
{
marginTop
:
15
}
}
>
发送人员:
杜莹莹
</
p
>
<
p
>
当前状态:
{
props
.
STATUS
}
</
p
>
<
p
style=
{
{
marginTop
:
15
}
}
>
发送人员:
{
props
.
FROMUSER_ALIASED
}
</
p
>
</
div
>
<
div
className=
"todo-footer"
>
<
div
>
...
...
src/layout/CommonLayout.jsx
View file @
c36fc4a1
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
Footer
from
'./Footer'
import
{
withRouter
}
from
'react-router-dom'
import
'./index.less'
class
CommonLayout
extends
Component
{
constructor
(){
super
();
this
.
resize
=
this
.
resize
.
bind
(
this
)
}
resize
=
(
defaultH
)
=>
{
const
CommonLayout
=
(
props
)
=>
{
const
resize
=
(
defaultH
)
=>
{
const
scrollHeight
=
document
.
body
.
scrollHeight
;
const
footer
=
document
.
getElementById
(
"footer"
);
const
content
=
document
.
getElementById
(
"common-content"
)
...
...
@@ -34,30 +30,24 @@ class CommonLayout extends Component {
}
// alert(`defaultH: ${defaultH} clientHeight: ${scrollHeight}`);
}
componentWillMount
()
{
};
useEffect
(()
=>
{
const
defaultH
=
document
.
body
.
scrollHeight
;
window
.
addEventListener
(
'resize'
,
()
=>
this
.
resize
(
defaultH
))
}
componentWillUnmount
()
{
window
.
addEventListener
(
'resize'
,
this
.
resize
)
}
render
()
{
window
.
addEventListener
(
'resize'
,
()
=>
resize
(
defaultH
));
return
()
=>
window
.
removeEventListener
(
'resize'
,
resize
);
},
[])
return
(
<
div
>
<
div
id=
"common-content"
className=
"common-layout-content"
>
<
div
>
{
this
.
props
.
children
}
{
props
.
children
}
</
div
>
</
div
>
<
Footer
{
...
this
.
props
}
/>
<
Footer
{
..
.
props
}
/>
</
div
>
);
}
}
};
export
default
withRouter
(
CommonLayout
)
;
src/pages/Backlog/Backlog.jsx
View file @
c36fc4a1
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
WhiteSpace
,
WingBlank
,
ActivityIndicator
}
from
'antd-mobile'
import
TodoCard
from
'../../components/LogCard'
import
TopSearch
from
'../../components/TopSearch'
const
Backlog
=
(
props
)
=>
{
const
[
current
,
setCurrent
]
=
useState
()
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
data
,
setData
]
=
useState
([{},{},{},{},{},{}]);
const
checkLog
=
()
=>
{
props
.
history
.
push
(
`/blank/info/example/1`
)
};
//下拉加载
const
handleScroll
=
()
=>
{
const
event
=
document
.
getElementById
(
"common-content"
)
const
top
=
event
.
scrollTop
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
console
.
log
(
top
,
scrollHeight
,
clientHeight
);
if
(
top
+
clientHeight
===
scrollHeight
)
{
setData
([...
data
,
{},
{},
{},
{},
{},
{}])
// setCurrent(current + 1)
}
};
useEffect
(()
=>
{
window
.
addEventListener
(
'scroll'
,
handleScroll
,
true
);
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
},
[])
return
(
<
WingBlank
>
<
ActivityIndicator
...
...
@@ -20,7 +41,7 @@ const Backlog = (props) => {
<
WhiteSpace
/>
<
TopSearch
onSearch=
{
val
=>
console
.
log
(
val
)
}
/>
{
[{},{},{},{},{},{}]
.
map
((
item
,
index
)
=>
(
data
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
>
<
WhiteSpace
/>
<
TodoCard
data=
{
item
}
onClick=
{
checkLog
}
/>
...
...
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