Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-app-hairDryer
Project
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
姜雷
wx-app-hairDryer
Commits
17608af4
Commit
17608af4
authored
Feb 22, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!3
parents
b48daa1f
ca0df557
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
23 deletions
+31
-23
App.js
src/containers/App.js
+3
-12
style.scss
src/containers/BindEquipment/style.scss
+0
-1
EquipmentTest.js
src/containers/Equipment/EquipmentTest.js
+1
-1
index.js
src/containers/Equipment/index.js
+1
-1
index.js
src/containers/Login/index.js
+0
-1
index.js
src/containers/TestWater/index.js
+1
-1
userinfo-context.js
src/context/userinfo-context.js
+20
-5
index.js
src/index.js
+1
-1
index.css
src/styles/index.css
+4
-0
No files found.
src/containers/App.js
View file @
17608af4
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Switch
,
Route
}
from
'react-router-dom'
;
import
{
Switch
,
Route
}
from
'react-router-dom'
;
import
UserInfoContext
,
{
initUserinfo
}
from
'../context/userinfo-context'
;
import
{
UserProvider
}
from
'../context/userinfo-context'
;
import
NavBar
from
'../components/NavBar'
;
import
NavBar
from
'../components/NavBar'
;
import
Index
from
'./Index/Index'
;
import
Index
from
'./Index/Index'
;
...
@@ -11,19 +11,10 @@ import BindEquipment from './BindEquipment';
...
@@ -11,19 +11,10 @@ import BindEquipment from './BindEquipment';
import
NoMatch
from
'./NoMatch'
;
import
NoMatch
from
'./NoMatch'
;
function
App
()
{
function
App
()
{
const
[
userinfo
,
setUserinfo
]
=
useState
(
initUserinfo
);
const
[
title
,
setTitle
]
=
useState
(
'多彩运维'
);
const
[
title
,
setTitle
]
=
useState
(
'多彩运维'
);
return
(
return
(
<
div
className
=
'App'
>
<
div
className
=
'App'
>
<
UserInfoContext
.
Provider
<
UserProvider
>
value
=
{{
userinfo
:
userinfo
,
updateUserInfo
:
val
=>
setUserinfo
({
...
userinfo
,
...
val
,
}),
}}
>
<
Route
render
=
{
props
=>
<
NavBar
{...
props
}
title
=
{
title
}
/>} /
>
<
Route
render
=
{
props
=>
<
NavBar
{...
props
}
title
=
{
title
}
/>} /
>
<
Switch
>
<
Switch
>
<
Route
<
Route
...
@@ -49,7 +40,7 @@ function App() {
...
@@ -49,7 +40,7 @@ function App() {
/>
/>
<
Route
component
=
{
NoMatch
}
/
>
<
Route
component
=
{
NoMatch
}
/
>
<
/Switch
>
<
/Switch
>
<
/User
InfoContext.
Provider
>
<
/UserProvider
>
<
/div
>
<
/div
>
);
);
}
}
...
...
src/containers/BindEquipment/style.scss
View file @
17608af4
.BindEquipment
{
.BindEquipment
{
flex
:
1
;
flex
:
1
;
background
:
#ebebeb
url('../../images/Login/login_bg@2x.png')
no-repeat
;
background-size
:
contain
;
background-size
:
contain
;
background-position-y
:
-624px
;
background-position-y
:
-624px
;
background-color
:
#fff
;
background-color
:
#fff
;
...
...
src/containers/Equipment/EquipmentTest.js
View file @
17608af4
...
@@ -105,7 +105,7 @@ class EquipmentTest extends Component {
...
@@ -105,7 +105,7 @@ class EquipmentTest extends Component {
<
i
className
=
'linkIcon'
>
<
i
className
=
'linkIcon'
>
<
img
src
=
{
testIcon
}
alt
=
''
/>
<
img
src
=
{
testIcon
}
alt
=
''
/>
<
/i
>
<
/i
>
<
span
>
测试
放水
<
/span
>
<
span
>
测试
吹风
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/containers/Equipment/index.js
View file @
17608af4
...
@@ -48,7 +48,7 @@ export class Index extends React.Component {
...
@@ -48,7 +48,7 @@ export class Index extends React.Component {
<
i
className
=
'linkIcon'
>
<
i
className
=
'linkIcon'
>
<
img
src
=
{
testIcon
}
alt
=
''
/>
<
img
src
=
{
testIcon
}
alt
=
''
/>
<
/i
>
<
/i
>
<
span
>
测试
放水
<
/span
>
<
span
>
测试
吹风
<
/span
>
<
/Link
>
<
/Link
>
<
Link
<
Link
className
=
'linkItem'
className
=
'linkItem'
...
...
src/containers/Login/index.js
View file @
17608af4
...
@@ -21,7 +21,6 @@ export class Index extends React.Component {
...
@@ -21,7 +21,6 @@ export class Index extends React.Component {
}
}
componentWillMount
()
{
componentWillMount
()
{
console
.
log
(
this
.
props
);
const
{
setTitle
,
updateUserInfo
}
=
this
.
props
;
const
{
setTitle
,
updateUserInfo
}
=
this
.
props
;
setTitle
(
'登陆'
);
setTitle
(
'登陆'
);
const
{
code
}
=
this
.
props
;
const
{
code
}
=
this
.
props
;
...
...
src/containers/TestWater/index.js
View file @
17608af4
...
@@ -20,7 +20,7 @@ export class Index extends React.Component {
...
@@ -20,7 +20,7 @@ export class Index extends React.Component {
componentWillMount
()
{
componentWillMount
()
{
const
{
setTitle
}
=
this
.
props
;
const
{
setTitle
}
=
this
.
props
;
setTitle
(
'测试
放水
'
);
setTitle
(
'测试
吹风
'
);
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
createBarcode
();
this
.
createBarcode
();
...
...
src/context/userinfo-context.js
View file @
17608af4
import
React
from
'react'
;
import
React
,
{
createContext
,
useState
}
from
'react'
;
function
is_weixn
()
{
function
is_weixn
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
...
@@ -21,9 +21,24 @@ export const initUserinfo = {
...
@@ -21,9 +21,24 @@ export const initUserinfo = {
},
},
};
};
export
const
UserContext
=
React
.
createContext
({
export
const
UserContext
=
createContext
();
userinfo
:
initUserinfo
,
updateUserInfo
:
()
=>
{},
export
const
UserProvider
=
props
=>
{
});
const
[
userinfo
,
setUserinfo
]
=
useState
(
initUserinfo
);
return
(
<
UserContext
.
Provider
value
=
{{
userinfo
:
userinfo
,
updateUserInfo
:
val
=>
setUserinfo
({
...
userinfo
,
...
val
,
}),
}}
>
{
props
.
children
}
<
/UserContext.Provider
>
);
};
export
default
UserContext
;
export
default
UserContext
;
src/index.js
View file @
17608af4
import
React
from
'react'
;
import
React
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
ReactDOM
from
'react-dom'
;
import
'./styles/index.css'
;
import
App
from
'./containers/App'
;
import
App
from
'./containers/App'
;
import
*
as
serviceWorker
from
'./serviceWorker'
;
import
*
as
serviceWorker
from
'./serviceWorker'
;
import
{
BrowserRouter
}
from
'react-router-dom'
;
import
{
BrowserRouter
}
from
'react-router-dom'
;
import
packageConfig
from
'../package.json'
;
import
packageConfig
from
'../package.json'
;
import
'./styles/index.css'
;
ReactDOM
.
render
(
ReactDOM
.
render
(
<
BrowserRouter
basename
=
{
packageConfig
.
homepage
}
>
<
BrowserRouter
basename
=
{
packageConfig
.
homepage
}
>
...
...
src/styles/index.css
View file @
17608af4
...
@@ -5,6 +5,7 @@ html {
...
@@ -5,6 +5,7 @@ html {
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
font-family
:
sans-serif
;
font-family
:
sans-serif
;
font-size
:
28px
;
}
}
figure
,
figure
,
p
{
p
{
...
@@ -147,3 +148,6 @@ img {
...
@@ -147,3 +148,6 @@ img {
flex
:
1
;
flex
:
1
;
line-height
:
80px
;
line-height
:
80px
;
}
}
.am-button
{
font-size
:
28px
;
}
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