hookehuyr

关于创新自适应显示

1 <!-- 1 <!--
2 * @Date: 2024-10-17 11:13:44 2 * @Date: 2024-10-17 11:13:44
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-17 15:04:56 4 + * @LastEditTime: 2024-10-22 10:05:52
5 * @FilePath: /hager/src/views/about/design.vue 5 * @FilePath: /hager/src/views/about/design.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 </el-breadcrumb> 15 </el-breadcrumb>
16 </div> 16 </div>
17 </hager-box> 17 </hager-box>
18 - <hager-box> 18 + <hager-box v-if="!is_xs">
19 <el-row style="margin: 3rem 0;"> 19 <el-row style="margin: 3rem 0;">
20 <el-col :span="8"> 20 <el-col :span="8">
21 <div class="about-box"> 21 <div class="about-box">
...@@ -35,20 +35,44 @@ ...@@ -35,20 +35,44 @@
35 </el-col> 35 </el-col>
36 </el-row> 36 </el-row>
37 </hager-box> 37 </hager-box>
38 + <div v-else style="margin-top: 1rem;">
39 + <div class="about-img"></div>
40 + <div class="about-box xs">
41 + <div>
42 + <div class="title">
43 + <p class="c">创新设计</p>
44 + <p class="e">Innovative Design</p>
45 + </div>
46 + <div class="introduce" v-clamp="3">
47 + <p>海格电气一直致力于创新,<br/>我们与客户共同着手面向未来的主题。</p>
48 + </div>
49 + </div>
50 + </div>
51 + </div>
38 <hager-box class="box-2n"> 52 <hager-box class="box-2n">
39 <hager-h1 title="从产品到解决方案" sub="From Products to Solutions" style="margin: 2rem 0;"></hager-h1> 53 <hager-h1 title="从产品到解决方案" sub="From Products to Solutions" style="margin: 2rem 0;"></hager-h1>
40 - <el-row :gutter="20" style="margin-bottom: 2rem;"> 54 + <div>
41 - <el-col :span="8" v-for="(item, index) in list" :key="index" class="products-solutions"> 55 + <swiper ref="myDesignSwiper" class="swiper" :options="swiperOption" @slideChange="onDesignSlideChange">
42 - <div class="img-box" :style="{ backgroundImage: 'url('+item.cover+')' }"></div> 56 + <swiper-slide v-for="(item, index) in design_list" :key="index">
43 - <div class="text-box" style="background-color: #FFF;"> 57 + <div class="products-solutions">
44 - <div class="title">{{ item.title }}</div> 58 + <div class="img-box" :style="{ backgroundImage: 'url('+item.cover+')' }"></div>
45 - <div class="sub">{{ item.sub }}</div> 59 + <div class="text-box" style="background-color: #FFF;">
46 - <div class="content" v-clamp="2">{{ item.content }}</div> 60 + <div class="title">{{ item.title }}</div>
61 + <div class="sub">{{ item.sub }}</div>
62 + <div class="content" v-clamp="2">{{ item.content }}</div>
63 + </div>
64 + </div>
65 + </swiper-slide>
66 + </swiper>
67 + <div v-if="design_list.length > designSlidesPerView || is_xs" class="xs-control">
68 + <div>
69 + <i :class="['el-icon-arrow-left', activeDesignIndex === 0 ? 'disabled' : '']"@click="prevDesignBtn()"></i>
70 + <i :class="['el-icon-arrow-right', reach_design_end ? 'disabled' : '']" @click="nextDesignBtn()"></i>
47 </div> 71 </div>
48 - </el-col> 72 + </div>
49 - </el-row> 73 + </div>
50 </hager-box> 74 </hager-box>
51 - <hager-box class="box-n"> 75 + <hager-box v-if="!is_xs" class="box-n">
52 <el-row :gutter="30" style="margin-top: 2rem;margin-bottom: 2rem;"> 76 <el-row :gutter="30" style="margin-top: 2rem;margin-bottom: 2rem;">
53 <el-col :span="12"> 77 <el-col :span="12">
54 <div class="left-box"> 78 <div class="left-box">
...@@ -70,6 +94,22 @@ ...@@ -70,6 +94,22 @@
70 </el-col> 94 </el-col>
71 </el-row> 95 </el-row>
72 </hager-box> 96 </hager-box>
97 + <div v-else>
98 + <div class="left-box xs">
99 + <div class="title xs">
100 + <hager-h1 title="从用户体验到设计" sub="From User Experience to Design"></hager-h1>
101 + <div style="margin-top: 2rem; line-height: 1.75;">
102 + <p>海格电气仔细倾听客户的声音,以使我们的设计语言能够被普遍理解。为了提供更加国际化的产品组合,我们调研了不同国家的习俗、个人的不同愿望和客户关注点。客户的声音促成了符合人体工学的设计方案,确保来自海格电气的产品兼具优雅品味的外观设计与方便易用、以人为本的功能性。</p>
103 + </div>
104 + </div>
105 + </div>
106 + <div class="right-box xs">
107 + <p class="title">“倾听客户的声音,打造一流设计”</p>
108 + <div>
109 + <img style="width: 100%; height: 10rem;" src="https://cdn.ipadbiz.cn/hager/img/about/g13@2x.png" alt="">
110 + </div>
111 + </div>
112 + </div>
73 </div> 113 </div>
74 </template> 114 </template>
75 115
...@@ -82,7 +122,7 @@ export default { ...@@ -82,7 +122,7 @@ export default {
82 mixins: [mixin.init], 122 mixins: [mixin.init],
83 data () { 123 data () {
84 return { 124 return {
85 - list: [{ 125 + design_list: [{
86 cover: 'https://cdn.ipadbiz.cn/hager/img/about/g10@2x-1.png', 126 cover: 'https://cdn.ipadbiz.cn/hager/img/about/g10@2x-1.png',
87 title: '电动交通', 127 title: '电动交通',
88 sub: 'Electric Transportation', 128 sub: 'Electric Transportation',
...@@ -97,14 +137,70 @@ export default { ...@@ -97,14 +137,70 @@ export default {
97 title: '能源效率', 137 title: '能源效率',
98 sub: 'Energy Efficiency', 138 sub: 'Energy Efficiency',
99 content: '节能产品有助于优化和降低能源消耗。' 139 content: '节能产品有助于优化和降低能源消耗。'
100 - }] 140 + }],
141 + swiperOption: {
142 + slidesPerView: 2,
143 + spaceBetween: 20,
144 + preventClicks : true,
145 + slideToClickedSlide: false,
146 + touchRatio: 0,
147 + breakpoints: {
148 + 1480: {
149 + slidesPerView: 3,
150 + spaceBetween: 30
151 + },
152 + 1024: {
153 + slidesPerView: 3,
154 + spaceBetween: 30
155 + },
156 + 768: {
157 + slidesPerView: 3,
158 + spaceBetween: 20
159 + },
160 + 640: {
161 + slidesPerView: 1,
162 + spaceBetween: 20
163 + },
164 + 320: {
165 + slidesPerView: 1,
166 + spaceBetween: 10
167 + },
168 + 160: {
169 + slidesPerView: 1,
170 + spaceBetween: 0
171 + }
172 + }
173 + },
174 + activeDesignIndex: 0,
175 + reach_design_end: false,
176 + designSlidesPerView: 3,
101 } 177 }
102 }, 178 },
103 mounted () { 179 mounted () {
104 - 180 + this.$nextTick(() => {
181 + this.$refs.myDesignSwiper.$swiper?.on('breakpoint', (swiper) => {
182 + // breakpoint时 显示的条数
183 + this.designSlidesPerView = swiper.slidesPerView
184 + });
185 + });
105 }, 186 },
106 methods: { 187 methods: {
188 + prevDesignBtn () {
189 + this.$refs.myDesignSwiper.$swiper.slidePrev();
190 + },
191 + nextDesignBtn () {
192 + this.$refs.myDesignSwiper.$swiper.slideNext();
193 + },
194 + onDesignSlideChange () {
195 + this.activeDesignIndex = this.$refs.myDesignSwiper.$swiper.activeIndex;
196 + const isEnd = this.$refs.myDesignSwiper.$swiper.isEnd;
107 197
198 + if (isEnd) {
199 + this.reach_design_end = true;
200 + } else {
201 + this.reach_design_end = false;
202 + }
203 + }
108 } 204 }
109 } 205 }
110 </script> 206 </script>
...@@ -125,6 +221,9 @@ export default { ...@@ -125,6 +221,9 @@ export default {
125 padding: 2rem; 221 padding: 2rem;
126 height: 30rem; /* 让 .about-box 撑满父容器 */ 222 height: 30rem; /* 让 .about-box 撑满父容器 */
127 box-sizing: border-box; 223 box-sizing: border-box;
224 + &.xs {
225 + height: auto;
226 + }
128 .title { 227 .title {
129 font-weight: bold; 228 font-weight: bold;
130 .c { 229 .c {
...@@ -174,13 +273,25 @@ export default { ...@@ -174,13 +273,25 @@ export default {
174 background-color: #E3F1F7; 273 background-color: #E3F1F7;
175 height: 25rem; 274 height: 25rem;
176 padding: 2rem; 275 padding: 2rem;
276 + &.xs {
277 + height: auto;
278 + }
177 .title { 279 .title {
178 top: 30%; 280 top: 30%;
179 transform: translateY(30%); 281 transform: translateY(30%);
282 + &.xs {
283 + transform: translateY(0);
284 + }
180 } 285 }
181 } 286 }
182 .right-box { 287 .right-box {
183 - top: 30%; transform: translateY(30%); padding: 2rem; 288 + top: 30%;
289 + transform: translateY(30%);
290 + padding: 2rem;
291 + &.xs {
292 + top: 0;
293 + transform: translateY(0);
294 + }
184 .title { 295 .title {
185 text-align: center; 296 text-align: center;
186 font-size: 1.55rem; 297 font-size: 1.55rem;
...@@ -189,5 +300,21 @@ export default { ...@@ -189,5 +300,21 @@ export default {
189 color: @secondary-color; 300 color: @secondary-color;
190 } 301 }
191 } 302 }
303 +
304 + .xs-control {
305 + display: flex;
306 + justify-content: flex-end;
307 + margin-top: 1rem;
308 + i {
309 + font-size: 1.35rem;
310 + color: #EE6D10;
311 + &:hover {
312 + cursor: pointer;
313 + }
314 + &.disabled {
315 + color: #ccc;
316 + }
317 + }
318 + }
192 } 319 }
193 </style> 320 </style>
......