Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
375a2325
Commit
375a2325
authored
Jan 26, 2021
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mayi
parent
fd250a8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
47 deletions
+15
-47
src/utils/mayi.js
+15
-47
No files found.
src/utils/mayi.js
View file @
375a2325
...
...
@@ -10,20 +10,21 @@ export function $themeToLink(data) {
console
.
log
(
'393939'
,
footerVal
)
let
type
=
data
.
type
;
// 历史数据
if
(
type
==
undefined
||
type
==
'undefined'
)
{
if
(
data
.
length
>
0
)
{
// this.$nuxt.$router.push(data);
toPage
(
data
)
}
return
}
// 底部导航跳转
let
parseLink
=
getUrlofLink
(
data
)
let
parseLink
=
getUrlofLink
(
data
)
let
isFooter
=
footerVal
.
findIndex
(
item
=>
{
return
item
.
link
.
link
==
parseLink
})
if
(
isFooter
>
-
1
)
{
if
(
isFooter
>
-
1
)
{
wx
.
switchTab
({
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isFooter
}
/main`
,
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isFooter
}
/main`
,
})
return
}
...
...
@@ -35,76 +36,43 @@ export function $themeToLink(data) {
}
else
if
(
type
==
1
)
{
//h5页面
//兼容
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
// this.$nuxt.$router.push(data.link);
toPage
(
data
.
link
)
}
else
{
if
(
data
.
link
.
startsWith
(
'http'
)
||
data
.
link
.
startsWith
(
'https'
))
{
// if (this.$store.state.miniProgram == 1 || this.$store.state.miniProgram == 2) {
wx
.
miniProgram
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
// } else {
// window.location = data.link
// }
}
else
{
window
.
location
.
href
=
data
.
link
;
wx
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
}
}
}
else
if
(
type
==
1.1
)
{
//小程序页面 可能增加登录态拦截
if
(
this
.
$store
.
state
.
miniProgram
==
1
||
this
.
$store
.
state
.
miniProgram
==
2
)
{
wx
.
miniProgram
.
navigateTo
({
url
:
data
.
link
});
}
else
{
// Toast("暂不支持");
}
wx
.
navigateTo
({
url
:
data
.
link
});
}
else
if
(
type
==
1.2
)
{
//第三方链接
if
(
data
.
link
==
'outerChain:businessCenter'
)
{
// 进入商家中心外链
let
url
=
`
${
config
.
GUIDE_URL
}
/login?mixid=
${
this
.
$nuxt
.
$route
.
query
.
mixid
}
&back=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
;
w
indow
.
location
.
href
=
url
;
w
x
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
url
)
})
;
return
}
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
// this.$nuxt.$router.push(data.link);
toPage
(
data
.
link
)
}
else
{
if
(
this
.
$store
.
state
.
miniProgram
==
1
||
this
.
$store
.
state
.
miniProgram
==
2
)
{
$mp
.
miniProgram
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
}
else
{
window
.
location
.
href
=
data
.
link
}
wx
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
}
}
else
if
(
type
==
2
)
{
//功能
let
featureType
=
data
.
feature
.
type
;
if
(
featureType
==
'themeCouponClick'
||
featureType
==
0
)
{
//优惠券
this
.
$themeCouponClick
(
data
.
feature
.
value
.
couponCode
,
data
.
feature
.
value
);
//
this.$themeCouponClick(data.feature.value.couponCode, data.feature.value);
}
else
if
(
featureType
==
1
)
{
//分享
console
.
log
(
'是分享了。。。。'
,
cb
);
// if (data.type == 2 && data.feature.type == 1) {
// //分享
// this.$nuxt.$SHARE({
// itemList: data.feature.value
// });
// }
console
.
log
(
'是分享了。。。。'
);
}
else
if
(
featureType
==
"themeMemberCardClick"
||
featureType
==
2
)
{
//会员卡
// this.$themeMemberCardClick(data.feature.value);
}
}
else
if
(
type
==
3
)
{
//小程序跳转到小程序
// if (this.$store.state.miniProgram == 1 || this.$store.state.miniProgram == 2) {
// if (this.$store.getters['sceneModule/flushbonadingVisible']) {
// $mp.miniProgram.navigateTo({
// url: `/pages/toMini/toMini?weappPage=${encodeURIComponent(data.link)}&weappAppId=${data.name}`,
// })
// return
// }
// $mp.miniProgram.navigateTo({
// url: `/pages/toMini/main?weappPage=${encodeURIComponent(data.link)}&weappAppId=${data.name}`,
// })
// } else {
// Toast("暂不支持");
// }
wx
.
navigateTo
({
url
:
`/pages/toMini/main?weappPage=
${
encodeURIComponent
(
data
.
link
)}
&weappAppId=
${
data
.
name
}
`
,
})
}
else
{
//向后兼容
if
(
data
.
length
>
0
)
{
t
his
.
$nuxt
.
$router
.
push
(
data
.
link
);
t
oPage
(
data
.
link
);
}
}
}
...
...
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