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
426dd49b
Commit
426dd49b
authored
Jun 04, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
6095eb88
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
171 additions
and
77 deletions
+171
-77
vcs.xml
.idea/vcs.xml
+7
-0
workspace.xml
.idea/workspace.xml
+0
-0
config-overrides.js
config-overrides.js
+13
-4
index.less
src/Components/TopNotice/index.less
+1
-1
index.jsx
src/Components/TopSearch/index.jsx
+7
-2
CardItem.jsx
src/Components/WorkCard/CardItem.jsx
+27
-14
index.jsx
src/Components/WorkCard/index.jsx
+39
-33
index.less
src/Components/WorkCard/index.less
+41
-12
Work.jsx
src/Pages/Work/Work.jsx
+36
-11
No files found.
.idea/vcs.xml
0 → 100644
View file @
426dd49b
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
.idea/workspace.xml
View file @
426dd49b
This diff is collapsed.
Click to expand it.
config-overrides.js
View file @
426dd49b
const
{
injectBabelPlugin
,
getLoader
}
=
require
(
'react-app-rewired'
);
const
{
injectBabelPlugin
,
getLoader
}
=
require
(
'react-app-rewired'
);
const
{
override
}
=
require
(
"customize-cra"
)
const
path
=
require
(
"path"
)
const
rewirePostcss
=
require
(
'react-app-rewire-postcss'
);
const
px2rem
=
require
(
'postcss-px2rem'
)
const
px2rem
=
require
(
'postcss-px2rem'
)
const
fileLoaderMatcher
=
function
(
rule
)
{
const
fileLoaderMatcher
=
function
(
rule
)
{
return
rule
.
loader
&&
rule
.
loader
.
indexOf
(
`file-loader`
)
!=
-
1
;
return
rule
.
loader
&&
rule
.
loader
.
indexOf
(
`file-loader`
)
!=
-
1
;
}
}
...
@@ -13,6 +17,15 @@ module.exports = function override(config, env) {
...
@@ -13,6 +17,15 @@ module.exports = function override(config, env) {
style
:
true
,
// use less for customized theme
style
:
true
,
// use less for customized theme
}],
config
);
}],
config
);
config
=
rewirePostcss
(
config
,{
plugins
:
()
=>
[
px2rem
({
remUnit
:
37.5
,
exclude
:
/node-modules/
})
],
});
// customize theme
// customize theme
config
.
module
.
rules
[
1
].
oneOf
.
unshift
(
config
.
module
.
rules
[
1
].
oneOf
.
unshift
(
{
{
...
@@ -28,10 +41,6 @@ module.exports = function override(config, env) {
...
@@ -28,10 +41,6 @@ module.exports = function override(config, env) {
ident
:
'postcss'
,
ident
:
'postcss'
,
plugins
:
()
=>
[
plugins
:
()
=>
[
require
(
'postcss-flexbugs-fixes'
),
require
(
'postcss-flexbugs-fixes'
),
px2rem
({
remUnit
:
37.5
,
exclude
:
/node-modules/
}),
autoprefixer
({
autoprefixer
({
browsers
:
[
browsers
:
[
'>1%'
,
'>1%'
,
...
...
src/Components/TopNotice/index.less
View file @
426dd49b
.search-notice-box{
.search-notice-box{
width: 100%;
width: 100%;
height: 43.5px;
height: 43.5px;
margin-bottom:
2
px;
margin-bottom:
1
px;
display: flex;
display: flex;
align-items: center;
align-items: center;
}
}
...
...
src/Components/TopSearch/index.jsx
View file @
426dd49b
...
@@ -3,12 +3,17 @@ import {SearchBar, Icon} from 'antd-mobile'
...
@@ -3,12 +3,17 @@ import {SearchBar, Icon} from 'antd-mobile'
import
'./index.less'
import
'./index.less'
const
Index
=
()
=>
{
const
Index
=
(
props
)
=>
{
const
topSearch
=
(
val
)
=>
{
const
input
=
document
.
getElementsByClassName
(
"top-single-search"
).
value
;
console
.
log
(
val
)
// props.onSearch(val)
}
return
(
return
(
<
div
className=
"search-box"
>
<
div
className=
"search-box"
>
<
Icon
type=
"search"
size=
"xs"
className=
"search-svg"
/>
<
Icon
type=
"search"
size=
"xs"
className=
"search-svg"
/>
{
/*<SearchBar/>*/
}
{
/*<SearchBar/>*/
}
<
input
className=
"top-single-search"
placeholder=
"请输入关键字搜索"
/>
<
input
onChange=
{
topSearch
}
className=
"top-single-search"
placeholder=
"请输入关键字搜索"
/>
</
div
>
</
div
>
);
);
};
};
...
...
src/Components/WorkCard/CardItem.jsx
View file @
426dd49b
import
React
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
'./index.less'
import
'./index.less'
const
CardItem
=
(
peops
)
=>
{
class
CardItem
extends
Component
{
return
(
state
=
{
<
div
className=
"card-item"
>
addStatus
:
false
<
div
className=
"card-item-content"
>
}
<
div
className=
"card-item-content-img"
>
componentWillReceiveProps
(
nextProps
,
nextContext
)
{
<
img
src=
{
peops
.
data
.
icon
}
style=
{
{
width
:
35
,
height
:
35
}
}
alt=
""
/>
if
(
this
.
props
.
addStatus
!==
nextProps
.
addStatus
)
{
</
div
>
this
.
setState
({
addStatus
:
this
.
props
.
addStatus
});
<
div
className=
"card-item-content-title"
>
}
{
peops
.
data
.
text
}
}
</
div
>
render
()
{
const
{
data
,
addCommon
}
=
this
.
props
;
return
(
<
div
className=
"card-content"
onClick=
{
()
=>
data
.
iconAdd
?
addCommon
()
:
null
}
>
{
data
.
text
&&
(
<
div
>
<
div
className=
"card-content-img"
>
<
img
src=
{
data
.
icon
}
className=
"card-content-img-svg"
alt=
""
/>
</
div
>
<
div
className=
"card-content-title"
>
{
data
.
text
}
</
div
>
</
div
>
)
}
</
div
>
</
div
>
</
div
>
);
);
}
}
;
}
export
default
CardItem
;
export
default
CardItem
;
src/Components/WorkCard/index.jsx
View file @
426dd49b
import
React
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Grid
}
from
'antd-mobile'
import
{
Grid
}
from
'antd-mobile'
import
'./index.less'
import
'./index.less'
import
CardItem
from
'./CardItem'
import
CardItem
from
'./CardItem'
c
onst
data
=
Array
.
from
(
new
Array
(
7
)).
map
((
_val
,
i
)
=>
(
{
c
lass
Index
extends
Component
{
icon
:
'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png'
,
render
()
{
text
:
`name
${
i
}
`
,
const
{
title
,
type
,
addStatus
,
addCommon
}
=
this
.
props
}));
const
emptyIcon
=
type
===
'edit'
?
{
text
:
'添加常用'
,
icon
:
''
,
iconAdd
:
true
const
Index
=
()
=>
{
}
:
{};
const
empty
=
data
.
length
%
3
;
empty
>
0
&&
data
.
push
({},
{})
return
(
//测试数据
<
div
>
const
data
=
Array
.
from
(
new
Array
(
7
)).
map
((
_val
,
i
)
=>
({
<
div
className=
"work-card-title"
>
icon
:
'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png'
,
11111
text
:
`name
${
i
}
`
,
</
div
>
}));
<
div
className=
"work-card-body"
>
const
empty
=
data
.
length
%
3
;
{
data
.
map
(
item
=>
(
empty
===
0
&&
data
.
push
(
emptyIcon
,
{},
{});
<
CardItem
data=
{
item
}
/>
empty
===
1
&&
data
.
push
(
emptyIcon
,
{});
))
}
empty
===
2
&&
data
.
push
(
emptyIcon
);
return
(
<
div
>
<
div
className=
"work-card-title"
>
{
title
}
</
div
>
<
div
className=
"work-card-body"
>
{
data
.
map
((
item
,
index
)
=>
(
<
CardItem
key=
{
index
}
data=
{
item
}
addStatus=
{
addStatus
}
addCommon=
{
addCommon
}
/>
))
}
</
div
>
</
div
>
</
div
>
{
/*<Grid*/
}
);
{
/*data={data}*/
}
}
{
/*columnNum={3}*/
}
}
{
/*renderItem={dataItem => (*/
}
{
/*<div style={{ padding: '12.5px' }}>*/
}
{
/*<img src={dataItem.icon} style={{ width: 35, height: 35 }} alt="" />*/
}
{
/*<div style={{ color: '#323232', fontSize: 13, marginTop: 18 }}>*/
}
{
/*收文管理*/
}
{
/*</div>*/
}
{
/*</div>*/
}
{
/*)}*/
}
{
/*/>*/
}
</
div
>
);
};
export
default
Index
;
export
default
Index
;
src/Components/WorkCard/index.less
View file @
426dd49b
...
@@ -2,25 +2,54 @@
...
@@ -2,25 +2,54 @@
display:flex;
display:flex;
flex-direction: row;
flex-direction: row;
flex-wrap: wrap;
flex-wrap: wrap;
justify-content: space-between
;
//justify-content: center
;
align-items: center;
align-items: center;
//background: #ffffff;
}
}
.work-card-title{
.card-item{
line-height: 43px;
width: 33.33%;
border-radius: 6px 6px 0 0;
position: relative;
padding-left: 20px;
background: #ffffff;
margin-bottom: 1px;
color: rgba(50, 50, 50, 0.6);
}
}
.card-item-content{
padding: 26px 0;
.card-content{
width: 114px;
height: 114px;
display: flex;
display: flex;
flex-direction: column;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
flex-direction: column;
background: #ffffff;
border: 1px salmon solid;
margin-bottom: 1px;
//border: 1px solid rgba(38, 104, 255, 0.1);
}
}
.card-item-content-img{
.work-card-body > .card-content:nth-child(3n + 2){
margin-bottom: 14px;
margin-left: 1px;
}
.work-card-body > .card-content:nth-child(3n + 3){
margin-left: 1px;
}
.work-card-body > .card-content:last-child{
border-radius: 0 0 6px 0;
}
.work-card-body > .card-content:nth-last-child(3){
border-radius: 0 0 0 6px;
}
.card-content:active{
background: yellow;
}
}
.card-item-content-title{
.card-content-img{
width: 35px;
height: 35px;
margin-bottom: 14px;
}
.card-content-img-svg{
width: 35px;
height: 35px;
}
.card-content-title{
}
}
src/Pages/Work/Work.jsx
View file @
426dd49b
import
React
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
WhiteSpace
}
from
"antd-mobile"
;
import
{
WhiteSpace
}
from
"antd-mobile"
;
import
TopSearch
from
'../../components/TopSearch'
import
TopSearch
from
'../../components/TopSearch'
import
WorkCard
from
'../../components/WorkCard'
import
WorkCard
from
'../../components/WorkCard'
const
Work
=
()
=>
{
class
Work
extends
Component
{
return
(
state
=
{
<
div
>
addStatus
:
false
<
WhiteSpace
/>
};
<
TopSearch
/>
commonEdit
=
()
=>
{
<
WhiteSpace
/>
const
{
addStatus
}
=
this
.
state
;
<
WorkCard
/>
this
.
setState
({
addStatus
:
!
addStatus
})
</
div
>
};
);
workSearch
=
(
val
)
=>
{
};
console
.
log
(
val
.
target
)
}
render
()
{
const
{
addStatus
}
=
this
.
props
return
(
<
div
>
<
WhiteSpace
/>
<
TopSearch
onSearch=
{
this
.
workSearch
}
/>
<
WhiteSpace
/>
<
WorkCard
type=
"edit"
title=
"常用板块"
addCommon=
{
this
.
commonEdit
}
addStatus=
{
addStatus
}
/>
<
WhiteSpace
/>
<
WorkCard
title=
"事物管理"
addCommon=
{
this
.
commonEdit
}
addStatus=
{
addStatus
}
/>
</
div
>
);
}
}
export
default
Work
;
export
default
Work
;
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