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
d822ce8e
Commit
d822ce8e
authored
Jun 06, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
73212b01
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
workspace.xml
.idea/workspace.xml
+0
-0
index.jsx
src/components/TopTabs/index.jsx
+6
-5
Process.jsx
src/pages/EventProcessing/Process.jsx
+33
-22
No files found.
.idea/workspace.xml
View file @
d822ce8e
This diff is collapsed.
Click to expand it.
src/components/TopTabs/index.jsx
View file @
d822ce8e
...
...
@@ -3,19 +3,20 @@ import {Tabs} from 'antd-mobile'
import
'./index.less'
const
tabs
=
[
{
title
:
'基本信息'
,
sub
:
'basic'
},
{
title
:
'详情附件'
,
sub
:
'adjunct'
},
{
title
:
'流程信息'
,
sub
:
'flow'
},
{
title
:
'流转意见'
,
sub
:
'option'
},
{
title
:
'基本信息'
,
key
:
'basic'
},
{
title
:
'详情附件'
,
key
:
'adjunct'
},
{
title
:
'流程信息'
,
key
:
'flow'
},
{
title
:
'流转意见'
,
key
:
'option'
},
]
const
Index
=
(
props
)
=>
{
return
(
<
div
>
<
Tabs
page=
{
props
.
page
}
tabs=
{
tabs
}
initialPage=
{
"basic"
}
onChange=
{
(
tab
,
index
)
=>
props
.
onClick
(
tab
.
sub
)
}
onChange=
{
(
tab
,
index
)
=>
props
.
onClick
(
tab
.
key
,
index
)
}
/>
</
div
>
);
...
...
src/pages/EventProcessing/Process.jsx
View file @
d822ce8e
...
...
@@ -20,17 +20,17 @@ class Process extends Component {
constructor
()
{
super
();
this
.
optionBlur
=
this
.
optionBlur
.
bind
(
this
)
//
this.handleScroll = this.handleScroll.bind(this)
this
.
handleScroll
=
this
.
handleScroll
.
bind
(
this
)
this
.
state
=
{
current
:
'basic'
,
disabled
:
true
,
footStatus
:
false
,
footButton
:
'处理'
}
};
componentDidMount
()
{
// console.log(document.getElementsByClassName("option-text")[0])
document
.
getElementsByClassName
(
"option-text"
)[
0
].
addEventListener
(
'focus'
,
this
.
optionBlur
,
true
)
//
window.addEventListener('scroll', this.handleScroll, true);
window
.
addEventListener
(
'scroll'
,
this
.
handleScroll
,
true
);
}
optionBlur
=
()
=>
{
this
.
setState
({
footButton
:
'确认发送'
,
footStatus
:
true
})
...
...
@@ -38,25 +38,36 @@ class Process extends Component {
componentWillUnmount
()
{
document
.
getElementsByClassName
(
"option-text"
)[
0
].
removeEventListener
(
'focus'
,
this
.
optionBlur
,
true
)
//
window.removeEventListener('scroll', this.handleScroll, true);
window
.
removeEventListener
(
'scroll'
,
this
.
handleScroll
,
true
);
}
// handleScroll() {
// const basic = document.getElementById("event-basic").offsetTop;
// const adjunct = document.getElementById("event-adjunct").offsetTop;
// const flow = document.getElementById("event-flow").offsetTop;
// const option = document.getElementById("event-option").offsetTop;
// const top = document.documentElement.scrollTop;
//
// console.log(top)
//
// // console.log(basic, adjunct, flow, option);
// };
handleScroll
()
{
const
adjunct
=
document
.
getElementById
(
"event-adjunct"
).
offsetTop
;
const
flow
=
document
.
getElementById
(
"event-flow"
).
offsetTop
;
const
option
=
document
.
getElementById
(
"event-option"
).
offsetTop
;
const
event
=
document
.
getElementById
(
'event'
);
const
top
=
event
.
scrollTop
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
if
(
top
>=
0
&&
top
<
adjunct
-
9
)
{
this
.
setState
({
current
:
'basic'
})
}
else
if
(
top
>=
adjunct
&&
top
<
flow
-
9
)
{
this
.
setState
({
current
:
'adjunct'
})
}
else
if
(
top
>=
flow
&&
top
<
option
-
9
)
{
this
.
setState
({
current
:
'flow'
})
}
else
if
(
top
>=
option
)
{
this
.
setState
({
current
:
'option'
})
}
if
(
top
+
clientHeight
==
scrollHeight
)
{
this
.
setState
({
current
:
'option'
})
}
};
tabClick
=
(
name
)
=>
{
// console.log(document.getElementsByClassName("option-text")
)
this
.
setState
({
current
:
name
}
)
name
===
'option'
&&
document
.
getElementsByClassName
(
"option-text"
)[
0
].
focus
();
name
===
'option'
&&
this
.
optionBlur
()
const
top
=
document
.
getElementById
(
`event-
${
name
}
`
).
offsetTop
;
document
.
getElementById
(
"event"
).
scrollTo
(
0
,
top
-
9
)
document
.
getElementById
(
"event"
).
scrollTo
(
0
,
top
-
9
)
;
};
textClick
=
()
=>
{
const
top
=
document
.
getElementById
(
`event-option`
).
offsetTop
;
...
...
@@ -74,7 +85,7 @@ class Process extends Component {
wrapProps
,
},
(
buttonIndex
)
=>
{
console
.
log
(
buttonIndex
)
//
console.log(buttonIndex)
});
};
optionChange
=
val
=>
{
...
...
@@ -82,11 +93,11 @@ class Process extends Component {
}
render
()
{
console
.
log
(
this
.
props
.
match
.
params
);
const
{
footButton
,
disabled
,
footStatus
}
=
this
.
state
console
.
log
(
this
.
state
.
current
);
const
{
footButton
,
disabled
,
footStatus
,
current
}
=
this
.
state
return
(
<
div
>
<
TopTabs
onClick=
{
this
.
tabClick
}
/>
<
TopTabs
page=
{
current
}
onClick=
{
this
.
tabClick
}
/>
<
div
id=
"event"
>
<
WingBlank
>
<
WhiteSpace
/>
...
...
@@ -104,7 +115,7 @@ class Process extends Component {
{
!
footStatus
&&
(
<
img
alt=
""
src=
"/img/process-edit.png"
className=
"process-edit"
/>
)
}
{
this
.
state
.
footButton
}
{
footButton
}
</
div
>
</
div
>
...
...
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