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) {
...
@@ -10,20 +10,21 @@ export function $themeToLink(data) {
console
.
log
(
'393939'
,
footerVal
)
console
.
log
(
'393939'
,
footerVal
)
let
type
=
data
.
type
;
let
type
=
data
.
type
;
// 历史数据
if
(
type
==
undefined
||
type
==
'undefined'
)
{
if
(
type
==
undefined
||
type
==
'undefined'
)
{
if
(
data
.
length
>
0
)
{
if
(
data
.
length
>
0
)
{
// this.$nuxt.$router.push(data);
toPage
(
data
)
}
}
return
return
}
}
// 底部导航跳转
// 底部导航跳转
let
parseLink
=
getUrlofLink
(
data
)
let
parseLink
=
getUrlofLink
(
data
)
let
isFooter
=
footerVal
.
findIndex
(
item
=>
{
let
isFooter
=
footerVal
.
findIndex
(
item
=>
{
return
item
.
link
.
link
==
parseLink
return
item
.
link
.
link
==
parseLink
})
})
if
(
isFooter
>
-
1
)
{
if
(
isFooter
>
-
1
)
{
wx
.
switchTab
({
wx
.
switchTab
({
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isFooter
}
/main`
,
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isFooter
}
/main`
,
})
})
return
return
}
}
...
@@ -35,76 +36,43 @@ export function $themeToLink(data) {
...
@@ -35,76 +36,43 @@ export function $themeToLink(data) {
}
else
if
(
type
==
1
)
{
//h5页面
}
else
if
(
type
==
1
)
{
//h5页面
//兼容
//兼容
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
// this.$nuxt.$router.push(data.link);
toPage
(
data
.
link
)
toPage
(
data
.
link
)
}
else
{
}
else
{
if
(
data
.
link
.
startsWith
(
'http'
)
||
data
.
link
.
startsWith
(
'https'
))
{
if
(
data
.
link
.
startsWith
(
'http'
)
||
data
.
link
.
startsWith
(
'https'
))
{
// if (this.$store.state.miniProgram == 1 || this.$store.state.miniProgram == 2) {
wx
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
wx
.
miniProgram
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
// } else {
// window.location = data.link
// }
}
else
{
window
.
location
.
href
=
data
.
link
;
}
}
}
}
}
else
if
(
type
==
1.1
)
{
//小程序页面 可能增加登录态拦截
}
else
if
(
type
==
1.1
)
{
//小程序页面 可能增加登录态拦截
if
(
this
.
$store
.
state
.
miniProgram
==
1
||
this
.
$store
.
state
.
miniProgram
==
2
)
{
wx
.
navigateTo
({
url
:
data
.
link
});
wx
.
miniProgram
.
navigateTo
({
url
:
data
.
link
});
}
else
{
// Toast("暂不支持");
}
}
else
if
(
type
==
1.2
)
{
//第三方链接
}
else
if
(
type
==
1.2
)
{
//第三方链接
if
(
data
.
link
==
'outerChain:businessCenter'
)
{
if
(
data
.
link
==
'outerChain:businessCenter'
)
{
// 进入商家中心外链
// 进入商家中心外链
let
url
=
`
${
config
.
GUIDE_URL
}
/login?mixid=
${
this
.
$nuxt
.
$route
.
query
.
mixid
}
&back=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
;
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
return
}
}
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
if
(
data
.
link
.
substring
(
0
,
1
)
==
"/"
)
{
// this.$nuxt.$router.push(data.link);
toPage
(
data
.
link
)
toPage
(
data
.
link
)
}
else
{
}
else
{
if
(
this
.
$store
.
state
.
miniProgram
==
1
||
this
.
$store
.
state
.
miniProgram
==
2
)
{
wx
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
$mp
.
miniProgram
.
navigateTo
({
url
:
'/pages/wxArticle/main?link='
+
encodeURIComponent
(
data
.
link
)
});
}
else
{
window
.
location
.
href
=
data
.
link
}
}
}
}
else
if
(
type
==
2
)
{
//功能
}
else
if
(
type
==
2
)
{
//功能
let
featureType
=
data
.
feature
.
type
;
let
featureType
=
data
.
feature
.
type
;
if
(
featureType
==
'themeCouponClick'
||
featureType
==
0
)
{
//优惠券
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
)
{
//分享
}
else
if
(
featureType
==
1
)
{
//分享
console
.
log
(
'是分享了。。。。'
,
cb
);
console
.
log
(
'是分享了。。。。'
);
// if (data.type == 2 && data.feature.type == 1) {
// //分享
// this.$nuxt.$SHARE({
// itemList: data.feature.value
// });
// }
}
else
if
(
featureType
==
"themeMemberCardClick"
||
featureType
==
2
)
{
//会员卡
}
else
if
(
featureType
==
"themeMemberCardClick"
||
featureType
==
2
)
{
//会员卡
// this.$themeMemberCardClick(data.feature.value);
// this.$themeMemberCardClick(data.feature.value);
}
}
}
else
if
(
type
==
3
)
{
//小程序跳转到小程序
}
else
if
(
type
==
3
)
{
//小程序跳转到小程序
// if (this.$store.state.miniProgram == 1 || this.$store.state.miniProgram == 2) {
wx
.
navigateTo
({
// if (this.$store.getters['sceneModule/flushbonadingVisible']) {
url
:
`/pages/toMini/main?weappPage=
${
encodeURIComponent
(
data
.
link
)}
&weappAppId=
${
data
.
name
}
`
,
// $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("暂不支持");
// }
}
else
{
}
else
{
//向后兼容
//向后兼容
if
(
data
.
length
>
0
)
{
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