feat: 消息/购物车页面跳转前前置登录拦截

merge-requests/11/head
xiaoguang 3 years ago
parent 3aafeee978
commit 03606dadb0

@ -58,7 +58,7 @@
<div class="header-wrap-content--line"></div> <div class="header-wrap-content--line"></div>
<div <div
class="header-wrap-content__common flex flex-middle" class="header-wrap-content__common flex flex-middle"
@click="onJumpPersonalPage('order')" @click="onJumpPersonalPage('order/list')"
> >
<img src="@/static/images/layout/icon-order.png" /> <img src="@/static/images/layout/icon-order.png" />
<span>我的订单</span> <span>我的订单</span>
@ -116,10 +116,10 @@ export default {
handleCommandClick(event) { handleCommandClick(event) {
switch (event) { switch (event) {
case MENU_VALUE.PERSONAL: case MENU_VALUE.PERSONAL:
this.$router.push("/account"); this.$router.push("/account/userInfo");
break; break;
case MENU_VALUE.ADDRESS: case MENU_VALUE.ADDRESS:
this.$router.push("/account"); this.$router.push("/account/address");
break; break;
case MENU_VALUE.LOGON_OUT: case MENU_VALUE.LOGON_OUT:
this.$store.commit("setLoginOut"); this.$store.commit("setLoginOut");
@ -127,8 +127,11 @@ export default {
}, },
// //
onJumpPersonalPage(type) { onJumpPersonalPage(path) {
this.$router.push(`/account?type=${type}`); if (!this.$isLoginValidate()) {
return;
}
this.$router.push(`/account/${path}`);
}, },
}, },
}; };

@ -65,14 +65,14 @@
<img src="@/static/images/layout/icon-search.png" /> <img src="@/static/images/layout/icon-search.png" />
</div> </div>
</div> </div>
<nuxt-link <div
class="box-wrap-right__cart flex flex-middle" class="box-wrap-right__cart flex flex-middle"
to="/cart" @click="onJumpCart"
> >
<img src="@/static/images/layout/icon-shop.png" /> <img src="@/static/images/layout/icon-shop.png" />
<span>购物车</span> <span>购物车</span>
<div class="wrap-right-cart__tip">3</div> <div class="wrap-right-cart__tip">3</div>
</nuxt-link> </div>
</div> </div>
</div> </div>
<div class="bar-header-box__tab flex flex-middle"> <div class="bar-header-box__tab flex flex-middle">
@ -223,6 +223,12 @@ export default {
this.tabPath = value; this.tabPath = value;
this.$router.push({ path: value }); this.$router.push({ path: value });
}, },
onJumpCart() {
if (!this.$isLoginValidate()) {
return;
}
this.$router.push("/cart");
},
// //
async getCategroyData() { async getCategroyData() {
const { result } = await ApiGetCategoryOneList(); const { result } = await ApiGetCategoryOneList();
@ -243,7 +249,6 @@ export default {
} }
}, },
onSearch() { onSearch() {
//
this.$router.push({ this.$router.push({
path: "/goods/list", path: "/goods/list",
query: { query: {

Loading…
Cancel
Save