king
2018-09-29 31573a0912c1971a9043b3f9294f643c7d60a2aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
  <div class="goodsclass">
    <div class="row border-bottom-1" v-for="(goodsclass, index) in goodsclasses" :key="index">
      <div class="col-2">
        <h4 v-text="goodsclass.title"></h4>
        <ul>
          <li v-for="item in goodsclass.data" :key="item.type">
            <a href="javascript:;" @click="jumpmenu(item)" v-text="item.name"></a>
          </li>
        </ul>
      </div>
      <div class="col-2">
        <img :src="goodsclass.imgurl" alt="">
      </div>
    </div>
    <bottom-line-component v-if="message" :message="message"></bottom-line-component>
    <tab-bar-component v-if="tabMenu" :menu="tabMenu"></tab-bar-component>
  </div>
</template>
 
<script>
import {dict} from '../store/dictionary'
import {mainmenu} from '../store/menulist'
import {goodsclassData} from '../store/mockdata'
import bottomLineComponent from '../components/bottomLineComponent'
import tabBarComponent from '../components/tabBarComponent'
export default {
  name: 'goodsclass',
  components: {tabBarComponent, bottomLineComponent},
  data () {
    return {
      tabMenu: null,
      goodsclasses: null,
      message: null
    }
  },
  methods: {
    jumpmenu (item) {
      this.$router.push({name: 'goods', params: {type: item.type}})
    }
  },
  mounted: function () {
    this.tabMenu = mainmenu.map(item => {
      if (item.view === this.$route.name) {
        item.active = true
      } else {
        item.active = false
      }
      return item
    })
    setTimeout(() => {
      this.goodsclasses = JSON.parse(JSON.stringify(goodsclassData))
      this.message = dict.bottomtip
    }, 1000)
  }
}
</script>
 
<style scoped>
.goodsclass {
  overflow: hidden;
  padding-bottom: 50px;
}
.goodsclass img {
  width: 100%;
}
.goodsclass h4 {
  margin: 10px 0px 10px 20px;
  font-size: 18px;
  color: #EA2E55;
}
.goodsclass ul li {
  line-height: 35px;
  margin-left: 20px;
  font-size: 16px;
  list-style-type: none;
}
.goodsclass a {
  color: #000000;
}
</style>