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

110 lines
2.7 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;
2021-05-13 11:03:32 +08:00
switch (val.___type) {
case "goods":
uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
});
break;
case "category":
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({
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: `/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;
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 "积分商城":
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;
2021-05-13 11:03:32 +08:00
}
break;
}
}