Commit 375a2325 by 程默

fix mayi

parent fd250a8e
...@@ -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)}`;
window.location.href = url; wx.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) {
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