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
c909f4ea
Commit
c909f4ea
authored
Apr 20, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理导航跳转链接的问题
parent
ad6794a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
5 deletions
+110
-5
index.vue
app/web/page/activity/component/BackTop/index.vue
+13
-1
index.ts
app/web/page/activity/view/activity/index.ts
+97
-4
No files found.
app/web/page/activity/component/BackTop/index.vue
View file @
c909f4ea
...
...
@@ -160,7 +160,10 @@ export default {
if
(
EASY_ENV_IS_NODE
)
return
;
const
{
coverImage
,
pageName
,
pageDescribe
,
shareCoverImage
}
=
this
.
pageInfo
;
let
link
=
`
${
window
.
location
.
origin
}${
window
.
location
.
pathname
}
?vccToken={token}&tenantId=
${
localStorage
.
get
(
'
tenantId
'
)
||
''
}
`
;
if
(
this
.
getUrlParamsVal
(
'
navId
'
)
!==
false
&&
this
.
getUrlParamsVal
(
'
index
'
)
!==
false
)
{
// 向分享URL中填充导航ID与位置索引
link
+=
`&navId=
${
this
.
getUrlParamsVal
(
"
navId
"
)}
&index=
${
this
.
getUrlParamsVal
(
'
index
'
)}
`
}
this
.
link
=
link
;
const
defaultTitle
=
+
localStorage
.
get
(
'
tenantId
'
)
===
560761
?
'
羊小咩
'
:
'
活动页
'
;
this
.
shareInfo
=
{
...
...
@@ -210,6 +213,15 @@ export default {
this
.
$refs
.
crBackTop
.
$forceUpdate
();
});
}
},
getUrlParamsVal
(
name
)
{
let
query
=
window
.
location
.
search
.
substring
(
1
);
let
vars
=
query
.
split
(
'
&
'
);
for
(
let
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
let
pair
=
vars
[
i
].
split
(
"
=
"
);
if
(
pair
[
0
]
==
name
)
return
pair
[
1
];
}
return
false
;
}
},
}
...
...
app/web/page/activity/view/activity/index.ts
View file @
c909f4ea
...
...
@@ -16,6 +16,8 @@ import { EventBus } from '@qg/citrus-ui/src/helper/service/eventBus';
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
home
,
shopcart
,
user
}
from
'
@/config/nav.config
'
;
import
{
isWxMp
,
isApp
}
from
'
@/service/utils.service
'
;
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@qg/citrus-ui/src/helper/service/mp
'
;
@
Component
({
components
:
{
FreedomContainer
,
GridLayout
,
GridItem
,
PageBottomTip
,
BackTop
,
EmptyState
},
name
:
'
Activity
'
})
export
default
class
Activity
extends
Mixins
(
TransformStyleMixin
,
BottomNavStyleMixin
,
SaMixin
,
DisableTouchMixin
)
{
...
...
@@ -270,13 +272,104 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
}
}
handleNavUrl
(
nav
,
isCurrent
)
{
console
.
log
(
nav
);
if
(
isCurrent
)
{
return
;
}
const
{
pageType
}
=
nav
;
if
(
pageType
==
1
)
{
// 功能页面
const
{
pageType
,
pageUrl
}
=
nav
;
let
nativeBridge
;
let
mpBridge
;
if
(
+
pageType
===
1
)
{
// 功能页面
if
(
pageUrl
===
'
home
'
)
{
if
(
isApp
)
{
nativeBridge
=
new
Bridge
();
nativeBridge
.
openNewUrl
({
data
:
{
// 需要打开的新链接
newUrl
:
home
.
app
,
},
});
nativeBridge
=
null
;
}
else
if
(
isWxMp
)
{
mpBridge
=
new
MpBridge
();
const
jumpConfig
=
{
// 需要打开的新链接
newUrl
:
home
.
wxmp
,
type
:
'
switchTab
'
};
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
}
else
{
window
.
location
.
href
=
home
.
h5
;
}
}
if
(
pageUrl
===
'
shopcart
'
)
{
if
(
isApp
)
{
nativeBridge
=
new
Bridge
();
nativeBridge
.
openNewUrl
({
data
:
{
// 需要打开的新链接
newUrl
:
shopcart
.
app
,
},
});
nativeBridge
=
null
;
}
else
if
(
isWxMp
)
{
mpBridge
=
new
MpBridge
();
const
jumpConfig
=
{
// 需要打开的新链接
newUrl
:
shopcart
.
wxmp
,
type
:
'
switchTab
'
};
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
}
else
{
window
.
location
.
href
=
shopcart
.
h5
;
}
}
if
(
pageUrl
===
'
user
'
)
{
if
(
isApp
)
{
nativeBridge
=
new
Bridge
();
nativeBridge
.
openNewUrl
({
data
:
{
// 需要打开的新链接
newUrl
:
user
.
app
,
},
});
nativeBridge
=
null
;
}
else
if
(
isWxMp
)
{
mpBridge
=
new
MpBridge
();
const
jumpConfig
=
{
// 需要打开的新链接
newUrl
:
user
.
wxmp
,
type
:
'
switchTab
'
};
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
}
else
{
window
.
location
.
href
=
user
.
h5
;
}
}
return
;
}
else
{
console
.
log
(
isApp
,
isWxMp
);
if
(
isApp
)
{
nativeBridge
=
new
Bridge
();
nativeBridge
.
openNewUrl
({
data
:
{
// 需要打开的新链接
newUrl
:
`xyqb://openHttp?jumpUrl=
${
pageUrl
}
`
},
});
nativeBridge
=
null
;
}
else
if
(
isWxMp
)
{
mpBridge
=
new
MpBridge
();
const
jumpConfig
=
{
// 需要打开的新链接
newUrl
:
pageUrl
,
type
:
'
switchTab
'
};
mpBridge
.
openNewUrl
(
jumpConfig
);
mpBridge
=
null
;
}
else
{
window
.
location
.
href
=
pageUrl
;
}
// 活动页面及导航页面
}
...
...
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