Blame view

src/views/about/index.vue 2.03 KB
4d0a73c0   liuqimichale   项目初始化
1
  <template>
8c48fe84   liuqimichale   关于我们 页面建立
2
3
4
5
6
7
8
9
10
    <div>
      <commonBanner mainTitle="中兴智能交通" subTitle="构建绿色交通 享受安全便利出行"></commonBanner>
      <div class="tab-wrapper">
        <ul class="tab-main widthCommon">
          <li
            v-for="(item, index) in tabData"
            :key="item"
            @click="changeTab(index,item)"
            :class="{tabActive:currentIndex==index}"
7098afd2   liuqimichale   关于我们 页面建立
11
12
          >{{item}}
          </li>
8c48fe84   liuqimichale   关于我们 页面建立
13
14
15
16
17
18
19
20
21
        </ul>
      </div>
      <div class="bread">
        <div class=" widthCommon">
          您所在位置: <span class="pointer" @click="$router.push({name:'home'})">首页</span> -> 产品中心 -> {{name}}
        </div>
      </div>
  
  
7098afd2   liuqimichale   关于我们 页面建立
22
23
24
25
26
27
28
      <div class="widthCommon anchor" style="height: 200px;">1</div>
      <div class="widthCommon anchor" style="height: 400px;">2</div>
      <div class="bgCommon">
        <div class="widthCommon anchor" style="height: 400px;">3</div>
      </div>
      <div class="widthCommon anchor" style="height: 300px;">4</div>
      <div class="widthCommon anchor" style="height: 300px;">5</div>
8c48fe84   liuqimichale   关于我们 页面建立
29
30
  
    </div>
4d0a73c0   liuqimichale   项目初始化
31
32
33
  </template>
  
  <script>
8c48fe84   liuqimichale   关于我们 页面建立
34
  import commonBanner from '@/components/commonBanner'
7098afd2   liuqimichale   关于我们 页面建立
35
  
4d0a73c0   liuqimichale   项目初始化
36
  export default {
8c48fe84   liuqimichale   关于我们 页面建立
37
    name: 'index',
7098afd2   liuqimichale   关于我们 页面建立
38
    components: {
8c48fe84   liuqimichale   关于我们 页面建立
39
40
      commonBanner
    },
7098afd2   liuqimichale   关于我们 页面建立
41
42
43
44
    data() {
      return {
        tabData: [
          '公司简介', '发展历程', '企业文化', '资质认证', '荣誉证书'
8c48fe84   liuqimichale   关于我们 页面建立
45
        ],
7098afd2   liuqimichale   关于我们 页面建立
46
47
48
49
        currentIndex: 0,
        tabView: 'selectTab0',
        name: '',
        scroll: ''
8c48fe84   liuqimichale   关于我们 页面建立
50
51
      }
    },
7098afd2   liuqimichale   关于我们 页面建立
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    mounted() {
      this.name = this.tabData[0]
    },
    methods: {
      dataScroll: function () {
        this.scroll =  document.documentElement.scrollTop || document.body.scrollTop
      },
      changeTab: function (index, item) {
        console.log(index)
        this.currentIndex = index
        this.tabView = 'selectTab' + index
        this.name = item
  
        // 对应锚点
        let jump = document.getElementsByClassName('anchor')
        let total = jump[index].offsetTop
        document.documentElement.scrollTop = total //firefox
        document.body.scrollTop = total //chrome
        window.pageYOffset = total
  
      },
8c48fe84   liuqimichale   关于我们 页面建立
73
74
75
  
    }
  
4d0a73c0   liuqimichale   项目初始化
76
77
78
  }
  </script>
  
8c48fe84   liuqimichale   关于我们 页面建立
79
80
81
  <style scoped lang="scss">
  
  
4d0a73c0   liuqimichale   项目初始化
82
  </style>