Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
icbcRPG
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
icbcRPG
Commits
e3effb59
Commit
e3effb59
authored
Dec 29, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
af9b61b3
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1014 additions
and
676 deletions
+1014
-676
package-lock.json
project/package-lock.json
+853
-0
package.json
project/package.json
+0
-2
app.jsx
project/src/app.jsx
+0
-5
prize.jsx
project/src/components/prize/prize.jsx
+1
-2
sign.jsx
project/src/components/sign/sign.jsx
+1
-2
loading.jsx
project/src/pages/loading/loading.jsx
+1
-2
main3.jsx
project/src/pages/main3/main3.jsx
+7
-7
AUPopMobx.jsx
project/src/pop/AUPopMobx/AUPopMobx.jsx
+0
-149
AUPopMobx.less
project/src/pop/AUPopMobx/AUPopMobx.less
+0
-181
AUState.js
project/src/pop/AUState.js
+0
-129
clear.js
project/src/pop/api/clear.js
+0
-13
close.js
project/src/pop/api/close.js
+0
-22
cover.js
project/src/pop/api/cover.js
+0
-28
getArr.js
project/src/pop/api/getArr.js
+0
-28
index.js
project/src/pop/api/index.js
+0
-5
show.js
project/src/pop/api/show.js
+0
-28
tools.js
project/src/pop/api/tools.js
+0
-70
index.js
project/src/pop/index.js
+0
-3
PopMap.js
project/src/util/PopMap.js
+0
-0
viewCtrl.js
project/src/util/viewCtrl.js
+151
-0
No files found.
project/package-lock.json
0 → 100644
View file @
e3effb59
This diff is collapsed.
Click to expand it.
project/package.json
View file @
e3effb59
...
...
@@ -18,8 +18,6 @@
"css-loader"
:
"^3.6.0"
,
"duiba-utils"
:
"^1.0.2"
,
"fyge-tbmini"
:
"^1.3.1"
,
"mobx"
:
"^6.0.4"
,
"mobx-react-lite"
:
"^3.1.6"
,
"postcss-loader"
:
"^3.0.0"
,
"prettier"
:
"^2.0.5"
,
"qs"
:
"^6.9.4"
,
...
...
project/src/app.jsx
View file @
e3effb59
...
...
@@ -7,7 +7,6 @@ import Detail2 from "./pages/detail2/detail2.jsx";
//此处为spark-cli动态生成
import
Loading
from
"./pages/loading/loading.jsx"
;
import
Main3
from
"./pages/main3/main3.jsx"
;
import
{
AUPOP
,
AUP_MBX_STATE
}
from
'./pop'
;
MOCK_STATUS
&&
(
require
(
'../mock/index'
));
MD
();
...
...
@@ -21,9 +20,6 @@ class App extends Component {
}
componentDidMount
()
{
// setTime`out(() => {
// Aup.show('PopRule', {}, this)
// }, 1000);`
}
eventHandler
=
()
=>
{
...
...
@@ -41,7 +37,6 @@ class App extends Component {
{
page
==
'loading'
&&
<
Loading
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Loading
>
}
{
page
==
'mainpage'
&&
<
Main3
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Main3
>
}
{
page
==
'detail'
&&
<
Detail2
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Detail2
>
}
<
AUPOP
eventHandler=
{
this
.
eventHandler
}
AUPopState=
{
AUP_MBX_STATE
}
></
AUPOP
>
</>
);
}
...
...
project/src/components/prize/prize.jsx
View file @
e3effb59
...
...
@@ -2,7 +2,6 @@
import
React
,
{
Component
}
from
'react'
;
import
resList2
from
'../../resconfig/resList2'
;
import
{
Aup
}
from
'../../pop'
;
import
'./prize.less'
;
class
Comprize
extends
Component
{
constructor
(
props
)
{
...
...
@@ -14,7 +13,7 @@ class Comprize extends Component {
}
onCloseCustom
=
()
=>
{
Aup
.
clear
()
//
Aup.clear()
}
render
()
{
...
...
project/src/components/sign/sign.jsx
View file @
e3effb59
...
...
@@ -4,7 +4,6 @@ import { Toast } from '@spark/ui';
import
React
,
{
Component
}
from
'react'
;
import
API
from
'../../api'
;
import
{
getHomeInfo
}
from
'../../dataCenter'
;
import
{
Aup
}
from
'../../pop'
;
import
resList
from
'../../resconfig/resList'
;
//import API from '../../api';
import
{
debounce
}
from
'../../ui'
;
import
'./sign.less'
;
...
...
@@ -35,7 +34,7 @@ class Sign extends Component {
getHomeInfo
();
if
(
res
.
data
.
type
!==
'joyBean'
)
{
Aup
.
show
(
'PrizeRule'
,
res
.
data
,
this
);
//
Aup.show('PrizeRule', res.data, this);
}
else
{
this
.
props
.
onClose
();
Toast
(
`恭喜你成功领取
${
res
.
data
.
awardName
}
`
)
...
...
project/src/pages/loading/loading.jsx
View file @
e3effb59
...
...
@@ -7,7 +7,6 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
import
API
from
'../../api'
;
import
'./loading.less'
;
import
{
Aup
}
from
'../../pop'
;
import
dataCenter
,
{
getAPIdata
,
getHomeInfo
,
Store
}
from
'../../dataCenter'
;
class
Loading
extends
Component
{
...
...
@@ -108,7 +107,7 @@ class Loading extends Component {
if
(
newUser
)
{
//新用户,走选择,然后再走引导,引导结束后,走签到
Aup
.
show
(
'Select'
,
{},
this
);
//
Aup.show('Select', {}, this);
isnewUser
=
1
;
}
}
...
...
project/src/pages/main3/main3.jsx
View file @
e3effb59
...
...
@@ -3,7 +3,6 @@
import
React
,
{
Component
}
from
'react'
;
import
resList
from
'../../resconfig/resList'
;
//import API from '../../api';
import
API
from
'../../api'
;
import
{
Aup
,
AUPOP
,
AUP_MBX_STATE
}
from
'../../pop'
;
import
'./main3.less'
;
import
{
CanvasWidget
}
from
'spark-utils'
;
import
{
Guideact
}
from
'@spark/guideact'
;
//'./bundle';//
...
...
@@ -51,12 +50,12 @@ class Main3 extends Component {
}
onClick_userinfo
=
()
=>
{
Aup
.
show
(
'Userinfo'
,
{
figureId
:
this
.
state
.
figureId
},
this
);
//
Aup.show('Userinfo', {figureId:this.state.figureId}, this);
}
onClick_signBtn
=
()
=>
{
API
.
signInfo
().
then
((
res
)
=>
{
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
//
Aup.show('Sign', res.data, this);
})
}
...
...
@@ -70,7 +69,7 @@ class Main3 extends Component {
onClick_rulebtn
=
()
=>
{
// console.log('onClick_rulebtn')
Aup
.
show
(
'PopRule'
,
{},
this
)
//
Aup.show('PopRule', {}, this)
}
onclick_jingcai
=
()
=>
{
...
...
@@ -89,7 +88,7 @@ class Main3 extends Component {
API
.
signInfo
().
then
((
res
)
=>
{
const
{
needPopup
}
=
res
.
data
;
if
(
needPopup
)
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
//
Aup.show('Sign', res.data, this);
});
}
}
...
...
@@ -145,8 +144,9 @@ class Main3 extends Component {
dataCenter
.
setData
(
Store
.
needguide
,
false
);
API
.
signInfo
().
then
((
res
)
=>
{
const
{
needPopup
}
=
res
.
data
;
if
(
needPopup
)
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
if
(
needPopup
){
// Aup.show('Sign', res.data, this);
}
})
break
;
...
...
project/src/pop/AUPopMobx/AUPopMobx.jsx
deleted
100755 → 0
View file @
af9b61b3
import
React
,
{
Component
}
from
'react'
;
import
popMap
from
'../PopMap.js'
import
{
observer
}
from
'mobx-react-lite'
import
{
toJS
}
from
"mobx"
;
import
{
Aup
}
from
"../index.js"
import
{
ConsoleStyleComponents
,
ConsoleStyleFlagColor
}
from
'../api/tools.js'
;
import
'./AUPopMobx.less'
class
AUPopMobx
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
this
.
state
||
{
popArr
:
[]
}
this
.
auPopRef
=
React
.
createRef
()
this
.
closeFlagRef
=
React
.
createRef
()
}
static
getDerivedStateFromProps
(
nextProprs
,
preState
)
{
console
.
log
(
`%c AUPopMobx nextProprs is: \n`
,
ConsoleStyleComponents
,
nextProprs
)
if
(
nextProprs
.
popArr
.
length
===
0
)
{
allowScroll
()
}
else
if
(
nextProprs
.
popArr
.
length
&&
preState
.
popArr
.
length
==
0
)
{
disableScroll
()
}
return
{
popArr
:
nextProprs
.
popArr
}
}
closePop
=
(
index
)
=>
{
// TODO: not complete
// TODO: inject some animation function in there:
if
(
!
this
.
state
.
popArr
.
length
)
return
else
if
(
this
.
state
.
popArr
.
length
==
1
)
{
if
(
this
.
auPopRef
.
current
)
{
this
.
auPopRef
.
current
.
style
.
transition
=
`opacity 350ms`
this
.
auPopRef
.
current
.
style
.
opacity
=
'0'
this
.
closeFlagRef
.
current
&&
(
this
.
closeFlagRef
.
current
.
style
.
display
=
'block'
)
setTimeout
(()
=>
{
Aup
.
close
()
this
.
closeFlagRef
.
current
&&
(
this
.
closeFlagRef
.
current
.
style
.
display
=
'none'
)
},
400
);
}
else
{
Aup
.
close
()
this
.
closeFlagRef
.
current
.
style
.
display
=
'none'
}
}
else
if
(
this
.
state
.
popArr
.
length
>
1
)
{
this
.
closeFlagRef
.
current
&&
(
this
.
closeFlagRef
.
current
.
style
.
display
=
'block'
)
setTimeout
(()
=>
{
Aup
.
close
()
this
.
closeFlagRef
.
current
&&
(
this
.
closeFlagRef
.
current
.
style
.
display
=
'none'
)
},
400
);
}
}
render
()
{
console
.
log
(
'%c ----------------- AUtest - RENDER RUN FLAG ----------------- ----------------- ----------------- -----------------'
,
ConsoleStyleFlagColor
)
const
{
popArr
}
=
this
.
state
let
Pop
=
[]
popArr
.
forEach
((
item
,
index
)
=>
{
const
{
showPop
,
popData
,
fn
,
ctx
}
=
item
let
PItem
=
popMap
.
get
(
showPop
)
if
(
!
PItem
)
console
.
error
(
`没有类型为
${
showPop
}
的弹窗`
)
Pop
.
push
(
<
div
className=
{
showPop
===
'PopLightCard'
?
'compop_content comPop_zoom_from0'
:
'compop_content comPop_zoom'
}
>
<
PItem
onClose=
{
this
.
closePop
}
data=
{
popData
}
fn=
{
fn
}
ctx=
{
ctx
}
type=
'spot'
/>
</
div
>
)
})
const
Com
=
(
popArr
.
length
&&
popArr
[
0
].
showPop
)
?
(
<
div
className=
'compop_back'
ref=
{
this
.
auPopRef
}
>
<
div
className=
'compop_mask'
></
div
>
{
/* 关闭-禁止点击 */
}
<
div
ref=
{
this
.
closeFlagRef
}
className=
'compop_transparent'
></
div
>
{
Pop
.
map
((
It
,
index
)
=>
{
return
(
<
React
.
Fragment
key=
{
index
}
>
<
div
className=
{
(
index
!==
Pop
.
length
-
1
)
?
'Fragment-wrapper Fragment-small-opacity'
:
'Fragment-wrapper'
}
>
{
(
index
!==
Pop
.
length
-
1
)
?
<
div
className=
"Fragment-wrapper-mask"
></
div
>
:
null
}
{
It
}
</
div
>
</
React
.
Fragment
>)
})
}
</
div
>
)
:
null
return
(
Com
);
}
}
export
const
AUPOP
=
observer
(({
AUPopState
})
=>
{
console
.
log
(
AUPopState
)
return
<
AUPopMobx
popArr=
{
toJS
(
AUPopState
.
popArr
)
}
/>
})
const
debounce
=
(
fn
,
wait
,
immediate
=
false
)
=>
{
let
timer
return
function
()
{
if
(
timer
)
clearTimeout
(
timer
)
if
(
immediate
)
{
// 如果已经执行过,不再执行
var
callNow
=
!
timer
timer
=
setTimeout
(()
=>
{
timer
=
null
},
wait
)
if
(
callNow
)
{
fn
()
}
}
else
{
timer
=
setTimeout
(()
=>
{
fn
()
},
wait
)
}
}
}
let
top
=
0
const
disableScroll
=
debounce
(()
=>
{
var
top_
=
window
.
scrollY
;
// console.log('ScrollScroll disableScroll', top_)
document
.
body
.
style
.
position
=
"fixed"
;
document
.
body
.
style
.
overflow
=
"hidden"
;
top
=
top_
document
.
body
.
style
.
top
=
-
top
+
"px"
;
},
300
,
1
)
const
allowScroll
=
debounce
(()
=>
{
// console.log('ScrollScroll allowScroll', top)
document
.
body
.
style
.
top
=
"0px"
;
document
.
body
.
style
.
position
=
"relative"
;
document
.
body
.
style
.
overflow
=
"auto"
;
window
.
scrollTo
(
0
,
top
);
},
300
,
1
)
project/src/pop/AUPopMobx/AUPopMobx.less
deleted
100755 → 0
View file @
af9b61b3
.compop_back {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 99;
touch-action: none;
.compop_mask {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .7);
position: absolute;
top: 0;
left: 0;
z-index: -1;
touch-action: none;
}
.compop_transparent {
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0);
position: absolute;
top: 0;
left: 0;
z-index: 9;
touch-action: none;
display: none;
}
}
.pop_mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
position: fixed;
background: transparent;
}
.compop_content {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
left: 0;
z-index: 2;
}
.comPop_close_btn {
position: absolute;
display: block;
z-index: 1;
width: 102px;
height: 102px;
left: calc(49% - (102px / 2));
bottom: -160px;
z-index: 3;
}
.comPop_back_light {
position: absolute;
display: block;
z-index: -1;
width: 883px;
height: 883px;
left: calc(50% - (883px / 2));
top: -200px;
bottom: -144px;
}
.comPop_back_head {
position: absolute;
display: block;
z-index: 2;
width: 567px;
height: 140px;
left: 5px;
top: 20px;
animation: floatAni 3000ms infinite linear;
transform-origin: center center center;
position: relative;
}
@keyframes floatAni {
0% {
transform: skewX(-1deg) skewY(0.8deg) scaleX(1.05) translateY(-30px) rotate(-3deg);
}
25% {
transform: skewX(-0.5deg) skewY(0.3deg) scaleX(1.02) translateY(-20px) rotate(-2deg);
}
50% {
transform: skewX(0deg) skewY(0deg) scaleX(1) translateY(-15px) rotate(-2deg);
}
75% {
transform: skewX(-0.5deg) skewY(0.3deg) scaleX(1.02) translateY(-20px) rotate(-2deg);
}
100% {
transform: skewX(-1deg) skewY(0.8deg) scaleX(1.05) translateY(-30px) rotate(-3deg);
}
}
.comPop_zoom {
transform-origin: center center;
animation: zoom 0.24s linear 0s 1;
}
.comPop_zoom_from0 {
transform-origin: center center;
opacity: 0;
transform: scale(0);
animation: zoomfrom0 0.22s linear 0.44s 1 forwards;
}
.Fragment-wrapper-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: transparent;
z-index: 99;
touch-action: none;
}
.Fragment-small-opacity {
transition: transform 300ms ease-in, opacity 200ms linear !important;
transform: scale(0.5) !important;
opacity: 0 !important;
}
.Fragment-wrapper {
opacity: 1;
transition: transform 200ms ease-out, opacity 200ms linear;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: scale(1);
transform-origin: center center;
}
@keyframes zoom {
0% {
transform: scale(0.75);
}
50% {
transform: scale(1.08)
}
100% {
transform: scale(1)
}
}
@keyframes zoomfrom0 {
0% {
opacity: 0;
transform: scale(0.2);
}
80% {
opacity: 1;
transform: scale(1.12)
}
100% {
opacity: 1;
transform: scale(1)
}
}
.comPop_fadeout {
opacity: 0;
transition: opacity 300ms linear;
}
\ No newline at end of file
project/src/pop/AUState.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
makeAutoObservable
,
observable
,
computed
,
action
,
runInAction
,
autorun
,
reaction
,
configure
,
toJS
}
from
'mobx'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
,
ConsoFunc
}
from
'./api/tools'
// configure({
// useProxies: "never"
// })
class
PopState
{
nowShow
popArr
constructor
()
{
this
.
popArr
=
[]
this
.
nowShow
=
arguments
[
0
]
// makeAutoObservable(this)
makeAutoObservable
(
this
,
{
nowShow
:
observable
,
popArr
:
observable
,
addPop
:
action
.
bound
,
changePop
:
action
.
bound
,
popArrLength
:
computed
})
}
// 添加一个弹窗
addPop
=
(
data
)
=>
{
this
.
nowShow
=
data
.
type
this
.
popArr
.
push
(
data
)
// console.log(`${CONSO_START_mark}\n addPop:`, ConsoleStyleTitle, toJS(this.popArr))
}
// 改变数组中的第一个弹窗
changePop
=
(
data
)
=>
{
this
.
nowShow
=
data
.
type
this
.
popArr
.
push
(
data
)
// console.log(`${CONSO_START_mark}\n changePop:`, ConsoleStyleTitle, toJS(this.popArr))
// this.popArr = [data]
}
// 删除弹窗
delePop
=
(
long
)
=>
{
this
.
popArr
.
splice
(
this
.
popArr
.
length
-
long
,
long
)
if
(
this
.
popArr
.
length
)
this
.
nowShow
=
this
.
popArr
[
this
.
popArr
.
length
-
1
].
type
}
// 清空 弹窗
clearPop
=
()
=>
{
this
.
popArr
=
[]
}
get
popArrLength
()
{
// console.log(`${CONSO_START_mark}\n this.popArr:`, ConsoleStyleTitle, toJS(this.popArr))
return
this
.
popArr
.
length
}
}
export
const
AUP_MBX_STATE
=
new
PopState
(
'init'
)
autorun
(()
=>
{
let
tempLastComPop
=
toJS
(
AUP_MBX_STATE
.
popArr
)
let
last
=
tempLastComPop
.
length
?
tempLastComPop
[
tempLastComPop
.
length
-
1
]
:
undefined
console
.
log
(
`
${
CONSO_START_mark
}
\n AUTORUN::: the last Pop`
,
ConsoleStyleTitle
,
last
)
return
last
})
// ready code for mobx can't use
// author: 沈阳楠
// export const EventDispatcher = (function () {
// function EventDispatcher() {
// this._events = {}
// }
// EventDispatcher.ins = function () {
// if (EventDispatcher.ins == null) {
// EventDispatcher.ins = new EventDispatcher()
// }
// return EventDispatcher.ins
// }()
// EventDispatcher.prototype.dispatch = function (eventName, data) {
// for (let i in this._events[eventName]) {
// var _event = this._events[eventName][i]
// _event.callback.call(_event.target.context, data)
// }
// }
// EventDispatcher.prototype.addEventListener = function (eventName, callback, target) {
// var _events = this._events[eventName]
// if (_events) {
// _events.push({
// callback: callback,
// target: target
// })
// } else {
// this._events[eventName] = [{
// callback: callback,
// target: target
// }]
// }
// }
// EventDispatcher.prototype.removeEventListener = function (eventName, callback, target) {
// for (let i = this._events[eventName].length - 1; i >= 0; i--) {
// var _event = this._events[eventName][i]
// if (_event.callback == callback && _event.target == target) {
// this._events[eventName].splice(i, 1)
// }
// }
// }
// EventDispatcher.prototype.removeAllEventListener = function (eventName) {
// this._events[eventName] = null
// }
// return EventDispatcher
// }())
// EventDispatcher.ins.addEventListener("aaaa", this.isStart, this)
// EventDispatcher.ins.addEventListener("aaaa", () => {
// EventDispatcher.ins.removeEventListener("aaaa", this.isStart, this)
// }, this)
// EventDispatcher.ins.dispatch("aaaa", 3213123)
\ No newline at end of file
project/src/pop/api/clear.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
AUP_MBX_STATE
}
from
'../AUState'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
}
from
'./tools'
/**
* 清空页面弹窗
*/
export
const
clear
=
()
=>
{
if
(
AUP_MBX_STATE
.
popArrLength
===
0
)
return
else
AUP_MBX_STATE
.
clearPop
()
}
project/src/pop/api/close.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
AUP_MBX_STATE
}
from
'../AUState'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
}
from
'./tools'
/**
* 关闭弹窗
* @param {Number} length 关闭的数量
*/
export
const
close
=
(
length
=
1
)
=>
{
if
(
AUP_MBX_STATE
.
popArrLength
===
0
)
{
console
.
warn
(
`弹窗数组无储存的弹窗, \n 勿重复调用 close()`
)
return
}
else
if
(
AUP_MBX_STATE
.
popArrLength
>=
length
)
{
AUP_MBX_STATE
.
delePop
(
length
)
}
else
{
console
.
warn
(
`传入的关闭弹窗数量
${
length
}
,大于弹窗数组所储存的数量
${
AUP_MBX_STATE
.
popArrLength
}
, \n 执行清空操作`
)
AUP_MBX_STATE
.
clearPop
()
}
}
project/src/pop/api/cover.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
AUP_MBX_STATE
}
from
'../AUState'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
}
from
'./tools'
/**
* 显示弹窗
* @param {String} type 弹窗类型
* @param {Object} data 传递数据
* @param {Fucntion} fn 定义更多 需要执行的方法 (context 来自父组件)
* @param {Context} ctx 传递 父组件 Context
*/
export
const
cover
=
(
type
,
data
=
{},
option
=
null
)
=>
{
const
pData
=
{
showPop
:
type
,
popData
:
data
||
null
,
fn
:
fn
||
null
,
ctx
:
ctx
||
null
}
// console.log(`${CONSO_START_mark}\n AupopShow data is:`, ConsoleStyleTitle, data)
// 覆盖弹窗
if
(
type
&&
AUP_MBX_STATE
.
popArrLength
)
AUP_MBX_STATE
.
addPop
(
pData
)
// 出现弹窗 - ps: 首个弹窗
else
AUP_MBX_STATE
.
addPop
(
pData
)
}
project/src/pop/api/getArr.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
AUP_MBX_STATE
}
from
'../AUState'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
}
from
'./tools'
/**
* 获取弹窗数组
*/
export
const
getArr
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
popArrTmp
=
deepCopy
(
AUP_MBX_STATE
.
popArr
)
resolve
(
popArrTmp
)
})
}
function
deepCopy
(
source
){
if
(
typeof
source
!=
"object"
)
{
return
source
}
if
(
source
==
null
)
{
return
source
}
var
newObj
=
source
.
constructor
===
Array
?
[]
:
{}
//开辟一块新的内存空间
for
(
var
i
in
source
)
{
newObj
[
i
]
=
deepCopy
(
source
[
i
])
}
return
newObj
}
// IntersectionObserver
\ No newline at end of file
project/src/pop/api/index.js
deleted
100755 → 0
View file @
af9b61b3
export
{
show
}
from
'./show'
export
{
cover
}
from
'./cover'
export
{
close
}
from
'./close'
export
{
clear
}
from
'./clear'
export
{
getArr
}
from
'./getArr'
\ No newline at end of file
project/src/pop/api/show.js
deleted
100755 → 0
View file @
af9b61b3
'use strict'
;
import
{
AUP_MBX_STATE
}
from
'../AUState'
import
{
CONSO_START_mark
,
ConsoleStyleTitle
}
from
'./tools'
/**
* 显示弹窗
* @param {String} type 弹窗类型
* @param {Object} data 传递数据
* @param {Fucntion} fn 定义更多 需要执行的方法 (context 来自父组件)
* @param {Context} ctx 传递 父组件 Context
*/
export
const
show
=
(
type
,
data
=
{},
ctx
,
fn
)
=>
{
const
pData
=
{
showPop
:
type
,
popData
:
data
||
null
,
fn
:
fn
||
null
,
ctx
:
ctx
||
null
}
// console.log(`${CONSO_START_mark}\n AupopShow data is:`, ConsoleStyleTitle, data)
// 添加弹窗 没有弹窗
if
(
type
&&
!
AUP_MBX_STATE
.
popArrLength
)
AUP_MBX_STATE
.
addPop
(
pData
)
// 替换弹窗
else
if
(
type
&&
AUP_MBX_STATE
.
popArrLength
)
AUP_MBX_STATE
.
changePop
(
pData
)
}
project/src/pop/api/tools.js
deleted
100755 → 0
View file @
af9b61b3
export
function
ConsoFunc
()
{
console
.
log
(
CONSO_START_mark
,
ConsoleStyleTitle
,
...
arguments
)
// console.log(END_mark, ConsoleStyleDetail)
}
export
const
ConsoleStyleTitle
=
[
'color: #94c902'
,
'font-size: 12px'
,
'font-weight: 500'
,
'text-shadow: 1px 1px rgba(200, 200, 200, 0.2)'
,
].
join
(
';'
)
export
const
ConsoleStyleDetail
=
[
'color: #94c902'
,
'font-size: 8px'
,
'font-weight: 200'
].
join
(
';'
)
export
const
ConsoleStyleComponents
=
[
'color: #a591ff'
,
'font-size: 12px'
,
'font-weight: 400'
].
join
(
';'
)
export
const
ConsoleStyleFlagColor
=
[
'color: #fda300'
,
'font-size: 6px'
,
'font-weight: 900'
].
join
(
';'
)
export
const
CONSO_END_mark
=
`%c end --------\n`
export
const
CONSO_START_mark
=
`%c------- ~ (๑• . •๑) ~ ------- AUPOP -------- \n`
\ No newline at end of file
project/src/pop/index.js
deleted
100755 → 0
View file @
af9b61b3
export
*
as
Aup
from
'./api'
export
{
AUP_MBX_STATE
}
from
'./AUState'
export
{
AUPOP
}
from
'./AUPopMobx/AUPopMobx.jsx'
\ No newline at end of file
project/src/
pop
/PopMap.js
→
project/src/
util
/PopMap.js
View file @
e3effb59
File moved
project/src/util/viewCtrl.js
0 → 100644
View file @
e3effb59
import
React
from
'react'
;
import
ReactDOM
from
"react-dom"
;
import
Toast
from
'./comp/toast/toast.jsx'
;
import
Waitting
from
'./comp/waitting/waitting.jsx'
;
import
config
from
'./config'
;
const
ViewCtrl
=
{
showToast
:(
msg
=
"活动异常火爆,请稍后再试"
)
=>
{
let
T
=
Toast
;
var
m
=
document
.
createElement
(
'div'
);
m
.
className
=
"popcontainer_empty"
m
.
style
.
zIndex
=
9999
;
document
.
body
.
appendChild
(
m
);
setTimeout
(
function
()
{
var
d
=
500
/
1000
;
m
.
style
.
webkitTransition
=
'opacity '
+
d
+
's ease-in'
;
m
.
style
.
opacity
=
'0'
;
setTimeout
(
function
()
{
document
.
body
.
removeChild
(
m
)
},
500
);
},
1500
);
T
=
<
T
msg
=
{
msg
}
/
>
ReactDOM
.
render
(
T
,
m
);
},
showToast2
:(
msg
=
"活动异常火爆,请稍后再试"
)
=>
{
let
T
=
Toast
;
var
m
=
document
.
createElement
(
'div'
);
m
.
className
=
"popcontainer_empty"
m
.
style
.
zIndex
=
9999
;
document
.
body
.
appendChild
(
m
);
setTimeout
(
function
()
{
var
d
=
500
/
1000
;
m
.
style
.
webkitTransition
=
'opacity '
+
d
+
's ease-in'
;
m
.
style
.
opacity
=
'0'
;
setTimeout
(
function
()
{
document
.
body
.
removeChild
(
m
)
},
500
);
},
999999999
);
T
=
<
T
msg
=
{
msg
}
/
>
ReactDOM
.
render
(
T
,
m
);
},
initWaiting
:()
=>
{
if
(
document
.
getElementById
(
"waittingId"
))
return
;
let
T
=
Waitting
;
var
m
=
document
.
createElement
(
'div'
);
m
.
className
=
"popcontainer_empty"
m
.
id
=
"waittingId"
m
.
style
.
zIndex
=
99999
;
m
.
style
.
opacity
=
0
;
m
.
style
.
pointerEvents
=
"none"
;
document
.
body
.
appendChild
(
m
);
T
=
<
T
/>
ReactDOM
.
render
(
T
,
m
);
},
showWaiting
:()
=>
{
let
node
=
document
.
getElementById
(
"waittingId"
);
node
.
style
.
pointerEvents
=
""
;
node
.
style
.
opacity
=
1
;
},
hideWaiting
:()
=>
{
let
node
=
document
.
getElementById
(
"waittingId"
);
node
.
style
.
pointerEvents
=
"none"
;
node
.
style
.
opacity
=
0
;
},
/**控制显示隐藏,name:节点的类名,value为布尔值 */
changeVisible
:
(
name
,
value
)
=>
{
let
node
;
node
=
document
.
getElementsByClassName
(
name
)[
0
]
if
(
value
==
true
)
{
node
.
style
.
display
=
''
}
else
if
(
value
==
false
)
{
node
.
style
.
display
=
'none'
}
},
// clickZoom:(className)=>{
// let node;
// node = document.getElementsByClassName(className)[0];
// if(node){
// node.style = "transform-origin:50% 50% 0px";
// new TWEEN.Tween(node)
// // .to({node.})
// }
// },
/**弹出弹窗 */
showWin
:
(
enumComKey
,
data
=
{},
call
)
=>
{
let
T
=
config
.
comMap
.
get
(
enumComKey
)
var
m
=
document
.
createElement
(
'div'
);
m
.
className
=
"popcontainer"
// m.addEventListener()
document
.
body
.
appendChild
(
m
);
m
.
addEventListener
(
'click'
,(
e
)
=>
{
// console.log(e.target.className,'mengceng e');
if
(
e
.
target
.
className
.
trim
()
==
'popcontainer'
){
document
.
body
.
removeChild
(
m
);
}
},
false
);
/**
* @param {function} cb
*/
const
closeWin
=
(
cb
)
=>
{
document
.
body
.
removeChild
(
m
);
if
(
typeof
cb
==
'function'
)
{
try
{
cb
()
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
}
T
=
<
T
closeWin
=
{
closeWin
}
data
=
{
data
}
call
=
{
call
}
/
>
ReactDOM
.
render
(
T
,
m
);
},
/**刷新页面 */
flushPage
:
()
=>
{
let
event
=
new
Event
(
"flushPage"
);
document
.
dispatchEvent
(
event
)
},
/**切换页面 */
// changePage: (enumPageKey = -1) => {
// // if(enumPageKey == Enum.Page.Pageindex){
// // document.dispatchEvent(new Event("remove"))
// // }
// let event = new CustomEvent("changePage", { detail: { id: enumPageKey } });
// document.dispatchEvent(event)
// }
changePage
:
(
enumPageKey
=
-
1
,
data
)
=>
{
let
event
=
new
CustomEvent
(
"changePage"
,
{
detail
:
{
id
:
enumPageKey
,
data
:
data
}
});
document
.
dispatchEvent
(
event
)
}
}
export
default
ViewCtrl
\ No newline at end of file
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