lilishop-uniapp/pages/tabbar/home/template/tpl.js

89 lines
2.1 KiB
JavaScript
Raw Normal View History

2021-05-13 11:03:32 +08:00
/** 配置楼层模块的跳转 */
export function modelNavigateTo(item) {
2021-05-13 11:03:32 +08:00
let val = item.url;
switch (val.___type) {
case "goods":
uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
});
break;
case "category":
uni.navigateTo({
url: `/pages/navigation/search/searchPage?category=${val.id}`,
});
break;
case "stores":
uni.navigateTo({
url: `/pages/product/shopPage?id=${val.id}`,
});
break;
// 活动
case "marketing":
uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId + "goodsId=" + val.goodsId,
});
break;
case "pages":
uni.navigateTo({
url: val.___path + "?id=" + val.id + "&title=" + val.title,
});
break;
case "other":
switch (val.title) {
case "首页":
uni.switchTab({
url: `/`,
});
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;
case "积分商城":
uni.switchTab({
url: `/pages/navigation/point/point-mall`,
});
break;
}
break;
}
}