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

merge-requests/67/head
xiaoguang 3 years ago
parent 96835cbc3a
commit 862d0e2152

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

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

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

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

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

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

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

Loading…
Cancel
Save