Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teddi
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
teddi
Commits
f843f3bd
Commit
f843f3bd
authored
Nov 25, 2020
by
AU-PRO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new code
parent
f1d818d6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
9 deletions
+83
-9
package.json
project/package.json
+1
-0
AUPop.jsx
project/src/components/AUPop/AUPop.jsx
+1
-1
PopRotate.jsx
project/src/components/pop/PopRotate/PopRotate.jsx
+0
-1
apiFunction.js
project/src/mobx/apiFunction.js
+18
-0
index.js
project/src/mobx/index.js
+1
-0
mobxState.js
project/src/mobx/mobxState.js
+38
-0
PageHome.jsx
project/src/pages/PageHome/PageHome.jsx
+14
-6
PageHome.less
project/src/pages/PageHome/PageHome.less
+9
-0
reducer.js
project/src/redux/reducer.js
+1
-1
No files found.
project/package.json
View file @
f843f3bd
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
"babel-plugin-transform-decorators-legacy"
:
"^1.3.5"
,
"babel-plugin-transform-decorators-legacy"
:
"^1.3.5"
,
"css-loader"
:
"^3.6.0"
,
"css-loader"
:
"^3.6.0"
,
"fyge-tbmini"
:
"^1.3.1"
,
"fyge-tbmini"
:
"^1.3.1"
,
"mobx"
:
"^6.0.4"
,
"postcss-loader"
:
"^3.0.0"
,
"postcss-loader"
:
"^3.0.0"
,
"prettier"
:
"^2.0.5"
,
"prettier"
:
"^2.0.5"
,
"qs"
:
"^6.9.4"
,
"qs"
:
"^6.9.4"
,
...
...
project/src/components/AUPop/AUPop.jsx
View file @
f843f3bd
...
@@ -88,5 +88,5 @@ class AUPop extends Component {
...
@@ -88,5 +88,5 @@ class AUPop extends Component {
}
}
}
}
//
到处
被 connect 包装的组件,共享 state 的状态
// 被 connect 包装的组件,共享 state 的状态
export
default
AUConnect
(
AUPop
)
export
default
AUConnect
(
AUPop
)
\ No newline at end of file
project/src/components/pop/PopRotate/PopRotate.jsx
View file @
f843f3bd
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
resList
from
'../../../resconfig/resList'
;
import
resList
from
'../../../resconfig/resList'
;
import
{
debounce
}
from
'../../../utils/debounce.js'
import
{
debounce
}
from
'../../../utils/debounce.js'
import
{
getPxToken
}
from
'../../../utils/spark_gettoken'
// Redux
// Redux
import
store
from
'../../../redux/store'
;
import
store
from
'../../../redux/store'
;
...
...
project/src/mobx/apiFunction.js
0 → 100644
View file @
f843f3bd
import
{
showPop
}
from
'../redux/action'
import
popState
from
'./mobxState'
const
showPop1
=
()
=>
{
}
const
showPop2
=
()
=>
{
}
const
test01
=
(
num
)
=>
{
popState
.
popStateAdd
(
num
)
}
// export default showPop1
// export default showPop2
export
default
test01
\ No newline at end of file
project/src/mobx/index.js
0 → 100644
View file @
f843f3bd
export
{
default
as
AUPOP
}
from
'./apiFunction'
\ No newline at end of file
project/src/mobx/mobxState.js
0 → 100644
View file @
f843f3bd
// 'use strict';
// import { observable, action, decorate } from "mobx";
import
{
makeAutoObservable
,
observable
,
computed
,
action
}
from
'mobx'
class
PopState
{
constructor
()
{
makeAutoObservable
(
this
,
{
nowShow
:
observable
,
computed4test
:
computed
,
add
:
action
})
}
nowShow
=
0
popArr
=
[]
add
=
(
num
)
=>
{
this
.
nowShow
+=
num
}
computed4test
=
()
=>
{
console
.
log
(
'nowShow is: '
,
this
.
nowShow
)
return
`nowShow is :
${
this
.
nowShow
}
`
}
}
const
AUPopState
=
new
PopState
()
const
popStateAdd
=
(
num
)
=>
{
AUPopState
.
add
(
num
)
}
export
default
{
popStateAdd
}
project/src/pages/PageHome/PageHome.jsx
View file @
f843f3bd
...
@@ -5,6 +5,8 @@ import { Random } from 'mockjs';
...
@@ -5,6 +5,8 @@ import { Random } from 'mockjs';
import
{
AUConnect
}
from
'../../redux/auConnect'
;
import
{
AUConnect
}
from
'../../redux/auConnect'
;
import
{
debounce
}
from
'../../utils/debounce'
;
import
{
debounce
}
from
'../../utils/debounce'
;
import
{
AUPOP
}
from
'../../mobx/index'
import
'./PageHome.less'
;
import
'./PageHome.less'
;
class
PageHome
extends
Component
{
class
PageHome
extends
Component
{
...
@@ -59,6 +61,10 @@ class PageHome extends Component {
...
@@ -59,6 +61,10 @@ class PageHome extends Component {
})
})
}
}
mobxAction01
=
()
=>
{
AUPOP
.
test01
(
1
)
}
openColorful
=
()
=>
{
openColorful
=
()
=>
{
this
.
props
.
showPop
({
type
:
'PopLightCard'
,
data
:
{
sindex
:
3
,
addSignDays
:
18
},
ctx
:
this
})
this
.
props
.
showPop
({
type
:
'PopLightCard'
,
data
:
{
sindex
:
3
,
addSignDays
:
18
},
ctx
:
this
})
}
}
...
@@ -68,13 +74,15 @@ class PageHome extends Component {
...
@@ -68,13 +74,15 @@ class PageHome extends Component {
<
div
className=
"home"
>
<
div
className=
"home"
>
<
div
className=
"home_title"
>
pageHome
</
div
>
<
div
className=
"home_title"
>
pageHome
</
div
>
<
div
className=
"home_button_group"
>
<
div
className=
"home_button_group"
>
<
div
onClick=
{
debounce
(
this
.
openDefault
,
300
)
}
className=
"home_button"
>
open pop default
</
div
>
<
div
onClick=
{
debounce
(
this
.
openDefault
,
300
,
1
)
}
className=
"home_button"
>
open pop default
</
div
>
<
div
onClick=
{
debounce
(
this
.
openRule
,
300
)
}
className=
"home_button"
>
open pop rule
</
div
>
<
div
onClick=
{
debounce
(
this
.
openRule
,
300
,
1
)
}
className=
"home_button"
>
open pop rule
</
div
>
<
div
onClick=
{
debounce
(
this
.
openInput
,
300
)
}
className=
"home_button"
>
open pop input
</
div
>
<
div
onClick=
{
debounce
(
this
.
openInput
,
300
,
1
)
}
className=
"home_button"
>
open pop input
</
div
>
<
div
onClick=
{
debounce
(
this
.
openRotate
,
300
)
}
className=
"home_button"
>
open pop rotate
</
div
>
<
div
onClick=
{
debounce
(
this
.
openRotate
,
300
,
1
)
}
className=
"home_button"
>
open pop rotate
</
div
>
<
div
onClick=
{
debounce
(
this
.
openInfinite
,
300
)
}
className=
"home_button"
>
open pop infinite
</
div
>
<
div
onClick=
{
debounce
(
this
.
openInfinite
,
300
,
1
)
}
className=
"home_button"
>
open pop infinite
</
div
>
<
div
onClick=
{
debounce
(
this
.
openColorful
,
300
)
}
className=
"home_button"
>
open pop colorful
</
div
>
<
div
onClick=
{
debounce
(
this
.
openColorful
,
300
,
1
)
}
className=
"home_button"
>
open pop colorful
</
div
>
</
div
>
</
div
>
<
div
onClick=
{
debounce
(
this
.
mobxAction01
,
300
,
1
)
}
className=
"home_button_mbox"
>
mobx test for action
</
div
>
</
div
>
</
div
>
);
);
}
}
...
...
project/src/pages/PageHome/PageHome.less
View file @
f843f3bd
...
@@ -37,4 +37,13 @@
...
@@ -37,4 +37,13 @@
overflow: hidden;
overflow: hidden;
}
}
}
}
.home_button_mbox {
width: 320px;
height: 80px;
background-color: beige;
font-size: 28px;
padding: 10px 30px;
text-align: center;
line-height: 80px;
}
}
}
project/src/redux/reducer.js
View file @
f843f3bd
import
{
combineReducers
}
from
'redux'
import
{
combineReducers
}
from
'redux'
import
{
ActionType
}
from
'./action'
;
import
{
ActionType
}
from
'./action'
let
stateInitPop
=
{
let
stateInitPop
=
{
popArr
:
[]
popArr
:
[]
...
...
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