2021-05-13 11:03:32 +08:00
|
|
|
/** 配置楼层模块的跳转 */
|
2021-05-18 16:29:34 +08:00
|
|
|
export function modelNavigateTo(item) {
|
2022-09-06 19:46:00 +08:00
|
|
|
let val = item.url || item;
|
|
|
|
console.log(item);
|
|
|
|
// return;
|
|
|
|
switch (val.___type || item.type) {
|
2021-05-13 11:03:32 +08:00
|
|
|
case "goods":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "category":
|
2021-06-08 09:22:00 +08:00
|
|
|
if (val.id) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/navigation/search/searchPage?category=${val.id}`,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/navigation/search/searchPage`,
|
|
|
|
});
|
|
|
|
}
|
2021-05-13 11:03:32 +08:00
|
|
|
break;
|
2021-11-04 10:53:52 +08:00
|
|
|
case "shops":
|
2021-05-13 11:03:32 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/product/shopPage?id=${val.id}`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
// 活动
|
|
|
|
case "marketing":
|
|
|
|
uni.navigateTo({
|
2022-06-07 15:34:09 +08:00
|
|
|
url: "/pages/product/goods?id=" + val.id + "goodsId=" + val.goodsId,
|
2021-05-13 11:03:32 +08:00
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "pages":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: val.___path + "?id=" + val.id + "&title=" + val.title,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "other":
|
2022-09-06 19:46:00 +08:00
|
|
|
switch (val.title || item.title) {
|
2021-05-13 11:03:32 +08:00
|
|
|
case "首页":
|
|
|
|
uni.switchTab({
|
2021-06-08 09:22:00 +08:00
|
|
|
url: `/pages/tabbar/home/index`,
|
2021-05-13 11:03:32 +08:00
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "购物车":
|
|
|
|
uni.switchTab({
|
|
|
|
url: `/pages/tabbar/cart/cartList`,
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
case "个人中心":
|
|
|
|
uni.switchTab({
|
|
|
|
url: `/pages/tabbar/user/my`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "收藏商品":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/mine/myCollect`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "我的订单":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/order/myOrder?status=0`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "领券中心":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/cart/coupon/couponCenter`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "签到":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/mine/signIn`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "秒杀频道":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/promotion/seckill`,
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case "拼团频道":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/promotion/joinGroup`,
|
|
|
|
});
|
|
|
|
break;
|
2021-06-21 18:14:09 +08:00
|
|
|
case "小程序直播":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/promotion/lives`,
|
|
|
|
});
|
|
|
|
break;
|
2021-07-15 15:10:27 +08:00
|
|
|
case "砍价":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/promotion/bargain/list`,
|
|
|
|
});
|
|
|
|
break;
|
2021-05-13 11:03:32 +08:00
|
|
|
case "积分商城":
|
2021-07-27 18:14:53 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/promotion/point/pointList`,
|
2021-05-13 11:03:32 +08:00
|
|
|
});
|
|
|
|
break;
|
2021-11-29 09:58:39 +08:00
|
|
|
case "店铺列表":
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages/product/shopList`,
|
|
|
|
});
|
|
|
|
break;
|
2022-09-06 19:46:00 +08:00
|
|
|
default:
|
2022-04-21 14:58:18 +08:00
|
|
|
// #ifdef H5
|
2022-09-06 19:46:00 +08:00
|
|
|
window.location.href = val.url || item.link;
|
2022-04-21 14:58:18 +08:00
|
|
|
// #endif
|
|
|
|
// #ifdef APP-PLUS
|
2022-09-06 19:46:00 +08:00
|
|
|
plus.runtime.openURL(val.url || item.link) //不需要拼接\
|
2022-04-21 14:58:18 +08:00
|
|
|
// #endif
|
|
|
|
break;
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|