Merge branch 'feature/task1.0.0_xg' into 'feature/task1.0.0'

feat: 首页点击新开浏览器窗口跳转

See merge request yanxuan-frontend/shop-pc!67
merge-requests/68/head
肖广 2 years ago
commit 62d587d575

@ -125,13 +125,9 @@ export default {
onCategoryClick(id, levelType) {
this.categroyVisible = false;
this.categroyTwoVisible = false;
this.$router.push({
path: "/goods/list",
query: {
id,
levelType,
},
});
window.open(
`${location.origin}/goods/list?id=${id}&levelType=${levelType}`
);
},
//
handleCategoryChange(val) {

@ -138,10 +138,10 @@ export default {
handleCommandClick(event) {
switch (event) {
case MENU_VALUE.PERSONAL:
this.$router.push("/account/home");
window.open(`${location.origin}/account/home`);
break;
case MENU_VALUE.ADDRESS:
this.$router.push("/account/address");
window.open(`${location.origin}/account/address`);
break;
case MENU_VALUE.LOGON_OUT:
this.$store.dispatch("logout");
@ -153,7 +153,7 @@ export default {
if (!this.$isLoginValidate()) {
return;
}
this.$router.push(`/account/${path}`);
window.open(`${location.origin}/account/${path}`);
},
},
};
@ -162,7 +162,7 @@ export default {
.header-info-bar__dropdown,
.header-info-bar__popover {
.popper__arrow {
display: none;
display: none !important;
}
}
</style>

@ -30,7 +30,7 @@
src="~/assets/img/layout/icon-search-sticky.png"
@click="$router.push('/goods/list')"
/>
<div class="header-wrap-icons__shop" @click="$router.push('/cart')">
<div class="header-wrap-icons__shop" @click="onOpenCartPage">
<img src="~/assets/img/layout/icon-shop-sticky.png" />
<div
v-if="cartCount > 0"
@ -74,10 +74,14 @@
v-model="searchContent"
clearable
placeholder="请输入商品名称"
></el-input>
@keyup.enter.native="onSearch"
>
</el-input>
</div>
<div
slot="suffix"
class="search-icon flex flex-center flex-middle"
@keyup.enter.native="onSearch"
@click="onSearch"
>
<img src="~/assets/img/layout/icon-search.png" />
@ -175,7 +179,7 @@ export default {
onTabSelect(value) {
this.tabPath = value;
this.searchContent = "";
this.$router.push({ path: value });
window.open(`${location.origin}${value}`);
},
onSearch() {
this.$router.push({
@ -185,6 +189,9 @@ export default {
},
});
},
onOpenCartPage() {
window.open(`${location.origin}/cart`);
},
},
};
</script>

@ -9,12 +9,12 @@
<template>
<div class="home-banner">
<el-carousel height="360px" indicator-position="outside">
<el-carousel-item
v-for="item in bannerList"
:key="item.id"
@click="onBannerClick(item.id)"
>
<el-image :src="item.url" fit="cover"></el-image>
<el-carousel-item v-for="item in bannerList" :key="item.id">
<el-image
@click="onBannerClick(item.id)"
:src="item.url"
fit="cover"
></el-image>
</el-carousel-item>
</el-carousel>
</div>
@ -46,7 +46,7 @@ export default {
},
methods: {
onBannerClick(goodsId) {
window.open(`${location.href}/detail/${goodsId}`);
window.open(`${location.origin}/goods/detail/${goodsId}`);
},
},
};
@ -75,6 +75,7 @@ export default {
.el-image {
width: 100%;
height: 100%;
cursor: pointer;
}
}
}

@ -12,7 +12,7 @@
<div class="home-pick-recommend__products flex flex-middle flex-between">
<!-- 左侧商品一 -->
<div
@click="onJumpGoodsDetal(recommendGoodsOne.id)"
@click="onJumpGoodsDetail(recommendGoodsOne.id)"
class="pick-recommend-products__left"
>
<strong class="home-pick-recommend--title">{{
@ -45,7 +45,7 @@
<div
v-for="(item, index) in recommendArray"
:key="index"
@click="onJumpGoodsDetal(item.id)"
@click="onJumpGoodsDetail(item.id)"
class="recommend-products-right__item"
>
<strong class="home-pick-recommend--title">{{ item.title }}</strong>
@ -84,7 +84,7 @@
<div class="home-pick-new__products flex">
<!-- 左侧商品 -->
<div
@click="onJumpGoodsDetal(newGoodsOne.id)"
@click="onJumpGoodsDetail(newGoodsOne.id)"
class="pick-new-products__left"
>
<img
@ -102,7 +102,7 @@
<div
v-for="(item, index) in newArray"
:key="index"
@click="onJumpGoodsDetal(item.id)"
@click="onJumpGoodsDetail(item.id)"
class="new-products-right__wrap flex flex-middle"
>
<div class="products-right-wrap__cover">
@ -172,11 +172,11 @@ export default {
},
},
methods: {
onJumpGoodsDetal(id) {
this.$router.push(`/goods/detail/${id}`);
onJumpGoodsDetail(id) {
window.open(`${location.origin}/goods/detail/${id}`);
},
onJumpGoodsList(type) {
this.$router.push(`/goods/list?id=${type}`);
window.open(`${location.origin}/goods/list?id=${type}`);
},
},
};
@ -184,6 +184,7 @@ export default {
<style lang="scss" scoped>
.home-pick {
color: #333333;
margin-top: 30px;
&--label {
font-size: 24px;
margin-bottom: 16px;

@ -36,7 +36,6 @@
<div
v-for="(itemChild, indexChild) in item"
:key="itemChild.productId"
@click.stop="onJumpGoodsDetail(itemChild.productId)"
class="carousel-goods-box flex flex-middle"
>
<div
@ -174,10 +173,7 @@ export default {
}, 1e3);
},
onJumpSeckill() {
this.$router.push("/seckill");
},
onJumpGoodsDetail(id) {
this.$router.push(`/goods/detail/${id}`);
window.open(`${location.origin}/seckill`);
},
},
};

@ -260,7 +260,7 @@ export default {
});
},
onJumpGoodsDetail(id) {
this.$router.push(`/goods/detail/${id}`);
window.open(`${location.origin}/goods/detail/${id}`);
},
handleCurrentChange(page) {
this.query.pageIndex = page;

Loading…
Cancel
Save