Commit 375a2325 by 程默

fix mayi

parent fd250a8e
......@@ -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)}`;
window.location.href = url;
wx.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) {
this.$nuxt.$router.push(data.link);
toPage(data.link);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment