Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks-h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
quantum-blocks-h5
Commits
7acc85c0
Commit
7acc85c0
authored
Aug 18, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 问题调试
parent
d3f65bd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
index.ts
app/web/page/activity/view/activity/index.ts
+26
-2
color.service.ts
app/web/service/color.service.ts
+1
-23
No files found.
app/web/page/activity/view/activity/index.ts
View file @
7acc85c0
import
{
Vue
,
Component
,
Watch
,
Provide
,
Mixins
}
from
'
vue-property-decorator
'
;
import
{
Vue
,
Component
,
Watch
,
Provide
,
Mixins
}
from
'
vue-property-decorator
'
;
import
{
Getter
,
State
,
Mutation
}
from
'
vuex-class
'
;
import
{
Getter
,
State
,
Mutation
}
from
'
vuex-class
'
;
import
Bridge
from
'
@qg/js-bridge
'
;
import
FreedomContainer
from
'
../../component/FreedomContainer/index.vue
'
;
import
FreedomContainer
from
'
../../component/FreedomContainer/index.vue
'
;
import
PageBottomTip
from
'
../../component/PageBottomTip/index.vue
'
;
import
PageBottomTip
from
'
../../component/PageBottomTip/index.vue
'
;
import
GridLayout
from
'
../../component/VueGridLayout/GridLayout.vue
'
;
import
GridLayout
from
'
../../component/VueGridLayout/GridLayout.vue
'
;
...
@@ -7,7 +8,8 @@ import GridItem from '../../component/VueGridLayout/GridItem.vue';
...
@@ -7,7 +8,8 @@ import GridItem from '../../component/VueGridLayout/GridItem.vue';
import
TransformStyleMixin
from
'
@/page/mixins/transformStyle.mixin
'
;
import
TransformStyleMixin
from
'
@/page/mixins/transformStyle.mixin
'
;
import
SaMixin
from
'
@/page/mixins/sa.mixin
'
;
import
SaMixin
from
'
@/page/mixins/sa.mixin
'
;
import
{
getStyle
,
debounce
,
isApp
}
from
'
@/service/utils.service
'
;
import
{
getStyle
,
debounce
,
isApp
}
from
'
@/service/utils.service
'
;
import
{
setAppTitleColor
}
from
'
@/service/color.service
'
;
import
{
hexToRgb
}
from
'
@/service/color.service
'
;
const
jsBridge
=
new
Bridge
();
@
Component
({
components
:
{
FreedomContainer
,
GridLayout
,
GridItem
,
PageBottomTip
},
name
:
'
Activity
'
})
@
Component
({
components
:
{
FreedomContainer
,
GridLayout
,
GridItem
,
PageBottomTip
},
name
:
'
Activity
'
})
export
default
class
Activity
extends
Mixins
(
TransformStyleMixin
,
SaMixin
)
{
export
default
class
Activity
extends
Mixins
(
TransformStyleMixin
,
SaMixin
)
{
@
Getter
(
'
pageData
'
)
pageData
;
@
Getter
(
'
pageData
'
)
pageData
;
...
@@ -78,13 +80,35 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
...
@@ -78,13 +80,35 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
mounted
()
{
mounted
()
{
this
.
targetEle
=
document
.
querySelector
(
'
body
'
);
this
.
targetEle
=
document
.
querySelector
(
'
body
'
);
this
.
showBackTop
=
true
;
this
.
showBackTop
=
true
;
isApp
&&
setAppTitleColor
(
this
.
pageData
.
props
.
titleBgColor
);
isApp
&&
this
.
setAppTitleColor
(
this
.
pageData
.
props
.
titleBgColor
);
}
}
fetchApi
(
options
)
{
fetchApi
(
options
)
{
const
{
store
,
route
}
=
options
;
const
{
store
,
route
}
=
options
;
const
{
pageId
}
=
route
.
params
;
const
{
pageId
}
=
route
.
params
;
return
store
.
dispatch
(
'
getPageDate
'
,
{
pageId
});
return
store
.
dispatch
(
'
getPageDate
'
,
{
pageId
});
}
}
setAppTitleColor
(
bgcolor
=
"
#fff
"
)
{
if
(
!
isApp
&&
!
EASY_ENV_IS_BROWSER
)
return
;
console
.
log
(
'
setAppTitleColor
'
,
bgcolor
);
const
isGradient
=
Array
.
isArray
(
bgcolor
);
let
rgbColor
=
isGradient
?
bgcolor
[
0
]
:
bgcolor
;
if
(
rgbColor
.
toLocaleLowerCase
().
indexOf
(
"
rgb
"
)
===
-
1
)
rgbColor
=
hexToRgb
(
rgbColor
);
const
isDarkContent
=
0.213
*
rgbColor
[
0
]
+
0.715
*
rgbColor
[
1
]
+
0.072
*
rgbColor
[
2
]
<=
255
/
2
;
const
colors
=
isGradient
?
[
bgcolor
[
0
].
substr
(
1
),
bgcolor
[
1
].
substr
(
1
)]
:
[
bgcolor
.
substr
(
1
),
bgcolor
.
substr
(
1
)];
console
.
log
(
'
setAppTitleColor start
'
);
jsBridge
.
run
({
event
:
"
resetNavigationBarColor
"
,
data
:
{
isDarkContent
,
colors
},
callback
()
{
console
.
log
(
'
setAppTitleColor finish
'
);
}
});
}
modifyPoints
()
{
modifyPoints
()
{
const
clientWidth
=
document
.
documentElement
.
clientWidth
>
768
?
375
:
document
.
documentElement
.
clientWidth
;
const
clientWidth
=
document
.
documentElement
.
clientWidth
>
768
?
375
:
document
.
documentElement
.
clientWidth
;
...
...
app/web/service/color.service.ts
View file @
7acc85c0
// tslint:disable
// tslint:disable
import
Bridge
from
'
@qg/js-bridge
'
;
import
{
isApp
}
from
'
./utils.service
'
;
import
{
isApp
}
from
'
./utils.service
'
;
// RGB转HEX
// RGB转HEX
...
@@ -74,25 +73,4 @@ export function isColor(color) {
...
@@ -74,25 +73,4 @@ export function isColor(color) {
var
re2
=
/^rgb
\(([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\)
$/i
;
var
re2
=
/^rgb
\(([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\)
$/i
;
var
re3
=
/^rgba
\(([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
(
1|1.0|0.
[
0-9
])\)
$/i
;
var
re3
=
/^rgba
\(([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
([
0-9
]
|
[
0-9
][
0-9
]
|25
[
0-5
]
|2
[
0-4
][
0-9
]
|
[
0-1
][
0-9
][
0-9
])\\
,
(
1|1.0|0.
[
0-9
])\)
$/i
;
return
re2
.
test
(
color
)
||
re1
.
test
(
color
)
||
re3
.
test
(
color
);
return
re2
.
test
(
color
)
||
re1
.
test
(
color
)
||
re3
.
test
(
color
);
}
}
\ No newline at end of file
export
function
setAppTitleColor
(
bgcolor
=
"
#fff
"
)
{
if
(
!
isApp
&&
!
EASY_ENV_IS_BROWSER
)
return
;
let
jsBridge
=
new
Bridge
();
const
isGradient
=
Array
.
isArray
(
bgcolor
);
let
rgbColor
=
isGradient
?
bgcolor
[
0
]
:
bgcolor
;
if
(
rgbColor
.
toLocaleLowerCase
().
indexOf
(
"
rgb
"
)
===
-
1
)
rgbColor
=
hexToRgb
(
rgbColor
);
const
isDarkContent
=
0.213
*
rgbColor
[
0
]
+
0.715
*
rgbColor
[
1
]
+
0.072
*
rgbColor
[
2
]
<=
255
/
2
;
const
colors
=
isGradient
?
[
bgcolor
[
0
].
substr
(
1
),
bgcolor
[
1
].
substr
(
1
)]
:
[
bgcolor
.
substr
(
1
),
bgcolor
.
substr
(
1
)];
jsBridge
.
run
({
event
:
"
resetNavigationBarColor
"
,
data
:
{
isDarkContent
,
colors
}
});
jsBridge
=
null
;
}
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