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
f124542a
Commit
f124542a
authored
Jun 08, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
c36fc4a1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
32 deletions
+58
-32
workspace.xml
.idea/workspace.xml
+0
-0
Backlog.jsx
src/pages/Backlog/Backlog.jsx
+17
-5
Notice.jsx
src/pages/Notice/Notice.jsx
+41
-3
Work.jsx
src/pages/Work/Work.jsx
+0
-24
No files found.
.idea/workspace.xml
View file @
f124542a
This diff is collapsed.
Click to expand it.
src/pages/Backlog/Backlog.jsx
View file @
f124542a
...
...
@@ -4,7 +4,8 @@ import TodoCard from '../../components/LogCard'
import
TopSearch
from
'../../components/TopSearch'
const
Backlog
=
(
props
)
=>
{
const
[
current
,
setCurrent
]
=
useState
()
const
[
current
,
setCurrent
]
=
useState
(
1
);
const
[
searchWord
,
setSearchWord
]
=
useState
()
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -13,6 +14,13 @@ const Backlog = (props) => {
const
checkLog
=
()
=>
{
props
.
history
.
push
(
`/blank/info/example/1`
)
};
const
getData
=
()
=>
{
setLoading
(
false
)
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
}
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
setData
(
result
)
setCurrent
(
current
+
1
)
};
//下拉加载
const
handleScroll
=
()
=>
{
...
...
@@ -20,15 +28,19 @@ const Backlog = (props) => {
const
top
=
event
.
scrollTop
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
console
.
log
(
top
,
scrollHeight
,
clientHeight
);
if
(
top
+
clientHeight
===
scrollHeight
)
{
set
Data
([...
data
,
{},
{},
{},
{},
{},
{}])
// setCurrent(current + 1
)
set
Loading
(
true
);
getData
(
)
}
};
useEffect
(()
=>
{
window
.
addEventListener
(
'scroll'
,
handleScroll
,
true
);
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
},
[
data
]);
useEffect
(()
=>
{
const
element
=
document
.
getElementById
(
'common-content'
)
element
.
scrollTo
(
0
,
0
)
},
[])
return
(
...
...
@@ -39,7 +51,7 @@ const Backlog = (props) => {
animating=
{
loading
}
/>
<
WhiteSpace
/>
<
TopSearch
onSearch=
{
val
=>
console
.
log
(
val
)
}
/>
<
TopSearch
onSearch=
{
setSearchWord
}
/>
{
data
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
>
...
...
src/pages/Notice/Notice.jsx
View file @
f124542a
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
import
TodoCard
from
'../../components/LogCard'
import
TopNotice
from
'../../components/NoticeTab'
const
Notice
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
current
,
setCurrent
]
=
useState
(
1
);
const
[
searchWord
,
setSearchWord
]
=
useState
()
const
[
data
,
setData
]
=
useState
([{},{},{},{},{},{}]);
const
getData
=
()
=>
{
setLoading
(
false
)
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
}
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
setData
(
result
)
setCurrent
(
current
+
1
)
};
//下拉加载
const
handleScroll
=
()
=>
{
const
event
=
document
.
getElementById
(
"common-content"
)
const
top
=
event
.
scrollTop
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
if
(
top
+
clientHeight
===
scrollHeight
)
{
setLoading
(
true
);
getData
()
}
};
useEffect
(()
=>
{
window
.
addEventListener
(
'scroll'
,
handleScroll
,
true
);
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
},
[
data
]);
const
checkLog
=
()
=>
{
props
.
history
.
push
(
`/blank/info/example/1`
)
};
return
(
<
WingBlank
>
<
ActivityIndicator
...
...
@@ -15,8 +46,15 @@ const Notice = (props) => {
/>
<
WhiteSpace
/>
<
TopNotice
/>
{
data
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
>
<
WhiteSpace
/>
<
TodoCard
/>
<
TodoCard
data=
{
item
}
onClick=
{
checkLog
}
/>
</
div
>
))
}
</
WingBlank
>
);
};
...
...
src/pages/Work/Work.jsx
View file @
f124542a
...
...
@@ -31,21 +31,6 @@ const Work = () => {
// index > -1 && arr.splice(index, 1);
};
//测试数据
const
data222
=
Array
.
from
(
new
Array
(
7
)).
map
((
_val
,
i
)
=>
({
id
:
`name
${
i
}
`
,
icon
:
'/img/test/test.png'
,
text
:
`name
${
i
}
`
,
}));
const
data22222
=
Array
.
from
(
new
Array
(
7
)).
map
((
_val
,
i
)
=>
({
id
:
`name2
${
i
}
`
,
icon
:
'/img/test/test-1.png'
,
text
:
`name
${
i
}
`
,
}));
console
.
log
(
data
);
return
(
<
WingBlank
>
<
ActivityIndicator
...
...
@@ -56,15 +41,6 @@ const Work = () => {
<
WhiteSpace
/>
<
TopSearch
onSearch=
{
workSearch
}
/>
<
WhiteSpace
/>
<
WorkCard
type=
"edit"
title=
"常用板块"
addCommon=
{
commonEdit
}
addStatus=
{
addStatus
}
data=
{
data222
}
iconAction=
{
itemSlice
}
/>
<
WhiteSpace
/>
<
WorkCard
title=
"事物管理"
addCommon=
{
commonEdit
}
...
...
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