|
@@ -1,27 +1,17 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="index-image">
|
3
|
|
- <img :src="require('@/assets/images/index.png')" class="bg-image" @load="loadBg" />
|
4
|
|
- <div class="index-inner-swiper" :style="swiperItemStyle">
|
5
|
|
- <swiper v-if="showSwiper" :options="swiperOptions">
|
|
3
|
+ <!-- <img :src="require('@/assets/images/index.png')" class="bg-image" @load="loadBg" /> -->
|
|
4
|
+ <div class="index-inner-swiper">
|
|
5
|
+ <swiper :options="swiperOptions">
|
6
|
6
|
<swiper-slide class="index-inner-slide">
|
7
|
|
- <img
|
8
|
|
- :src="require('@/assets/images/1home.png')"
|
9
|
|
- alt
|
10
|
|
- @click="$router.push({ name: 'Apartment' })"
|
11
|
|
- />
|
|
7
|
+ <img :src="require('@/assets/images/1home.png')" />
|
12
|
8
|
</swiper-slide>
|
|
9
|
+
|
13
|
10
|
<swiper-slide class="index-inner-slide">
|
14
|
|
- <img
|
15
|
|
- :src="require('@/assets/images/2home.png')"
|
16
|
|
- alt
|
17
|
|
- @click="$router.push({ name: 'Office' })"
|
18
|
|
- />
|
|
11
|
+ <img :src="require('@/assets/images/2home.png')" />
|
19
|
12
|
</swiper-slide>
|
20
|
13
|
</swiper>
|
21
|
14
|
</div>
|
22
|
|
- <div class="index-pos-hander" :style="handerStyle">
|
23
|
|
- <img :src="require('@/assets/images/toLeft.png')" alt />
|
24
|
|
- </div>
|
25
|
15
|
</div>
|
26
|
16
|
</template>
|
27
|
17
|
|
|
@@ -30,37 +20,11 @@ export default {
|
30
|
20
|
name: 'IndexImage',
|
31
|
21
|
data() {
|
32
|
22
|
return {
|
33
|
|
- showSwiper: false,
|
34
|
23
|
swiperOptions: {
|
35
|
24
|
autoplay: {
|
36
|
|
- delay: 2500,
|
37
|
|
- disableOnInteraction: false
|
|
25
|
+ delay: 100
|
38
|
26
|
}
|
39
|
|
- },
|
40
|
|
- swiperItemStyle: {},
|
41
|
|
- handerStyle: {}
|
42
|
|
- }
|
43
|
|
- },
|
44
|
|
- methods: {
|
45
|
|
- loadBg(e) {
|
46
|
|
- const { offsetTop, width, height, naturalWidth, naturalHeight } = e.target
|
47
|
|
-
|
48
|
|
- const widthRatio = width / naturalWidth
|
49
|
|
- const heightRatio = height / naturalHeight
|
50
|
|
-
|
51
|
|
- this.swiperItemStyle = {
|
52
|
|
- width: `${636 * widthRatio}px`, // 636 是图片原始宽度
|
53
|
|
- height: `${637 * heightRatio}px`, // 637 是图片原始高度
|
54
|
|
- top: `${offsetTop + 1612 * heightRatio}px`,
|
55
|
|
- left: `${352 * widthRatio}px`
|
56
|
27
|
}
|
57
|
|
-
|
58
|
|
- this.handerStyle = {
|
59
|
|
- top: `${offsetTop + 1800 * heightRatio}px`,
|
60
|
|
- left: `${1020 * widthRatio}px`
|
61
|
|
- }
|
62
|
|
-
|
63
|
|
- this.showSwiper = true
|
64
|
28
|
}
|
65
|
29
|
}
|
66
|
30
|
}
|
|
@@ -68,25 +32,14 @@ export default {
|
68
|
32
|
|
69
|
33
|
<style lang="scss" scoped>
|
70
|
34
|
.index-image {
|
71
|
|
- position: relative;
|
72
|
|
- background-color: #1d429d;
|
73
|
|
- width: 100%;
|
74
|
|
- height: 100%;
|
75
|
|
- display: flex;
|
76
|
|
- align-items: center;
|
77
|
|
- overflow: hidden;
|
78
|
|
-
|
79
|
|
- .bg-image {
|
80
|
|
- width: 100%;
|
81
|
|
- pointer-events: none;
|
82
|
|
- z-index: 100;
|
83
|
|
- }
|
84
|
|
-
|
85
|
35
|
.index-inner-swiper {
|
86
|
|
- position: absolute;
|
|
36
|
+ background-color: rgb(54, 54, 54);
|
|
37
|
+ width: 200px;
|
|
38
|
+ height: 200px;
|
87
|
39
|
|
88
|
40
|
.index-inner-slide {
|
89
|
41
|
background: transparent;
|
|
42
|
+ background-color: rgb(54, 54, 54);
|
90
|
43
|
}
|
91
|
44
|
|
92
|
45
|
img {
|
|
@@ -94,18 +47,5 @@ export default {
|
94
|
47
|
height: 100%;
|
95
|
48
|
}
|
96
|
49
|
}
|
97
|
|
-
|
98
|
|
- .index-pos-hander {
|
99
|
|
- position: absolute;
|
100
|
|
- z-index: 200;
|
101
|
|
- width: 64px;
|
102
|
|
- height: 56px;
|
103
|
|
- animation: slidefade 2s infinite;
|
104
|
|
-
|
105
|
|
- img {
|
106
|
|
- width: 100%;
|
107
|
|
- height: 100%;
|
108
|
|
- }
|
109
|
|
- }
|
110
|
50
|
}
|
111
|
51
|
</style>
|