|
|
@@ -1,18 +1,9 @@
|
|
|
<template>
|
|
|
<div class="recommend-brand">
|
|
|
+ <div class="brand-toggle">
|
|
|
+ <toggle-store/>
|
|
|
+ </div>
|
|
|
<div class="brand-content">
|
|
|
- <div class="brand-index-tab">
|
|
|
- <div class="index-head">
|
|
|
- <img src="/images/brandCenter/search-index.png"/>品牌索引
|
|
|
- </div>
|
|
|
- <div style="padding-top: 8px;">
|
|
|
- <div class="brand-index-group index-group" v-for="(indexGroup, index) in indexGroups">
|
|
|
- <span v-if="index == 5"></span>
|
|
|
- <a @click="goBrandIndex(group_index)" v-for="group_index in indexGroup" :class="{'active': activeIndex==group_index}">{{group_index}}</a>
|
|
|
- <span v-if="index == 5"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div v-swiper:mySwiper="swiperOption" class="swiper-container">
|
|
|
<div class="swiper-wrapper">
|
|
|
<div class="swiper-slide" v-for="banner in sliceBanners">
|
|
|
@@ -29,21 +20,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+ import ToggleStore from '~components/provider/ToggleStore.vue'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
- indexGroups: [
|
|
|
- ['A', 'B', 'C', 'D', 'E'],
|
|
|
- ['F', 'G', 'H', 'I', 'J'],
|
|
|
- ['K', 'L', 'M', 'N', 'O'],
|
|
|
- ['P', 'Q', 'R', 'S', 'T'],
|
|
|
- ['U', 'V', 'W', 'X', 'Y', 'Z'],
|
|
|
- ['0~9']
|
|
|
- ],
|
|
|
- nowPage: 1,
|
|
|
- keyword: '',
|
|
|
- isSearch: false,
|
|
|
- activeSlide: 0,
|
|
|
swiperOption: {
|
|
|
autoplay: 6000,
|
|
|
pagination: '.swiper-pagination',
|
|
|
@@ -65,67 +45,15 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- filters: {
|
|
|
- applicationFilter: function (str) {
|
|
|
- return str.split(',').join('|')
|
|
|
- },
|
|
|
- introduceFilter: function (title) {
|
|
|
- if (title === '') {
|
|
|
- return title
|
|
|
- }
|
|
|
- let len = 0
|
|
|
- let index = 0
|
|
|
- for (let i = 0; i < title.length; i++) {
|
|
|
- if (index === 0 && title.charAt(i).charCodeAt(0) > 255) {
|
|
|
- len = len + 2
|
|
|
- } else {
|
|
|
- len++
|
|
|
- }
|
|
|
- if (len > 60) {
|
|
|
- index = i
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (index > 0) {
|
|
|
- return title.substring(0, index) + '...'
|
|
|
- } else {
|
|
|
- return title
|
|
|
- }
|
|
|
- }
|
|
|
+ components: {
|
|
|
+ ToggleStore
|
|
|
},
|
|
|
computed: {
|
|
|
- floors () {
|
|
|
- return this.$store.state.floor.list.data
|
|
|
- },
|
|
|
banners () {
|
|
|
return this.$store.state.carousel.brandCarousel.data
|
|
|
},
|
|
|
sliceBanners () {
|
|
|
return this.banners.data && this.banners.data.length ? this.banners.data.slice(0, 3) : []
|
|
|
- },
|
|
|
- activeIndex () {
|
|
|
- return !this.isSearch ? this.$route.params.initial : ''
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- goBrandIndex: function (index) {
|
|
|
- if (index === this.$route.params.initial) {
|
|
|
- this.initParams()
|
|
|
- this.reloadData()
|
|
|
- } else {
|
|
|
- this.$router.push('/product/brand/brandList/' + index)
|
|
|
-// window.location.href = '/product/brand/brandList/' + index + '#index'
|
|
|
-// window.open('/product/brand/brandList/' + index + '#index', '_self')
|
|
|
- }
|
|
|
- },
|
|
|
- initParams: function () {
|
|
|
- this.nowPage = 1
|
|
|
- this.isSearch = false
|
|
|
- this.keyword = ''
|
|
|
- this.reloadData()
|
|
|
- },
|
|
|
- reloadData: function () {
|
|
|
- !this.isSearch ? this.$store.dispatch('product/loadBrandsPager', {'initial': this.$route.params.initial, 'page': this.nowPage, 'count': this.pageSize, 'keyword': this.keyword}) : this.searchData()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -135,63 +63,13 @@
|
|
|
width: 1190px;
|
|
|
margin: 0 auto;
|
|
|
padding-top: 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ .brand-toggle {
|
|
|
+ float: left;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
.brand-content{
|
|
|
- overflow: hidden;
|
|
|
- .brand-index-tab {
|
|
|
- margin-right: 15px;
|
|
|
- float: left;
|
|
|
- width: 220px;
|
|
|
- height: 400px;
|
|
|
- background-color: #ffffff;
|
|
|
- border-radius: 5px;
|
|
|
- /*border: solid 1px #d2d2d2;*/
|
|
|
- .index-head {
|
|
|
- padding-left: 10px;
|
|
|
- width: 220px;
|
|
|
- height: 34px;
|
|
|
- line-height: 34px;
|
|
|
- background-color: #2496f1;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: bold;
|
|
|
- border-top-left-radius: 5px;
|
|
|
- border-top-right-radius: 5px;
|
|
|
- color: #fff;
|
|
|
- img{
|
|
|
- margin-right: 6px;
|
|
|
- margin-top: -2px;
|
|
|
- }
|
|
|
- }
|
|
|
- .brand-index-group {
|
|
|
- margin: 0 auto 22px;
|
|
|
- width: 200px;
|
|
|
- height: 40px;
|
|
|
- background-color: rgba(36, 150, 241, 0.1);
|
|
|
- border-radius: 4px;
|
|
|
- /*opacity: 0.1;*/
|
|
|
- a{
|
|
|
- display: inline-block;
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- text-align: center;
|
|
|
- font-size: 16px;
|
|
|
- color: #666;
|
|
|
- border-radius: 5px;
|
|
|
- /*background-color: #2496f1;*/
|
|
|
- &:hover{
|
|
|
- background-color: #2496f1;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
- }
|
|
|
- &:last-child{
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- &:last-child a{
|
|
|
- letter-spacing: 15px;
|
|
|
- padding-left: 12px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ float: left;
|
|
|
}
|
|
|
.swiper-container {
|
|
|
z-index: 2;
|