Showing
5 changed files
with
117 additions
and
8 deletions
| ... | @@ -7,6 +7,7 @@ export {} | ... | @@ -7,6 +7,7 @@ export {} |
| 7 | /* prettier-ignore */ | 7 | /* prettier-ignore */ |
| 8 | declare module 'vue' { | 8 | declare module 'vue' { |
| 9 | export interface GlobalComponents { | 9 | export interface GlobalComponents { |
| 10 | + copy: typeof import('./src/components/hagerHCarousel copy.vue')['default'] | ||
| 10 | ElBreadcrumb: typeof import('element-ui/lib/breadcrumb')['default'] | 11 | ElBreadcrumb: typeof import('element-ui/lib/breadcrumb')['default'] |
| 11 | ElBreadcrumbItem: typeof import('element-ui/lib/breadcrumb-item')['default'] | 12 | ElBreadcrumbItem: typeof import('element-ui/lib/breadcrumb-item')['default'] |
| 12 | ElButton: typeof import('element-ui/lib/button')['default'] | 13 | ElButton: typeof import('element-ui/lib/button')['default'] |
| ... | @@ -27,6 +28,7 @@ declare module 'vue' { | ... | @@ -27,6 +28,7 @@ declare module 'vue' { |
| 27 | HagerHCarousel: typeof import('./src/components/hagerHCarousel.vue')['default'] | 28 | HagerHCarousel: typeof import('./src/components/hagerHCarousel.vue')['default'] |
| 28 | HagerHeader: typeof import('./src/components/common/hagerHeader.vue')['default'] | 29 | HagerHeader: typeof import('./src/components/common/hagerHeader.vue')['default'] |
| 29 | HagerHT: typeof import('./src/components/common/hagerHT.vue')['default'] | 30 | HagerHT: typeof import('./src/components/common/hagerHT.vue')['default'] |
| 31 | + HagerMCarousel: typeof import('./src/components/hagerMCarousel.vue')['default'] | ||
| 30 | HagerMenu: typeof import('./src/components/hagerMenu.vue')['default'] | 32 | HagerMenu: typeof import('./src/components/hagerMenu.vue')['default'] |
| 31 | HagerMore: typeof import('./src/components/hagerMore.vue')['default'] | 33 | HagerMore: typeof import('./src/components/hagerMore.vue')['default'] |
| 32 | HagerT: typeof import('./src/components/common/hagerT.vue')['default'] | 34 | HagerT: typeof import('./src/components/common/hagerT.vue')['default'] | ... | ... |
| ... | @@ -16,7 +16,9 @@ | ... | @@ -16,7 +16,9 @@ |
| 16 | "jquery": "^3.7.1", | 16 | "jquery": "^3.7.1", |
| 17 | "mui-player": "^1.8.1", | 17 | "mui-player": "^1.8.1", |
| 18 | "sass": "1.55.0", | 18 | "sass": "1.55.0", |
| 19 | + "swiper": "4", | ||
| 19 | "vue": "2.7.13", | 20 | "vue": "2.7.13", |
| 21 | + "vue-awesome-swiper": "3.1.3", | ||
| 20 | "vue-router": "3.6.5" | 22 | "vue-router": "3.6.5" |
| 21 | }, | 23 | }, |
| 22 | "devDependencies": { | 24 | "devDependencies": { | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2024-08-26 10:12:56 | 2 | * @Date: 2024-08-26 10:12:56 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-09-30 15:31:44 | 4 | + * @LastEditTime: 2024-10-10 20:20:18 |
| 5 | * @FilePath: /hager/src/main.js | 5 | * @FilePath: /hager/src/main.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -18,11 +18,16 @@ import 'element-ui/lib/theme-chalk/display.css'; // 基于断点的隐藏类, | ... | @@ -18,11 +18,16 @@ import 'element-ui/lib/theme-chalk/display.css'; // 基于断点的隐藏类, |
| 18 | // collapse 展开折叠 | 18 | // collapse 展开折叠 |
| 19 | import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'; | 19 | import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'; |
| 20 | 20 | ||
| 21 | +import VueAwesomeSwiper from 'vue-awesome-swiper'; | ||
| 22 | +import 'swiper/dist/css/swiper.css'; // 确保引入正确的CSS文件路径 | ||
| 23 | + | ||
| 21 | Vue.use(VueRouter); | 24 | Vue.use(VueRouter); |
| 22 | // Vue.use(ElementUI); | 25 | // Vue.use(ElementUI); |
| 23 | // Vue.use(Button).use(Row).use(Col) | 26 | // Vue.use(Button).use(Row).use(Col) |
| 24 | Vue.component(CollapseTransition.name, CollapseTransition) | 27 | Vue.component(CollapseTransition.name, CollapseTransition) |
| 25 | 28 | ||
| 29 | +Vue.use(VueAwesomeSwiper); | ||
| 30 | + | ||
| 26 | new Vue({ | 31 | new Vue({ |
| 27 | router, | 32 | router, |
| 28 | render: (h) => h(App), | 33 | render: (h) => h(App), | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-08-27 10:06:30 | 2 | * @Date: 2024-08-27 10:06:30 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-10-10 14:44:15 | 4 | + * @LastEditTime: 2024-10-11 10:01:58 |
| 5 | * @FilePath: /hager/src/views/index.vue | 5 | * @FilePath: /hager/src/views/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -48,9 +48,17 @@ | ... | @@ -48,9 +48,17 @@ |
| 48 | </hager-box> | 48 | </hager-box> |
| 49 | <hager-box class="box-2n" @screen-width="handleScreenWidth"> | 49 | <hager-box class="box-2n" @screen-width="handleScreenWidth"> |
| 50 | <hager-h1 title="解决方案" sub="Solution"></hager-h1> | 50 | <hager-h1 title="解决方案" sub="Solution"></hager-h1> |
| 51 | - <div :class="['hager-solution', is_xs ? 'xs' : '']"> | 51 | + <div v-if="!is_xs" class="hager-solution"> |
| 52 | - <div @click="goToSolution(item)" :class="['solution-item', is_xs ? 'xs' : '']" :style="{ backgroundImage: 'url('+item.src+')' }" v-for="(item, index) in solution_list" :key="index"><p>{{ item.title }}</p></div> | 52 | + <div @click="goToSolution(item)" :class="['solution-item']" :style="{ backgroundImage: 'url('+item.src+')' }" v-for="(item, index) in solution_list" :key="index"><p>{{ item.title }}</p></div> |
| 53 | </div> | 53 | </div> |
| 54 | + <swiper v-else ref="mySwiper" class="swiper" :options="swiperOption"> | ||
| 55 | + <swiper-slide | ||
| 56 | + class="solution-item-a" | ||
| 57 | + :style="{ backgroundImage: 'url('+item.src+')' }" | ||
| 58 | + v-for="(item, index) in solution_list" :key="index"> | ||
| 59 | + <p>{{ item.title }}</p> | ||
| 60 | + </swiper-slide> | ||
| 61 | + </swiper> | ||
| 54 | <div class="xs-control" v-if="is_xs"> | 62 | <div class="xs-control" v-if="is_xs"> |
| 55 | <div><i class="el-icon-arrow-left" @click="prevBtn(solution_list)"></i> <i class="el-icon-arrow-right" @click="nextBtn(solution_list)"></i></div> | 63 | <div><i class="el-icon-arrow-left" @click="prevBtn(solution_list)"></i> <i class="el-icon-arrow-right" @click="nextBtn(solution_list)"></i></div> |
| 56 | </div> | 64 | </div> |
| ... | @@ -182,6 +190,30 @@ export default { | ... | @@ -182,6 +190,30 @@ export default { |
| 182 | src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg', | 190 | src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg', |
| 183 | title: '三型特决井天' | 191 | title: '三型特决井天' |
| 184 | }], | 192 | }], |
| 193 | + swiperOption: { | ||
| 194 | + slidesPerView: 3, | ||
| 195 | + spaceBetween: 50, | ||
| 196 | + preventClicks : false, | ||
| 197 | + slideToClickedSlide: false, | ||
| 198 | + breakpoints: { | ||
| 199 | + 1024: { | ||
| 200 | + slidesPerView: 4, | ||
| 201 | + spaceBetween: 40 | ||
| 202 | + }, | ||
| 203 | + 768: { | ||
| 204 | + slidesPerView: 3, | ||
| 205 | + spaceBetween: 30 | ||
| 206 | + }, | ||
| 207 | + 640: { | ||
| 208 | + slidesPerView: 2, | ||
| 209 | + spaceBetween: 20 | ||
| 210 | + }, | ||
| 211 | + 320: { | ||
| 212 | + slidesPerView: 1, | ||
| 213 | + spaceBetween: 10 | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + } | ||
| 185 | } | 217 | } |
| 186 | }, | 218 | }, |
| 187 | async mounted () { | 219 | async mounted () { |
| ... | @@ -216,13 +248,17 @@ export default { | ... | @@ -216,13 +248,17 @@ export default { |
| 216 | this.screen_width = width; | 248 | this.screen_width = width; |
| 217 | }, | 249 | }, |
| 218 | prevBtn (list) { | 250 | prevBtn (list) { |
| 219 | - const last = list.pop(); // 移除最后一个元素 | 251 | + this.$refs.mySwiper.swiper.slidePrev(); |
| 220 | - list.unshift(last); // 将最后一个元素添加到数组开头 | ||
| 221 | }, | 252 | }, |
| 222 | nextBtn (list) { | 253 | nextBtn (list) { |
| 223 | - const first = list.shift(); // 移除第一个元素 | 254 | + this.$refs.mySwiper.swiper.slideNext(); |
| 224 | - list.push(first); // 将第一个元素添加到数组末尾 | ||
| 225 | }, | 255 | }, |
| 256 | + onSwiper (swiper) { | ||
| 257 | + console.log(swiper); | ||
| 258 | + }, | ||
| 259 | + onSlideChange () { | ||
| 260 | + console.log('slide change'); | ||
| 261 | + } | ||
| 226 | }, | 262 | }, |
| 227 | } | 263 | } |
| 228 | </script> | 264 | </script> |
| ... | @@ -334,6 +370,32 @@ export default { | ... | @@ -334,6 +370,32 @@ export default { |
| 334 | } | 370 | } |
| 335 | } | 371 | } |
| 336 | } | 372 | } |
| 373 | + .solution-item-a { | ||
| 374 | + position: relative; | ||
| 375 | + height: 12rem; | ||
| 376 | + // padding: 1.5rem; | ||
| 377 | + text-align: center; | ||
| 378 | + color: #FFF; | ||
| 379 | + border-radius: 8px; | ||
| 380 | + // background-image: url('https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'); | ||
| 381 | + background-size: cover; | ||
| 382 | + background-position: center; | ||
| 383 | + // transition: transform 0.3s ease-in-out; | ||
| 384 | + &:hover { | ||
| 385 | + // transform: scale(1.05); | ||
| 386 | + // box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
| 387 | + cursor: pointer; | ||
| 388 | + } | ||
| 389 | + p { | ||
| 390 | + position: absolute; | ||
| 391 | + bottom: 0; | ||
| 392 | + left: 0; | ||
| 393 | + right: 0; | ||
| 394 | + height: 2rem; | ||
| 395 | + background-color: rgba(0, 0, 0, 0.2); | ||
| 396 | + line-height: 2rem; | ||
| 397 | + } | ||
| 398 | + } | ||
| 337 | .xs-control { | 399 | .xs-control { |
| 338 | display: flex; | 400 | display: flex; |
| 339 | justify-content: flex-end; | 401 | justify-content: flex-end; | ... | ... |
| ... | @@ -1552,6 +1552,13 @@ delayed-stream@~1.0.0: | ... | @@ -1552,6 +1552,13 @@ delayed-stream@~1.0.0: |
| 1552 | resolved "https://mirrors.cloud.tencent.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" | 1552 | resolved "https://mirrors.cloud.tencent.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" |
| 1553 | integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== | 1553 | integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== |
| 1554 | 1554 | ||
| 1555 | +dom7@^2.1.3: | ||
| 1556 | + version "2.1.5" | ||
| 1557 | + resolved "https://mirrors.cloud.tencent.com/npm/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377" | ||
| 1558 | + integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA== | ||
| 1559 | + dependencies: | ||
| 1560 | + ssr-window "^2.0.0" | ||
| 1561 | + | ||
| 1555 | electron-to-chromium@^1.5.4: | 1562 | electron-to-chromium@^1.5.4: |
| 1556 | version "1.5.13" | 1563 | version "1.5.13" |
| 1557 | resolved "https://mirrors.cloud.tencent.com/npm/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6" | 1564 | resolved "https://mirrors.cloud.tencent.com/npm/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6" |
| ... | @@ -2000,6 +2007,11 @@ normalize-wheel@^1.0.1: | ... | @@ -2000,6 +2007,11 @@ normalize-wheel@^1.0.1: |
| 2000 | resolved "https://mirrors.cloud.tencent.com/npm/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45" | 2007 | resolved "https://mirrors.cloud.tencent.com/npm/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45" |
| 2001 | integrity sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA== | 2008 | integrity sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA== |
| 2002 | 2009 | ||
| 2010 | +object-assign@^4.1.1: | ||
| 2011 | + version "4.1.1" | ||
| 2012 | + resolved "https://mirrors.cloud.tencent.com/npm/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" | ||
| 2013 | + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== | ||
| 2014 | + | ||
| 2003 | object-inspect@^1.13.1: | 2015 | object-inspect@^1.13.1: |
| 2004 | version "1.13.2" | 2016 | version "1.13.2" |
| 2005 | resolved "https://mirrors.cloud.tencent.com/npm/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" | 2017 | resolved "https://mirrors.cloud.tencent.com/npm/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" |
| ... | @@ -2338,6 +2350,16 @@ source-map@^0.6.1, source-map@~0.6.0: | ... | @@ -2338,6 +2350,16 @@ source-map@^0.6.1, source-map@~0.6.0: |
| 2338 | resolved "https://mirrors.cloud.tencent.com/npm/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" | 2350 | resolved "https://mirrors.cloud.tencent.com/npm/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" |
| 2339 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== | 2351 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== |
| 2340 | 2352 | ||
| 2353 | +ssr-window@^1.0.1: | ||
| 2354 | + version "1.0.1" | ||
| 2355 | + resolved "https://mirrors.cloud.tencent.com/npm/ssr-window/-/ssr-window-1.0.1.tgz#30752a6a4666e7767f0b7e6aa6fc2fdbd0d9b369" | ||
| 2356 | + integrity sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg== | ||
| 2357 | + | ||
| 2358 | +ssr-window@^2.0.0: | ||
| 2359 | + version "2.0.0" | ||
| 2360 | + resolved "https://mirrors.cloud.tencent.com/npm/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4" | ||
| 2361 | + integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A== | ||
| 2362 | + | ||
| 2341 | supports-color@^5.3.0: | 2363 | supports-color@^5.3.0: |
| 2342 | version "5.5.0" | 2364 | version "5.5.0" |
| 2343 | resolved "https://mirrors.cloud.tencent.com/npm/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" | 2365 | resolved "https://mirrors.cloud.tencent.com/npm/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" |
| ... | @@ -2357,6 +2379,14 @@ supports-preserve-symlinks-flag@^1.0.0: | ... | @@ -2357,6 +2379,14 @@ supports-preserve-symlinks-flag@^1.0.0: |
| 2357 | resolved "https://mirrors.cloud.tencent.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" | 2379 | resolved "https://mirrors.cloud.tencent.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" |
| 2358 | integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== | 2380 | integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== |
| 2359 | 2381 | ||
| 2382 | +swiper@4, swiper@^4.0.7: | ||
| 2383 | + version "4.5.1" | ||
| 2384 | + resolved "https://mirrors.cloud.tencent.com/npm/swiper/-/swiper-4.5.1.tgz#ed43998e780ceb478610079c8d23fd425eca636f" | ||
| 2385 | + integrity sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA== | ||
| 2386 | + dependencies: | ||
| 2387 | + dom7 "^2.1.3" | ||
| 2388 | + ssr-window "^1.0.1" | ||
| 2389 | + | ||
| 2360 | systemjs@^6.15.1: | 2390 | systemjs@^6.15.1: |
| 2361 | version "6.15.1" | 2391 | version "6.15.1" |
| 2362 | resolved "https://mirrors.cloud.tencent.com/npm/systemjs/-/systemjs-6.15.1.tgz#74175b6810e27a79e1177d21db5f0e3057118cea" | 2392 | resolved "https://mirrors.cloud.tencent.com/npm/systemjs/-/systemjs-6.15.1.tgz#74175b6810e27a79e1177d21db5f0e3057118cea" |
| ... | @@ -2465,6 +2495,14 @@ vite@^5.4.1: | ... | @@ -2465,6 +2495,14 @@ vite@^5.4.1: |
| 2465 | optionalDependencies: | 2495 | optionalDependencies: |
| 2466 | fsevents "~2.3.3" | 2496 | fsevents "~2.3.3" |
| 2467 | 2497 | ||
| 2498 | +vue-awesome-swiper@3.1.3: | ||
| 2499 | + version "3.1.3" | ||
| 2500 | + resolved "https://mirrors.cloud.tencent.com/npm/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz#05500b501ffb3fec9bf7eb9985bcf4ae8360ed9e" | ||
| 2501 | + integrity sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg== | ||
| 2502 | + dependencies: | ||
| 2503 | + object-assign "^4.1.1" | ||
| 2504 | + swiper "^4.0.7" | ||
| 2505 | + | ||
| 2468 | vue-router@3.6.5: | 2506 | vue-router@3.6.5: |
| 2469 | version "3.6.5" | 2507 | version "3.6.5" |
| 2470 | resolved "https://mirrors.cloud.tencent.com/npm/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8" | 2508 | resolved "https://mirrors.cloud.tencent.com/npm/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8" | ... | ... |
-
Please register or login to post a comment