|
|
@ -9,6 +9,20 @@
|
|
|
|
<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-image
|
|
|
|
|
|
|
|
@click="onAdvBannerClick(1)"
|
|
|
|
|
|
|
|
:src="banner1"
|
|
|
|
|
|
|
|
fit="cover"
|
|
|
|
|
|
|
|
></el-image>
|
|
|
|
|
|
|
|
</el-carousel-item>
|
|
|
|
|
|
|
|
<el-carousel-item>
|
|
|
|
|
|
|
|
<el-image
|
|
|
|
|
|
|
|
@click="onAdvBannerClick(2)"
|
|
|
|
|
|
|
|
:src="banner2"
|
|
|
|
|
|
|
|
fit="cover"
|
|
|
|
|
|
|
|
></el-image>
|
|
|
|
|
|
|
|
</el-carousel-item>
|
|
|
|
<el-carousel-item v-for="item in bannerList" :key="item.id">
|
|
|
|
<el-carousel-item v-for="item in bannerList" :key="item.id">
|
|
|
|
<el-image
|
|
|
|
<el-image
|
|
|
|
@click="onBannerClick(item.id)"
|
|
|
|
@click="onBannerClick(item.id)"
|
|
|
@ -24,6 +38,8 @@ export default {
|
|
|
|
name: "HomtBanner",
|
|
|
|
name: "HomtBanner",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
banner1: require("~/assets/img/home/banner1.jpg"),
|
|
|
|
|
|
|
|
banner2: require("~/assets/img/home/banner2.jpg"),
|
|
|
|
bannerList: [
|
|
|
|
bannerList: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
url: "https://cdn.mashibing.com/shop-pc/goods13.jpg",
|
|
|
|
url: "https://cdn.mashibing.com/shop-pc/goods13.jpg",
|
|
|
@ -45,6 +61,13 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
onAdvBannerClick(i) {
|
|
|
|
|
|
|
|
if (i === 1) {
|
|
|
|
|
|
|
|
window.open(`https://www.mashibing.com/live/1530`);
|
|
|
|
|
|
|
|
} else if (i === 2) {
|
|
|
|
|
|
|
|
window.open(`https://www.mashibing.com/free/1373`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
onBannerClick(goodsId) {
|
|
|
|
onBannerClick(goodsId) {
|
|
|
|
window.open(`${location.origin}/goods/detail/${goodsId}`);
|
|
|
|
window.open(`${location.origin}/goods/detail/${goodsId}`);
|
|
|
|
},
|
|
|
|
},
|
|
|
|