|
@@ -2,26 +2,26 @@
|
2
|
2
|
<div class="index-box">
|
3
|
3
|
<img src="../../public/fourBoxes-image/1.jpg" class="bg-image" />
|
4
|
4
|
<div class="index-FourBoxes">
|
5
|
|
- <div class="index-FourBoxes-yushi test" @click="goPagess('yushi')">
|
6
|
|
- <img src="../../public/fourBoxes-image/浴室.png" :style="styleImage" class="Four-image" />
|
|
5
|
+ <div class="index-FourBoxes-yushi test" :class="{ active: currentItem === 0 }" @click="goPagess(0)">
|
|
6
|
+ <img src="../../public/fourBoxes-image/浴室.png" class="Four-image" @transitionend="handleTransitionEnd('yushi')" />
|
7
|
7
|
<div style=" width: 80px; position: absolute; left: 13vw; top: 36vh;">
|
8
|
8
|
<img style=" width:100%;" src="../assets/fourBoxes-2/浴室-2.png" />
|
9
|
9
|
</div>
|
10
|
10
|
</div>
|
11
|
|
- <div class="index-FourBoxes-yimao test" @click="goPagess('yimao')">
|
12
|
|
- <img src="../../public/fourBoxes-image/衣帽间.png" :style="styleImage" class="Four-image" />
|
|
11
|
+ <div class="index-FourBoxes-yimao test" :class="{ active: currentItem === 1 }" @click="goPagess(1)">
|
|
12
|
+ <img src="../../public/fourBoxes-image/衣帽间.png" class="Four-image" @transitionend="handleTransitionEnd('yimao')" />
|
13
|
13
|
<div style=" width: 80px;; position: absolute; left: 62vw; top: 36vh;">
|
14
|
14
|
<img style=" width:100%;" src="../assets/fourBoxes-2/衣帽间-2.png" />
|
15
|
15
|
</div>
|
16
|
16
|
</div>
|
17
|
|
- <div class="index-FourBoxes-keting test" @click="goPagess('keting')">
|
18
|
|
- <img src="../../public/fourBoxes-image/客厅.png" :style="styleImage" class="Four-image" />
|
|
17
|
+ <div class="index-FourBoxes-keting test" :class="{ active: currentItem === 2 }" @click="goPagess(2)">
|
|
18
|
+ <img src="../../public/fourBoxes-image/客厅.png" @transitionend="handleTransitionEnd('keting')" class="Four-image" />
|
19
|
19
|
<div style=" width: 80px;; position: absolute; left: 13vw; top: 77vh;">
|
20
|
20
|
<img style=" width:100%;" src="../assets/fourBoxes-2/客厅-2.png" />
|
21
|
21
|
</div>
|
22
|
22
|
</div>
|
23
|
|
- <div class="index-FourBoxes-yangtai test" @click="goPagess('yangtai')">
|
24
|
|
- <img src="../../public/fourBoxes-image/阳台.png" :style="styleImage" class="Four-image" />
|
|
23
|
+ <div class="index-FourBoxes-yangtai test" :class="{ active: currentItem === 3 }" @click="goPagess(3)">
|
|
24
|
+ <img src="../../public/fourBoxes-image/阳台.png" @transitionend="handleTransitionEnd('yangtai')" class="Four-image" />
|
25
|
25
|
<div style=" width: 80px;; position: absolute; left: 62vw; top: 77vh;">
|
26
|
26
|
<img style=" width:100%;" src="../assets/fourBoxes-2/阳台-2.png" />
|
27
|
27
|
</div>
|
|
@@ -34,7 +34,14 @@
|
34
|
34
|
export default {
|
35
|
35
|
data() {
|
36
|
36
|
return {
|
37
|
|
- styleImage: 'opacity: 0.3;',
|
|
37
|
+ currentItem: -1,
|
|
38
|
+ currentType: '',
|
|
39
|
+ styleImage: [
|
|
40
|
+ 'opacity: 0.3;',
|
|
41
|
+ 'opacity: 0.3;',
|
|
42
|
+ 'opacity: 0.3;',
|
|
43
|
+ 'opacity: 0.3;',
|
|
44
|
+ ],
|
38
|
45
|
typeYushi: {
|
39
|
46
|
bgImage: require('../../public/yushi-image/1.jpg'),
|
40
|
47
|
swiper: {
|
|
@@ -72,45 +79,60 @@ export default {
|
72
|
79
|
}
|
73
|
80
|
},
|
74
|
81
|
methods: {
|
75
|
|
- goPagess(e, res) {
|
76
|
|
- this.styleImage = ''
|
77
|
|
-
|
78
|
|
- switch (e) {
|
79
|
|
- case 'yushi':
|
80
|
|
- var arr = JSON.stringify(this.typeYushi)
|
81
|
|
- this.$router.push({
|
82
|
|
- name: 'Test',
|
83
|
|
- params: { types: encodeURIComponent(arr) }
|
84
|
|
- })
|
|
82
|
+ handleTransitionEnd(types) {
|
|
83
|
+ this.$router.push({ name: 'Test', params: { types }})
|
|
84
|
+ },
|
|
85
|
+ goPagess(inx) {
|
|
86
|
+ this.currentItem = inx
|
85
|
87
|
|
86
|
|
- break
|
87
|
|
- case 'keting':
|
88
|
|
- console.log('keting')
|
89
|
|
- var arr = JSON.stringify(this.typeKeting)
|
90
|
|
- this.$router.push({
|
91
|
|
- name: 'Test',
|
92
|
|
- params: { types: encodeURIComponent(arr) }
|
93
|
|
- })
|
94
|
|
- break
|
95
|
|
- case 'yimao':
|
96
|
|
- console.log('yimao')
|
97
|
|
- var arr = JSON.stringify(this.typeYimao)
|
98
|
|
- this.$router.push({
|
99
|
|
- name: 'Test',
|
100
|
|
- params: { types: encodeURIComponent(arr) }
|
101
|
|
- })
|
102
|
|
- break
|
103
|
|
- case 'yangtai':
|
104
|
|
- console.log('yangtai')
|
105
|
|
- var arr = JSON.stringify(this.typeYangtai)
|
106
|
|
- this.$router.push({
|
107
|
|
- name: 'Test',
|
108
|
|
- params: { types: encodeURIComponent(arr) }
|
109
|
|
- })
|
110
|
|
- break
|
111
|
|
- default:
|
112
|
|
- return
|
113
|
|
- }
|
|
88
|
+ // switch (e) {
|
|
89
|
+ // case 'yushi':
|
|
90
|
+ // var arr = JSON.stringify(this.typeYushi)
|
|
91
|
+ // this.styleImage[0] = 'opacity:1'
|
|
92
|
+ // setTimeout(()=>{
|
|
93
|
+ // this.$router.push({
|
|
94
|
+ // name: 'Test',
|
|
95
|
+ // params: { types: encodeURIComponent(arr) }
|
|
96
|
+ // })
|
|
97
|
+ // // this.styleImage[0] = 'opacity: 0.3;'
|
|
98
|
+ // },1000)
|
|
99
|
+ // break
|
|
100
|
+ // case 'keting':
|
|
101
|
+ // var arr = JSON.stringify(this.typeKeting)
|
|
102
|
+ // this.styleImage[1] = ''
|
|
103
|
+ // setTimeout(()=>{
|
|
104
|
+ // this.$router.push({
|
|
105
|
+ // name: 'Test',
|
|
106
|
+ // params: { types: encodeURIComponent(arr) }
|
|
107
|
+ // })
|
|
108
|
+ // // this.styleImage[1] = 'opacity: 0.3;'
|
|
109
|
+ // },1000)
|
|
110
|
+ // break
|
|
111
|
+ // case 'yimao':
|
|
112
|
+ // var arr = JSON.stringify(this.typeYimao)
|
|
113
|
+ // this.styleImage[2] = ''
|
|
114
|
+ // setTimeout(()=>{
|
|
115
|
+ // this.$router.push({
|
|
116
|
+ // name: 'Test',
|
|
117
|
+ // params: { types: encodeURIComponent(arr) }
|
|
118
|
+ // })
|
|
119
|
+ // // this.styleImage[2] = 'opacity: 0.3;'
|
|
120
|
+ // },1000)
|
|
121
|
+ // break
|
|
122
|
+ // case 'yangtai':
|
|
123
|
+ // var arr = JSON.stringify(this.typeYangtai)
|
|
124
|
+ // this.styleImage[3] = ''
|
|
125
|
+ // setTimeout(()=>{
|
|
126
|
+ // this.$router.push({
|
|
127
|
+ // name: 'Test',
|
|
128
|
+ // params: { types: encodeURIComponent(arr) }
|
|
129
|
+ // })
|
|
130
|
+ // // this.styleImage[3] = 'opacity: 0.3;'
|
|
131
|
+ // },1000)
|
|
132
|
+ // break
|
|
133
|
+ // default:
|
|
134
|
+ // return
|
|
135
|
+ // }
|
114
|
136
|
},
|
115
|
137
|
goYimao() {},
|
116
|
138
|
goKeting() {},
|
|
@@ -140,6 +162,17 @@ export default {
|
140
|
162
|
align-items: center;
|
141
|
163
|
justify-content: center;
|
142
|
164
|
.test {
|
|
165
|
+
|
|
166
|
+ & > img {
|
|
167
|
+ opacity: .6;
|
|
168
|
+ transition: opacity .2s ease;
|
|
169
|
+ }
|
|
170
|
+
|
|
171
|
+ &.active > img {
|
|
172
|
+ opacity: 1;
|
|
173
|
+ }
|
|
174
|
+
|
|
175
|
+
|
143
|
176
|
float: left;
|
144
|
177
|
width: 48%;
|
145
|
178
|
height: 49%;
|