|
@@ -1,76 +1,115 @@
|
1
|
1
|
<!-- home -->
|
2
|
2
|
<template>
|
3
|
|
- <div class="apartment">
|
|
3
|
+ <div class="project-index">
|
4
|
4
|
<img src="@/assets/perjectImages/langbgm.jpg" width="100%" class="bgiclass" @load="handleImageLoad"/>
|
5
|
5
|
<div class="index-pos-hander" :style="handleStyle">
|
6
|
6
|
<img :src="require('@/assets/perjectImages/swiperButton.png')" alt="">
|
7
|
7
|
</div>
|
8
|
|
- <swiper>
|
9
|
|
- <swiper-slide v-for="item in houseList" :key="item.image">
|
10
|
|
- <pure-image :bg-color="item.color" :bg-image="item.image"></pure-image>
|
11
|
|
- </swiper-slide>
|
12
|
|
- </swiper>
|
|
8
|
+ <div class="index-project-swiper" :style="swiperStyle" ref="swiperRef">
|
|
9
|
+ <project-swiper v-if="swiperShow" @clickItem="handleShow"></project-swiper>
|
|
10
|
+ </div>
|
|
11
|
+ <div v-for="(item, index) in list" :key="item.image">
|
|
12
|
+ <yz-modal :visible="visible[index]" class="project-modal" @touchmove.native="handleMove">
|
|
13
|
+ <div class="modal-inner">
|
|
14
|
+ <pure-image :bg-image="item.image"></pure-image>
|
|
15
|
+ <div class="back-sign" @click="cancelShow(index)">
|
|
16
|
+ <img :src="item.backSign" alt="">
|
|
17
|
+ </div>
|
|
18
|
+ </div>
|
|
19
|
+ </yz-modal>
|
|
20
|
+ </div>
|
13
|
21
|
</div>
|
14
|
22
|
</template>
|
15
|
23
|
|
16
|
24
|
<script>
|
17
|
25
|
|
|
26
|
+const backSignImg = require('@/assets/perjectImages/backButton.png')
|
|
27
|
+const backSignImg2 = require('@/assets/perjectImages/backButton-2.png')
|
|
28
|
+
|
18
|
29
|
export default {
|
|
30
|
+ components: {
|
|
31
|
+ PureImage: () => import('./components/PureImage.vue'),
|
|
32
|
+ ProjectSwiper: () => import('./components/ProjectSwiper.vue')
|
|
33
|
+ },
|
19
|
34
|
data() {
|
20
|
35
|
return {
|
21
|
36
|
handleStyle: {},
|
22
|
|
- houseList: [
|
|
37
|
+ swiperStyle: {},
|
|
38
|
+ swiperShow: false,
|
|
39
|
+ visible: Array(8).fill(false),
|
|
40
|
+ list: [
|
23
|
41
|
{
|
24
|
|
- image: require('@/assets/images/apartment/7-1.jpg'),
|
25
|
|
- color: '#f0f0f0'
|
|
42
|
+ image: require('@/assets/perjectImages/1-1.jpg'),
|
|
43
|
+ backSign: backSignImg
|
26
|
44
|
},
|
27
|
45
|
{
|
28
|
|
- image: require('@/assets/images/apartment/7-2.jpg'),
|
29
|
|
- color: '#f0f0f0'
|
|
46
|
+ image: require('@/assets/perjectImages/2-1.jpg'),
|
|
47
|
+ backSign: backSignImg2
|
30
|
48
|
},
|
31
|
49
|
{
|
32
|
|
- image: require('@/assets/images/apartment/7-3.jpg'),
|
33
|
|
- color: '#f0f0f0'
|
|
50
|
+ image: require('@/assets/perjectImages/3-1.jpg'),
|
|
51
|
+ backSign: backSignImg
|
34
|
52
|
},
|
35
|
53
|
{
|
36
|
|
- image: require('@/assets/images/apartment/7-4.jpg'),
|
37
|
|
- color: '#f0f0f0'
|
|
54
|
+ image: require('@/assets/perjectImages/4-1.jpg'),
|
|
55
|
+ backSign: backSignImg
|
38
|
56
|
},
|
39
|
57
|
{
|
40
|
|
- image: require('@/assets/images/apartment/7-5.jpg'),
|
41
|
|
- color: '#f0f0f0'
|
|
58
|
+ image: require('@/assets/perjectImages/5-1.jpg'),
|
|
59
|
+ backSign: backSignImg2
|
42
|
60
|
},
|
43
|
61
|
{
|
44
|
|
- image: require('@/assets/images/apartment/7-6.jpg'),
|
45
|
|
- color: '#f0f0f0'
|
|
62
|
+ image: require('@/assets/perjectImages/6-1.jpg'),
|
|
63
|
+ backSign: backSignImg
|
46
|
64
|
},
|
47
|
65
|
{
|
48
|
|
- image: require('@/assets/images/apartment/7-7.jpg'),
|
49
|
|
- color: '#f0f0f0'
|
|
66
|
+ image: require('@/assets/perjectImages/7-1.jpg'),
|
|
67
|
+ backSign: backSignImg
|
50
|
68
|
},
|
51
|
69
|
{
|
52
|
|
- image: require('@/assets/images/apartment/7-8.jpg'),
|
53
|
|
- color: '#f0f0f0'
|
|
70
|
+ image: require('@/assets/perjectImages/8-1.jpg'),
|
|
71
|
+ backSign: backSignImg
|
54
|
72
|
}
|
55
|
73
|
]
|
56
|
74
|
}
|
57
|
75
|
},
|
|
76
|
+ mounted() {
|
|
77
|
+ this.$nextTick(() => {
|
|
78
|
+ const { offsetWidth } = this.$refs.swiperRef
|
|
79
|
+ this.swiperStyle = {
|
|
80
|
+ height: `${offsetWidth * 0.6667}px`
|
|
81
|
+ }
|
|
82
|
+ this.swiperShow = true
|
|
83
|
+ })
|
|
84
|
+ },
|
58
|
85
|
methods: {
|
59
|
|
- handleImageLoad(e) {
|
60
|
|
- const { height } = e.target
|
|
86
|
+ handleImageLoad() {
|
|
87
|
+ const { scrollHeight } = this.$el
|
61
|
88
|
|
62
|
89
|
this.handleStyle = {
|
63
|
|
- top: `${height - 400}px`
|
|
90
|
+ top: `${scrollHeight - 400}px`
|
64
|
91
|
}
|
|
92
|
+ },
|
|
93
|
+ handleShow(index) {
|
|
94
|
+ this.$set(this.visible, index, true)
|
|
95
|
+ },
|
|
96
|
+ cancelShow(index) {
|
|
97
|
+ this.$set(this.visible, index, false)
|
|
98
|
+ },
|
|
99
|
+ handleMove(e) {
|
|
100
|
+ console.log(e)
|
|
101
|
+ e.preventDefault()
|
|
102
|
+ e.stopPropagation()
|
65
|
103
|
}
|
66
|
104
|
}
|
67
|
105
|
}
|
68
|
106
|
</script>
|
69
|
107
|
|
70
|
108
|
<style lang="scss" scoped>
|
71
|
|
-.apartment {
|
72
|
|
- height: 100%;
|
|
109
|
+.project-index {
|
|
110
|
+ background: #f0f0f0;
|
73
|
111
|
position: relative;
|
|
112
|
+
|
74
|
113
|
.index-pos-hander {
|
75
|
114
|
position: absolute;
|
76
|
115
|
z-index: 200;
|
|
@@ -84,5 +123,37 @@ export default {
|
84
|
123
|
height: 100%;
|
85
|
124
|
}
|
86
|
125
|
}
|
|
126
|
+
|
|
127
|
+ .index-project-swiper {
|
|
128
|
+ position: relative;
|
|
129
|
+ box-sizing: border-box;
|
|
130
|
+ margin: 0 15px;
|
|
131
|
+ width: calc(100vw - 30px);
|
|
132
|
+ }
|
|
133
|
+
|
|
134
|
+ .project-modal {
|
|
135
|
+ overscroll-behavior: contain
|
|
136
|
+ }
|
|
137
|
+
|
|
138
|
+ .modal-inner {
|
|
139
|
+ position: relative;
|
|
140
|
+ width: 100vw;
|
|
141
|
+ height: 100vh;
|
|
142
|
+ overflow: hidden;
|
|
143
|
+
|
|
144
|
+ .back-sign {
|
|
145
|
+ position: absolute;
|
|
146
|
+ z-index: 500;
|
|
147
|
+ right: 10px;
|
|
148
|
+ bottom: -24px;
|
|
149
|
+ width: 96px;
|
|
150
|
+ height: 88px;
|
|
151
|
+
|
|
152
|
+ img {
|
|
153
|
+ width: 100%;
|
|
154
|
+ height: 100%;
|
|
155
|
+ }
|
|
156
|
+ }
|
|
157
|
+ }
|
87
|
158
|
}
|
88
|
159
|
</style>
|