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

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

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

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

Loading…
Cancel
Save