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
240641a7
Commit
240641a7
authored
May 06, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理活动页用户新橙时的导航链接参数传递
parent
cb299a12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
6 deletions
+36
-6
nav.config.ts
app/web/config/nav.config.ts
+1
-1
index.ts
app/web/page/activity/view/activity/index.ts
+35
-5
No files found.
app/web/config/nav.config.ts
View file @
240641a7
export
const
home
=
{
export
const
home
=
{
app
:
'
xyqb://homepage
'
,
app
:
'
xyqb://homepage
'
,
wxmp
:
'
/pages/index/index
'
,
wxmp
:
'
/pages/index/index
'
,
h5
:
'
https://xincheng.q-gp.com
/
'
h5
:
'
https://xincheng.q-gp.com
'
};
};
export
const
shopcart
=
{
export
const
shopcart
=
{
...
...
app/web/page/activity/view/activity/index.ts
View file @
240641a7
...
@@ -277,8 +277,27 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
...
@@ -277,8 +277,27 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
}
}
}
}
}
}
// 添加或修改url中的参数
addOrEditUrlParams
(
url
,
paramName
,
replaceWith
)
{
if
(
url
.
indexOf
(
paramName
)
>
-
1
)
{
const
re
=
/
(
' + paramName + '=
)([^
&
]
*
)
/gi
;
url
=
url
.
replace
(
re
,
paramName
+
'
=
'
+
replaceWith
);
}
else
{
const
paraStr
=
paramName
+
'
=
'
+
replaceWith
;
const
idx
=
url
.
indexOf
(
'
?
'
);
if
(
idx
<
0
)
{
url
+=
'
?
'
;
}
else
if
(
idx
>=
0
&&
idx
!==
url
.
length
-
1
)
{
url
+=
'
&
'
;
}
url
=
url
+
paraStr
;
}
return
url
;
}
handleNavUrl
(
nav
,
isCurrent
)
{
handleNavUrl
(
nav
,
isCurrent
)
{
if
(
isCurrent
)
{
return
;
}
if
(
isCurrent
)
{
return
;
}
// 用于传递新橙参数,避免新橙H5活动中含有遮罩层
const
{
vccChannel
,
fromHost
}
=
this
.
$route
.
query
;
const
{
pageType
,
pageUrl
}
=
nav
;
const
{
pageType
,
pageUrl
}
=
nav
;
console
.
log
(
isApp
,
isWxMp
,
pageType
);
console
.
log
(
isApp
,
isWxMp
,
pageType
);
let
nativeBridge
;
let
nativeBridge
;
...
@@ -304,7 +323,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
...
@@ -304,7 +323,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
mpBridge
=
null
;
}
else
{
}
else
{
window
.
location
.
href
=
home
.
h5
;
let
url
=
home
.
h5
;
if
(
vccChannel
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
vccChannel
'
,
vccChannel
);
}
if
(
fromHost
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
fromHost
'
,
fromHost
);
}
window
.
location
.
href
=
url
;
}
}
}
}
if
(
pageUrl
===
'
shopcart
'
)
{
if
(
pageUrl
===
'
shopcart
'
)
{
...
@@ -327,7 +349,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
...
@@ -327,7 +349,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
mpBridge
=
null
;
}
else
{
}
else
{
window
.
location
.
href
=
shopcart
.
h5
;
let
url
=
shopcart
.
h5
;
if
(
vccChannel
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
vccChannel
'
,
vccChannel
);
}
if
(
fromHost
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
fromHost
'
,
fromHost
);
}
window
.
location
.
href
=
url
;
}
}
}
}
if
(
pageUrl
===
'
user
'
)
{
if
(
pageUrl
===
'
user
'
)
{
...
@@ -350,7 +375,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
...
@@ -350,7 +375,10 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
mpBridge
=
null
;
}
else
{
}
else
{
window
.
location
.
href
=
user
.
h5
;
let
url
=
user
.
h5
;
if
(
vccChannel
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
vccChannel
'
,
vccChannel
);
}
if
(
fromHost
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
fromHost
'
,
fromHost
);
}
window
.
location
.
href
=
url
;
}
}
}
}
return
;
return
;
...
@@ -373,9 +401,11 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
...
@@ -373,9 +401,11 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
mpBridge
=
null
;
}
else
{
}
else
{
window
.
location
.
href
=
pageUrl
;
let
url
=
pageUrl
;
if
(
vccChannel
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
vccChannel
'
,
vccChannel
);
}
if
(
fromHost
)
{
url
=
this
.
addOrEditUrlParams
(
url
,
'
fromHost
'
,
fromHost
);
}
window
.
location
.
href
=
url
;
}
}
// 活动页面及导航页面
}
}
}
}
...
...
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