Showing
4 changed files
with
327 additions
and
98 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2024-09-26 13:36:06 | 2 | * @Date: 2024-09-26 13:36:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-11-07 18:08:31 | 4 | + * @LastEditTime: 2024-11-29 10:13:28 |
| 5 | * @FilePath: /hager/src/api/hager.js | 5 | * @FilePath: /hager/src/api/hager.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -17,6 +17,8 @@ const Api = { | ... | @@ -17,6 +17,8 @@ const Api = { |
| 17 | PRODUCT_INFO: '/srv/?a=detail&type=product', | 17 | PRODUCT_INFO: '/srv/?a=detail&type=product', |
| 18 | PRODUCT_SEARCH: '/srv/?a=cate&type=product_search', | 18 | PRODUCT_SEARCH: '/srv/?a=cate&type=product_search', |
| 19 | SOLUTION: '/srv/?a=cate&type=solution', | 19 | SOLUTION: '/srv/?a=cate&type=solution', |
| 20 | + SOLUTION_CASE: '/srv/?a=cate&type=case', | ||
| 21 | + SOLUTION_DETAIL: '/srv/?a=detail&type=case', | ||
| 20 | FOOTER: '/srv/?a=footer', | 22 | FOOTER: '/srv/?a=footer', |
| 21 | REGISTER: '/srv/?a=user&type=register', | 23 | REGISTER: '/srv/?a=user&type=register', |
| 22 | LOGIN: '/srv/?a=user&type=login', | 24 | LOGIN: '/srv/?a=user&type=login', |
| ... | @@ -47,6 +49,10 @@ export const getProductSearchAPI = (params) => fn(fetch.get(Api.PRODUCT_SEARCH, | ... | @@ -47,6 +49,10 @@ export const getProductSearchAPI = (params) => fn(fetch.get(Api.PRODUCT_SEARCH, |
| 47 | 49 | ||
| 48 | export const getSolutionListAPI = (params) => fn(fetch.get(Api.SOLUTION, params)); | 50 | export const getSolutionListAPI = (params) => fn(fetch.get(Api.SOLUTION, params)); |
| 49 | 51 | ||
| 52 | +export const getSolutionCaseAPI = (params) => fn(fetch.get(Api.SOLUTION_CASE, params)); | ||
| 53 | +export const getSolutionDetailAPI = (params) => fn(fetch.get(Api.SOLUTION_DETAIL, params)); | ||
| 54 | + | ||
| 55 | + | ||
| 50 | export const getFooterAPI = (params) => fn(fetch.get(Api.FOOTER, params)); | 56 | export const getFooterAPI = (params) => fn(fetch.get(Api.FOOTER, params)); |
| 51 | 57 | ||
| 52 | export const registerAPI = (params) => fn(fetch.post(Api.REGISTER, params)); | 58 | export const registerAPI = (params) => fn(fetch.post(Api.REGISTER, params)); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-18 12:06:09 | 2 | * @Date: 2024-10-18 12:06:09 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-11-04 09:40:35 | 4 | + * @LastEditTime: 2024-11-29 13:43:42 |
| 5 | * @FilePath: /hager/src/views/solution/case.vue | 5 | * @FilePath: /hager/src/views/solution/case.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -10,18 +10,105 @@ | ... | @@ -10,18 +10,105 @@ |
| 10 | <hager-box> | 10 | <hager-box> |
| 11 | <div style="margin-top: 1.5rem;"> | 11 | <div style="margin-top: 1.5rem;"> |
| 12 | <el-breadcrumb separator="/"> | 12 | <el-breadcrumb separator="/"> |
| 13 | - <el-breadcrumb-item v-if="!is_xs">解决方案</el-breadcrumb-item> | 13 | + <el-breadcrumb-item v-if="!is_xs" :to="{ path: '/solution/index' }">解决方案</el-breadcrumb-item> |
| 14 | - <el-breadcrumb-item>商建解决方案</el-breadcrumb-item> | 14 | + <el-breadcrumb-item :to="{ path: casePath }">{{ success_info.category_name }}</el-breadcrumb-item> |
| 15 | <el-breadcrumb-item>成功案例</el-breadcrumb-item> | 15 | <el-breadcrumb-item>成功案例</el-breadcrumb-item> |
| 16 | </el-breadcrumb> | 16 | </el-breadcrumb> |
| 17 | </div> | 17 | </div> |
| 18 | </hager-box> | 18 | </hager-box> |
| 19 | - <hager-box class="box-n"> | 19 | + <hager-box v-if="!is_xs" class="box-n"> |
| 20 | - <hager-h1 title="深圳华侨城洲际酒店" sub="异域风情 奢华享受"></hager-h1> | 20 | + <el-row class="solution-case-banner"> |
| 21 | + <el-col :span="8"> | ||
| 22 | + <div class="solution-case-box"> | ||
| 23 | + <div class="title"> | ||
| 24 | + <p class="c">{{ success_info.post_title }}</p> | ||
| 25 | + <p class="e">{{ success_info.post_subtitle }}</p> | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + </el-col> | ||
| 29 | + <el-col :span="16"> | ||
| 30 | + <div class="solution-case-img" :style="{ 'background-image': 'url(' + top_banner + ')' }"></div> | ||
| 31 | + </el-col> | ||
| 32 | + </el-row> | ||
| 33 | + </hager-box> | ||
| 34 | + <div v-else> | ||
| 35 | + <div style="padding: 1rem;"> | ||
| 36 | + <div class="solution-case-img xs" :style="{ 'background-image': 'url(' + top_banner + ')' }"></div> | ||
| 37 | + <div class="solution-case-box xs"> | ||
| 38 | + <div class="title"> | ||
| 39 | + <p class="c xs">{{ success_info.post_title }}</p> | ||
| 40 | + <p class="e xs">{{ success_info.post_subtitle }}</p> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + <hager-box> | ||
| 46 | + <div :class="['solution-case-intro', is_xs ? 'xs' : '']"> | ||
| 47 | + <p v-html="success_info.post_excerpt"></p> | ||
| 48 | + </div> | ||
| 49 | + </hager-box> | ||
| 50 | + <hager-box v-if="!is_xs" class="box-n"> | ||
| 51 | + <el-row class="solution-case-banner"> | ||
| 52 | + <el-col :span="16"> | ||
| 53 | + <div class="solution-case-img" :style="{ 'background-image': 'url(' + text_img + ')' }"></div> | ||
| 54 | + </el-col> | ||
| 55 | + <el-col :span="8"> | ||
| 56 | + <div class="solution-case-box" style="padding: 1rem 2rem;"> | ||
| 57 | + <p v-html="success_info.post_content"></p> | ||
| 58 | + <!-- <div class="title"> | ||
| 59 | + <p class="c" style="font-size: 1.1rem;">智能产品 精准助力</p> | ||
| 60 | + </div> | ||
| 61 | + <p style="overflow-y: auto; margin-top: 0.5rem;"> | ||
| 62 | + 海格电气为新疆华电哈密2×100万千瓦煤电项目提供有力的技术支持,提供智能空气断路器、塑壳断路器,EW交流接触器等智能化产品和服务。 | ||
| 63 | + HW+空气断路器全系列均标配了LCD液晶显示屏,具有高对比度、高亮度、大字体的特点,方便运维人员在明亮的环境或黑暗的环境下,从不同方向,不同角度轻松读取数据,快速做出运维决策。 | ||
| 64 | + 塑壳断路器采用智能型控制器与微处理器技术,LSI型脱扣单元具有动作电流和动作时间在线调整功能。其中,短路短延时时间可从0.05S调整到1S,调整范围更加宽泛,为现场实现选择性保护提供技术支撑。 | ||
| 65 | + </p> --> | ||
| 66 | + </div> | ||
| 67 | + </el-col> | ||
| 68 | + </el-row> | ||
| 21 | </hager-box> | 69 | </hager-box> |
| 70 | + <div v-else> | ||
| 71 | + <div style="padding: 1rem;"> | ||
| 72 | + <!-- <div class="solution-case-img xs" :style="{ 'background-image': 'url('+ item.img +')' }"></div> --> | ||
| 73 | + <div class="solution-case-img xs" :style="{ 'background-image': 'url(' + text_img + ')' }"></div> | ||
| 74 | + <div class="solution-case-box xs"> | ||
| 75 | + <p v-html="success_info.post_content"></p> | ||
| 76 | + <!-- <div class="title"> | ||
| 77 | + <p class="c xs">智能产品 精准助力</p> | ||
| 78 | + </div> | ||
| 79 | + <p style="margin-top: 1rem;"> | ||
| 80 | + 海格电气为新疆华电哈密2×100万千瓦煤电项目提供有力的技术支持,提供智能空气断路器、塑壳断路器,EW交流接触器等智能化产品和服务。 | ||
| 81 | + HW+空气断路器全系列均标配了LCD液晶显示屏,具有高对比度、高亮度、大字体的特点,方便运维人员在明亮的环境或黑暗的环境下,从不同方向,不同角度轻松读取数据,快速做出运维决策。 | ||
| 82 | + 塑壳断路器采用智能型控制器与微处理器技术,LSI型脱扣单元具有动作电流和动作时间在线调整功能。其中,短路短延时时间可从0.05S调整到1S,调整范围更加宽泛,为现场实现选择性保护提供技术支撑。 | ||
| 83 | + </p> --> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 22 | <hager-box> | 87 | <hager-box> |
| 23 | - <div class="case-title">{{ title }}</div> | 88 | + <div :class="['case-content', is_xs ? 'xs' : '']" v-html="success_info.post_text"></div> |
| 24 | - <div :class="['case-content', is_xs ? 'xs' : '']" v-html="content"></div> | 89 | + </hager-box> |
| 90 | + <hager-box class="box-n"> | ||
| 91 | + <div style="padding: 1vw; background-color: #F3F3F3;"> | ||
| 92 | + <swiper ref="myProductSwiper" class="swiper" :options="swiperOption" @slideChange="onProductSlideChange"> | ||
| 93 | + <swiper-slide v-for="(item, index) in case_img" :key="index"> | ||
| 94 | + <div class="solution-card-box"> | ||
| 95 | + <div class="card-image-wrapper"> | ||
| 96 | + <!-- <el-image :src="item.src" fit="fit"></el-image> --> | ||
| 97 | + <img :src="item.value" style=""> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + </swiper-slide> | ||
| 101 | + </swiper> | ||
| 102 | + <div v-if="case_img.length > productSlidesPerView || is_xs" class="hager-product-center-more"> | ||
| 103 | + <!-- <hager-more></hager-more> --> | ||
| 104 | + <div class="xs-control"> | ||
| 105 | + <div> | ||
| 106 | + <i :class="['el-icon-arrow-left', activeProductIndex === 0 ? 'disabled' : '']" @click="prevProductBtn()"></i> | ||
| 107 | + <i :class="['el-icon-arrow-right', reach_product_end ? 'disabled' : '']" @click="nextProductBtn()"></i> | ||
| 108 | + </div> | ||
| 109 | + </div> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 25 | </hager-box> | 112 | </hager-box> |
| 26 | </div> | 113 | </div> |
| 27 | </template> | 114 | </template> |
| ... | @@ -30,26 +117,95 @@ | ... | @@ -30,26 +117,95 @@ |
| 30 | import mixin from 'common/mixin'; | 117 | import mixin from 'common/mixin'; |
| 31 | import hagerBox from '@/components/common/hagerBox'; | 118 | import hagerBox from '@/components/common/hagerBox'; |
| 32 | import hagerH1 from '@/components/common/hagerH1.vue'; | 119 | import hagerH1 from '@/components/common/hagerH1.vue'; |
| 33 | -import { getNewsDetailAPI } from "@/api/hager.js"; | 120 | +import { getSolutionDetailAPI } from "@/api/hager.js"; |
| 34 | 121 | ||
| 35 | export default { | 122 | export default { |
| 36 | components: { hagerBox }, | 123 | components: { hagerBox }, |
| 37 | mixins: [mixin.init], | 124 | mixins: [mixin.init], |
| 38 | data () { | 125 | data () { |
| 39 | return { | 126 | return { |
| 40 | - title: '默认标题', | 127 | + product_list: [], |
| 41 | - content: '默认内容', | 128 | + swiperOption: { |
| 129 | + slidesPerView: 2, | ||
| 130 | + spaceBetween: 50, | ||
| 131 | + preventClicks : true, | ||
| 132 | + slideToClickedSlide: false, | ||
| 133 | + touchRatio: 0, | ||
| 134 | + breakpoints: { | ||
| 135 | + 1024: { | ||
| 136 | + slidesPerView: 4, | ||
| 137 | + spaceBetween: 20 | ||
| 138 | + }, | ||
| 139 | + 768: { | ||
| 140 | + slidesPerView: 3, | ||
| 141 | + spaceBetween: 20 | ||
| 142 | + }, | ||
| 143 | + 640: { | ||
| 144 | + slidesPerView: 2, | ||
| 145 | + spaceBetween: 20 | ||
| 146 | + }, | ||
| 147 | + 320: { | ||
| 148 | + slidesPerView: 2, | ||
| 149 | + spaceBetween: 10 | ||
| 150 | + }, | ||
| 151 | + 160: { | ||
| 152 | + slidesPerView: 1, | ||
| 153 | + spaceBetween: 0 | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + }, | ||
| 157 | + activeProductIndex: 0, | ||
| 158 | + reach_product_end: false, | ||
| 159 | + productSlidesPerView: 4, | ||
| 160 | + success_info: {}, | ||
| 161 | + top_banner: '', | ||
| 162 | + text_img: '', | ||
| 163 | + case_img: [], | ||
| 164 | + } | ||
| 165 | + }, | ||
| 166 | + computed: { | ||
| 167 | + casePath () { | ||
| 168 | + return `/solution/detail?id=${this.success_info.category_id}`; | ||
| 169 | + } | ||
| 170 | + }, | ||
| 171 | + watch: { | ||
| 172 | + 'top_banner' (v) { | ||
| 173 | + console.warn(v); | ||
| 42 | } | 174 | } |
| 43 | }, | 175 | }, |
| 44 | async mounted () { | 176 | async mounted () { |
| 45 | - const { code, data } = await getNewsDetailAPI({ id: this.$route.query.id }); | 177 | + const { code, data } = await getSolutionDetailAPI({ id: this.$route.query.id }); |
| 46 | if (code) { | 178 | if (code) { |
| 47 | - this.title = data.post_title; | 179 | + this.success_info = data; |
| 48 | - this.content = data.product_advantages; | 180 | + this.top_banner = this.success_info.file?.top_img ? this.success_info.file?.top_img[0]['value'] : ''; |
| 181 | + this.text_img = data.file?.left_img ? data.file?.left_img[0]['value'] : ''; | ||
| 182 | + this.case_img = data.file?.img_list ? data.file?.img_list : []; | ||
| 49 | } | 183 | } |
| 184 | + | ||
| 185 | + this.$nextTick(() => { | ||
| 186 | + this.$refs.myProductSwiper.$swiper?.on('breakpoint', (swiper) => { | ||
| 187 | + // breakpoint时 显示的条数 | ||
| 188 | + this.productSlidesPerView = swiper.slidesPerView | ||
| 189 | + }); | ||
| 190 | + }); | ||
| 50 | }, | 191 | }, |
| 51 | methods: { | 192 | methods: { |
| 193 | + prevProductBtn () { | ||
| 194 | + this.$refs.myProductSwiper.$swiper.slidePrev(); | ||
| 195 | + }, | ||
| 196 | + nextProductBtn () { | ||
| 197 | + this.$refs.myProductSwiper.$swiper.slideNext(); | ||
| 198 | + }, | ||
| 199 | + onProductSlideChange () { | ||
| 200 | + this.activeProductIndex = this.$refs.myProductSwiper.$swiper.activeIndex; | ||
| 201 | + const isEnd = this.$refs.myProductSwiper.$swiper.isEnd; | ||
| 52 | 202 | ||
| 203 | + if (isEnd) { | ||
| 204 | + this.reach_product_end = true; | ||
| 205 | + } else { | ||
| 206 | + this.reach_product_end = false; | ||
| 207 | + } | ||
| 208 | + }, | ||
| 53 | } | 209 | } |
| 54 | } | 210 | } |
| 55 | </script> | 211 | </script> |
| ... | @@ -72,6 +228,101 @@ export default { | ... | @@ -72,6 +228,101 @@ export default { |
| 72 | } | 228 | } |
| 73 | } | 229 | } |
| 74 | 230 | ||
| 231 | + .solution-case-img { | ||
| 232 | + width: 100%; | ||
| 233 | + height: 35rem; | ||
| 234 | + background-repeat: no-repeat; | ||
| 235 | + background-size: cover; | ||
| 236 | + background-position: center; | ||
| 237 | + &.xs { | ||
| 238 | + height: 15rem; | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + .solution-case-box { | ||
| 243 | + background-color: #F7F7F7; | ||
| 244 | + position: relative; /* 父容器设置为相对定位 */ | ||
| 245 | + padding: 2rem; | ||
| 246 | + height: 35rem; /* 让 .about-box 撑满父容器 */ | ||
| 247 | + box-sizing: border-box; | ||
| 248 | + display: flex; | ||
| 249 | + flex-direction: column; | ||
| 250 | + justify-content: center; | ||
| 251 | + &.xs { | ||
| 252 | + height: auto; | ||
| 253 | + } | ||
| 254 | + .title { | ||
| 255 | + font-weight: bold; | ||
| 256 | + word-break: break-all; | ||
| 257 | + .c { | ||
| 258 | + font-size: 1.5rem; | ||
| 259 | + color: @secondary-color; | ||
| 260 | + line-height: 1.5; | ||
| 261 | + &.xs { | ||
| 262 | + font-size: 1.5rem; | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + .e { | ||
| 266 | + font-size: 1.2rem; | ||
| 267 | + color: @primary-color; | ||
| 268 | + margin-top: 0.5rem; | ||
| 269 | + &.xs { | ||
| 270 | + font-size: 1.1rem; | ||
| 271 | + } | ||
| 272 | + } | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + .solution-case-intro { | ||
| 277 | + padding: 1rem 3rem; | ||
| 278 | + &.xs { | ||
| 279 | + padding: 1rem; | ||
| 280 | + } | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + .solution-card-box { | ||
| 284 | + .card-image-wrapper { | ||
| 285 | + // background-color: #F3F3F3; | ||
| 286 | + border-radius: 5px; | ||
| 287 | + transition: transform 0.3s ease-in-out; | ||
| 288 | + // &:hover { | ||
| 289 | + // transform: scale(1.05); | ||
| 290 | + // // box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
| 291 | + // cursor: pointer; | ||
| 292 | + // } | ||
| 293 | + img { | ||
| 294 | + width: 100%; | ||
| 295 | + // margin-left: calc((100%) / 2); | ||
| 296 | + height: auto; | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + .card-title { | ||
| 300 | + color: @text-color; | ||
| 301 | + font-weight: bold; | ||
| 302 | + margin: 1rem 0; | ||
| 303 | + &:hover { | ||
| 304 | + cursor: pointer; | ||
| 305 | + text-decoration: underline; | ||
| 306 | + } | ||
| 307 | + } | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + .xs-control { | ||
| 311 | + display: flex; | ||
| 312 | + justify-content: flex-end; | ||
| 313 | + margin-top: 1rem; | ||
| 314 | + i { | ||
| 315 | + font-size: 1.35rem; | ||
| 316 | + color: #EE6D10; | ||
| 317 | + &:hover { | ||
| 318 | + cursor: pointer; | ||
| 319 | + } | ||
| 320 | + &.disabled { | ||
| 321 | + color: #ccc; | ||
| 322 | + } | ||
| 323 | + } | ||
| 324 | + } | ||
| 325 | + | ||
| 75 | .case-title { | 326 | .case-title { |
| 76 | color: @secondary-color; | 327 | color: @secondary-color; |
| 77 | text-align: center; | 328 | text-align: center; |
| ... | @@ -81,8 +332,9 @@ export default { | ... | @@ -81,8 +332,9 @@ export default { |
| 81 | } | 332 | } |
| 82 | 333 | ||
| 83 | :deep(.case-content) { | 334 | :deep(.case-content) { |
| 84 | - margin-bottom: 2rem; | 335 | + padding: 1rem 3rem; |
| 85 | &.xs { | 336 | &.xs { |
| 337 | + padding: 1rem; | ||
| 86 | img { | 338 | img { |
| 87 | width: 100%; | 339 | width: 100%; |
| 88 | height: auto; | 340 | height: auto; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-09-29 15:49:27 | 2 | * @Date: 2024-09-29 15:49:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-11-10 11:53:25 | 4 | + * @LastEditTime: 2024-11-29 11:26:32 |
| 5 | * @FilePath: /hager/src/views/solution/detail.vue | 5 | * @FilePath: /hager/src/views/solution/detail.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | <div class="hager-solution-detail"> | 9 | <div class="hager-solution-detail"> |
| 10 | - <hager-box v-if="!is_xs" class="top-img" :style="{ backgroundImage: 'url(https://cdn.ipadbiz.cn/hager/banner/banner03@2x.png)' }"> | 10 | + <hager-box v-if="!is_xs" class="top-img" :style="{ backgroundImage: 'url(' + case_banner + ')' }"> |
| 11 | <div class="banner-text-wrapper top-center"> | 11 | <div class="banner-text-wrapper top-center"> |
| 12 | <div class="text"> | 12 | <div class="text"> |
| 13 | - <p class="title" style="margin-bottom: 0;">学校解决方案</p> | 13 | + <p class="title" style="margin-bottom: 0;">{{ case_info.category_name }}</p> |
| 14 | - <p class="sub">Campus Solution</p> | 14 | + <p class="sub">{{ case_info.category_name_en }}</p> |
| 15 | </div> | 15 | </div> |
| 16 | - <!-- <div class="text-sub"> | ||
| 17 | - 海格用丰富的行业知识和应用经验,为多个行业提供先进的数字化解决方案。 | ||
| 18 | - </div> --> | ||
| 19 | </div> | 16 | </div> |
| 20 | </hager-box> | 17 | </hager-box> |
| 21 | <hager-box v-if="!is_xs" class="box-n"> | 18 | <hager-box v-if="!is_xs" class="box-n"> |
| 22 | <el-row :gutter="0"> | 19 | <el-row :gutter="0"> |
| 23 | <el-col :span="12" style="height: 25rem;"> | 20 | <el-col :span="12" style="height: 25rem;"> |
| 24 | <el-carousel height="25rem" :interval="8000" style="border-radius: 5px;"> | 21 | <el-carousel height="25rem" :interval="8000" style="border-radius: 5px;"> |
| 25 | - <el-carousel-item v-for="(item, index) in banner_list" :key="index" class="carousel-img"> | 22 | + <el-carousel-item v-for="(item, index) in case_img" :key="index" class="carousel-img"> |
| 26 | - <el-image @click="onClickImg(item.src)" style="width: 100%; height: 100%;" fit="fill" :src="item.src"></el-image> | 23 | + <el-image @click="onClickImg(item)" style="width: 100%; height: 100%;" fit="fill" :src="item"></el-image> |
| 27 | </el-carousel-item> | 24 | </el-carousel-item> |
| 28 | </el-carousel> | 25 | </el-carousel> |
| 29 | </el-col> | 26 | </el-col> |
| 30 | <el-col :span="12" class="brief-introduction"> | 27 | <el-col :span="12" class="brief-introduction"> |
| 31 | <div class="intro-box"> | 28 | <div class="intro-box"> |
| 32 | - <!-- <hager-h1 title="学校解决方案" sub="Electronic solutions"></hager-h1> --> | 29 | + <p style="margin: 2rem 0;" v-html="case_info.category_description"></p> |
| 33 | - <p style="margin: 2rem 0;">淨於电气开乐驾能民电峰决方案,提供安全。可靠。摄作友好。易于堆护的电力划! 1h14. n53 X0(009121 3098. 228 41324849 56MeD 换至备用电源,保障救学和生活的连续性。</p> | 30 | + <!-- <i class="el-icon-right"></i> --> |
| 34 | - <i class="el-icon-right"></i> | ||
| 35 | </div> | 31 | </div> |
| 36 | </el-col> | 32 | </el-col> |
| 37 | </el-row> | 33 | </el-row> |
| ... | @@ -39,16 +35,16 @@ | ... | @@ -39,16 +35,16 @@ |
| 39 | <div v-else> | 35 | <div v-else> |
| 40 | <div style="height: 25rem; margin-top: 2rem;"> | 36 | <div style="height: 25rem; margin-top: 2rem;"> |
| 41 | <el-carousel height="25rem" :interval="8000" style="border-radius: 5px;"> | 37 | <el-carousel height="25rem" :interval="8000" style="border-radius: 5px;"> |
| 42 | - <el-carousel-item v-for="(item, index) in banner_list" :key="index" class="carousel-img"> | 38 | + <el-carousel-item v-for="(item, index) in case_img" :key="index" class="carousel-img"> |
| 43 | - <el-image @click="onClickImg(item.src)" style="width: 100%; height: 100%;" fit="fill" :src="item.src"></el-image> | 39 | + <el-image @click="onClickImg(item)" style="width: 100%; height: 100%;" fit="fill" :src="item"></el-image> |
| 44 | </el-carousel-item> | 40 | </el-carousel-item> |
| 45 | </el-carousel> | 41 | </el-carousel> |
| 46 | </div> | 42 | </div> |
| 47 | <div class="brief-introduction xs"> | 43 | <div class="brief-introduction xs"> |
| 48 | <div class="intro-box xs"> | 44 | <div class="intro-box xs"> |
| 49 | <hager-h1 title="学校解决方案" sub="Electronic solutions"></hager-h1> | 45 | <hager-h1 title="学校解决方案" sub="Electronic solutions"></hager-h1> |
| 50 | - <p style="margin: 2rem 0;">淨於电气开乐驾能民电峰决方案,提供安全。可靠。摄作友好。易于堆护的电力划! 1h14. n53 X0(009121 3098. 228 41324849 56MeD 换至备用电源,保障救学和生活的连续性。</p> | 46 | + <p style="margin: 2rem 0;" v-html="case_info.post_description"></p> |
| 51 | - <i class="el-icon-right"></i> | 47 | + <!-- <i class="el-icon-right"></i> --> |
| 52 | </div> | 48 | </div> |
| 53 | </div> | 49 | </div> |
| 54 | </div> | 50 | </div> |
| ... | @@ -57,10 +53,10 @@ | ... | @@ -57,10 +53,10 @@ |
| 57 | <div v-if="!is_xs"> | 53 | <div v-if="!is_xs"> |
| 58 | <div class="hager-success-cases"> | 54 | <div class="hager-success-cases"> |
| 59 | <div @click="goToCase(item)" class="card" v-for="(item, index) in success_data_list" :key="index"> | 55 | <div @click="goToCase(item)" class="card" v-for="(item, index) in success_data_list" :key="index"> |
| 60 | - <img :src="item.img" alt="学校图片" class="card-image"> | 56 | + <img :src="item.cover" alt="图片" class="card-image"> |
| 61 | <div class="card-content"> | 57 | <div class="card-content"> |
| 62 | - <h3>{{ item.title }}</h3> | 58 | + <h3>{{ item.post_title }}</h3> |
| 63 | - <p>{{ item.sub }}</p> | 59 | + <p v-html="item.post_description"></p> |
| 64 | <i class="el-icon-right"></i> | 60 | <i class="el-icon-right"></i> |
| 65 | </div> | 61 | </div> |
| 66 | </div> | 62 | </div> |
| ... | @@ -74,10 +70,10 @@ | ... | @@ -74,10 +70,10 @@ |
| 74 | <swiper-slide v-for="(item, index) in success_data_list" :key="index"> | 70 | <swiper-slide v-for="(item, index) in success_data_list" :key="index"> |
| 75 | <div @click="goToCase(item)" class="hager-success-cases xs"> | 71 | <div @click="goToCase(item)" class="hager-success-cases xs"> |
| 76 | <div class="card"> | 72 | <div class="card"> |
| 77 | - <img :src="item.img" alt="学校图片" class="card-image"> | 73 | + <img :src="item.cover" alt="图片" class="card-image"> |
| 78 | <div class="card-content"> | 74 | <div class="card-content"> |
| 79 | - <h3>{{ item.title }}</h3> | 75 | + <h3>{{ item.post_title }}</h3> |
| 80 | - <p class="clamp-text">{{ item.sub }}</p> | 76 | + <p class="clamp-text" v-html="item.post_description "></p> |
| 81 | <i class="el-icon-right"></i> | 77 | <i class="el-icon-right"></i> |
| 82 | </div> | 78 | </div> |
| 83 | </div> | 79 | </div> |
| ... | @@ -102,9 +98,9 @@ | ... | @@ -102,9 +98,9 @@ |
| 102 | <div class="card-box" @click="goToProduct(item)"> | 98 | <div class="card-box" @click="goToProduct(item)"> |
| 103 | <div class="card-image-wrapper"> | 99 | <div class="card-image-wrapper"> |
| 104 | <!-- <el-image :src="item.src" fit="fit"></el-image> --> | 100 | <!-- <el-image :src="item.src" fit="fit"></el-image> --> |
| 105 | - <img :src="item.src" style=""> | 101 | + <img :src="item.cover" style=""> |
| 106 | </div> | 102 | </div> |
| 107 | - <p class="card-title">{{ item.title }}</p> | 103 | + <p class="card-title">{{ item.post_title }}</p> |
| 108 | </div> | 104 | </div> |
| 109 | </swiper-slide> | 105 | </swiper-slide> |
| 110 | </swiper> | 106 | </swiper> |
| ... | @@ -130,63 +126,26 @@ import hagerMore from '@/components/hagerMore.vue'; | ... | @@ -130,63 +126,26 @@ import hagerMore from '@/components/hagerMore.vue'; |
| 130 | import hagerHCarousel from '@/components/hagerHCarousel.vue'; | 126 | import hagerHCarousel from '@/components/hagerHCarousel.vue'; |
| 131 | import hagerService from '@/components/common/hagerService.vue'; | 127 | import hagerService from '@/components/common/hagerService.vue'; |
| 132 | import $ from 'jquery'; | 128 | import $ from 'jquery'; |
| 129 | +import { getSolutionCaseAPI } from "@/api/hager.js"; | ||
| 133 | 130 | ||
| 134 | export default { | 131 | export default { |
| 132 | + metaInfo: { | ||
| 133 | + // title: '海格电气官方网站', | ||
| 134 | + meta: [ | ||
| 135 | + { name: 'keyword', content: 'ddddd' }, | ||
| 136 | + { name: 'description', content: '4444' }, | ||
| 137 | + ] | ||
| 138 | + }, | ||
| 135 | components: { hagerBox, hagerH1, hagerMore, hagerHCarousel, hagerService }, | 139 | components: { hagerBox, hagerH1, hagerMore, hagerHCarousel, hagerService }, |
| 136 | mixins: [mixin.init], | 140 | mixins: [mixin.init], |
| 137 | data () { | 141 | data () { |
| 138 | return { | 142 | return { |
| 139 | - banner_list: [ | 143 | + case_info: {}, |
| 140 | - { | 144 | + case_banner: '', |
| 141 | - src: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', | 145 | + case_img: [], |
| 142 | - url: '' | 146 | + banner_list: [], |
| 143 | - }, | 147 | + success_data_list: [], |
| 144 | - { | 148 | + product_list: [], |
| 145 | - src: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', | ||
| 146 | - url: '' | ||
| 147 | - } | ||
| 148 | - ], | ||
| 149 | - success_data_list: [{ | ||
| 150 | - title: '厦门翔城中小学', | ||
| 151 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 152 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 153 | - }, { | ||
| 154 | - title: '厦门翔城中小学', | ||
| 155 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 156 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 157 | - }, { | ||
| 158 | - title: '厦门翔城中小学', | ||
| 159 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 160 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 161 | - }, { | ||
| 162 | - title: '厦门翔城中小学', | ||
| 163 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 164 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 165 | - }, { | ||
| 166 | - title: '厦门翔城中小学', | ||
| 167 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 168 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 169 | - }, { | ||
| 170 | - title: '厦门翔城中小学', | ||
| 171 | - sub: '占地面积约43811.99平方米,总建筑面积约32188.83平方米,规模48个教学班,可提供2400个优质初中学位。翔城中学是翔安第一所拥有游泳馆的中学。', | ||
| 172 | - img: 'https://cdn.ipadbiz.cn/hager/img/WX20241021-135715@2x.png', | ||
| 173 | - }], | ||
| 174 | - product_list: [{ | ||
| 175 | - src: 'https://cdn.ipadbiz.cn/hager/img/KNX%E6%99%BA%E8%83%BD%E6%8E%A7%E5%88%B6%E6%A8%A1%E5%9D%97@2x.png', | ||
| 176 | - title: 'hw01 空气断路器' | ||
| 177 | - }, { | ||
| 178 | - src: 'https://cdn.ipadbiz.cn/hager/img/ats%E8%87%AA%E5%8A%A8%E8%BD%AC%E6%8D%A2%E5%BC%80%E5%85%B3@2x.png', | ||
| 179 | - title: 'h3+ 智能塑壳断路器' | ||
| 180 | - }, { | ||
| 181 | - src: 'https://cdn.ipadbiz.cn/hager/img/h3+%20%E6%99%BA%E8%83%BD%E5%A1%91%E5%A3%B3%E6%96%AD%E8%B7%AF%E5%99%A8@2x.png', | ||
| 182 | - title: 'ats自动转换开关' | ||
| 183 | - }, { | ||
| 184 | - src: 'https://cdn.ipadbiz.cn/hager/img/hw+%20%E7%A9%BA%E6%B0%94%E6%96%AD%E8%B7%AF%E5%99%A8@2x.png', | ||
| 185 | - title: 'KNX智能控制模块' | ||
| 186 | - }, { | ||
| 187 | - src: 'https://cdn.ipadbiz.cn/hager/img/hw+%20%E7%A9%BA%E6%B0%94%E6%96%AD%E8%B7%AF%E5%99%A8@2x.png', | ||
| 188 | - title: 'KNX智能控制模块' | ||
| 189 | - }], | ||
| 190 | swiperOption: { | 149 | swiperOption: { |
| 191 | slidesPerView: 2, | 150 | slidesPerView: 2, |
| 192 | spaceBetween: 50, | 151 | spaceBetween: 50, |
| ... | @@ -224,7 +183,15 @@ export default { | ... | @@ -224,7 +183,15 @@ export default { |
| 224 | productSlidesPerView: 4, | 183 | productSlidesPerView: 4, |
| 225 | } | 184 | } |
| 226 | }, | 185 | }, |
| 227 | - mounted () { | 186 | + async mounted () { |
| 187 | + const { code, data } = await getSolutionCaseAPI({ cid: this.$route.query.id }); | ||
| 188 | + if (code) { | ||
| 189 | + this.case_info = data; | ||
| 190 | + this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner03@2x.png'; | ||
| 191 | + this.case_img = data.file?.img ? data.file?.img : ['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg']; | ||
| 192 | + this.success_data_list = data.list; | ||
| 193 | + this.product_list = data.product; | ||
| 194 | + } | ||
| 228 | this.$nextTick(() => { | 195 | this.$nextTick(() => { |
| 229 | this.$refs.myProductSwiper.$swiper?.on('breakpoint', (swiper) => { | 196 | this.$refs.myProductSwiper.$swiper?.on('breakpoint', (swiper) => { |
| 230 | // breakpoint时 显示的条数 | 197 | // breakpoint时 显示的条数 |
| ... | @@ -258,12 +225,18 @@ export default { | ... | @@ -258,12 +225,18 @@ export default { |
| 258 | }, | 225 | }, |
| 259 | goToProduct (v) { | 226 | goToProduct (v) { |
| 260 | this.$router.push({ | 227 | this.$router.push({ |
| 261 | - path: '/product/detail' | 228 | + path: '/product/detail', |
| 229 | + query: { | ||
| 230 | + id: v.id | ||
| 231 | + } | ||
| 262 | }); | 232 | }); |
| 263 | }, | 233 | }, |
| 264 | goToCase (v) { | 234 | goToCase (v) { |
| 265 | this.$router.push({ | 235 | this.$router.push({ |
| 266 | - path: '/solution/case' | 236 | + path: '/solution/case', |
| 237 | + query: { | ||
| 238 | + id: v.id, | ||
| 239 | + } | ||
| 267 | }); | 240 | }); |
| 268 | }, | 241 | }, |
| 269 | prevProductBtn () { | 242 | prevProductBtn () { |
| ... | @@ -291,7 +264,6 @@ export default { | ... | @@ -291,7 +264,6 @@ export default { |
| 291 | onSuccessSlideChange () { | 264 | onSuccessSlideChange () { |
| 292 | this.activeSuccessIndex = this.$refs.mySuccessSwiper.$swiper.activeIndex; | 265 | this.activeSuccessIndex = this.$refs.mySuccessSwiper.$swiper.activeIndex; |
| 293 | const isEnd = this.$refs.mySuccessSwiper.$swiper.isEnd; | 266 | const isEnd = this.$refs.mySuccessSwiper.$swiper.isEnd; |
| 294 | - console.warn(isEnd); | ||
| 295 | 267 | ||
| 296 | if (isEnd) { | 268 | if (isEnd) { |
| 297 | this.reach_success_end = true; | 269 | this.reach_success_end = true; | ... | ... |
| ... | @@ -126,7 +126,7 @@ export default { | ... | @@ -126,7 +126,7 @@ export default { |
| 126 | } | 126 | } |
| 127 | this.$nextTick(() => { | 127 | this.$nextTick(() => { |
| 128 | // 高度监听 | 128 | // 高度监听 |
| 129 | - this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.4 + 'px'; | 129 | + this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.3 + 'px'; |
| 130 | this.solution_mini_height = $(window).outerWidth() * 0.55 + 'px'; | 130 | this.solution_mini_height = $(window).outerWidth() * 0.55 + 'px'; |
| 131 | // 动态计算图片高度 | 131 | // 动态计算图片高度 |
| 132 | let img_width = $('.card-image').outerWidth(); | 132 | let img_width = $('.card-image').outerWidth(); |
| ... | @@ -141,7 +141,7 @@ export default { | ... | @@ -141,7 +141,7 @@ export default { |
| 141 | methods: { | 141 | methods: { |
| 142 | handleHeightResize () { | 142 | handleHeightResize () { |
| 143 | // 高度监听 | 143 | // 高度监听 |
| 144 | - this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.4 + 'px'; | 144 | + this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.3 + 'px'; |
| 145 | this.solution_mini_height = $('.hager-solution-top').outerWidth() * 0.6 + 'px'; | 145 | this.solution_mini_height = $('.hager-solution-top').outerWidth() * 0.6 + 'px'; |
| 146 | // 动态计算图片高度 | 146 | // 动态计算图片高度 |
| 147 | let img_width = $('.card-image').outerWidth(); | 147 | let img_width = $('.card-image').outerWidth(); |
| ... | @@ -160,7 +160,6 @@ export default { | ... | @@ -160,7 +160,6 @@ export default { |
| 160 | return result; | 160 | return result; |
| 161 | }, | 161 | }, |
| 162 | goToSolution (v) { | 162 | goToSolution (v) { |
| 163 | - console.warn(v); | ||
| 164 | this.$router.push({ | 163 | this.$router.push({ |
| 165 | path: '/solution/detail', | 164 | path: '/solution/detail', |
| 166 | query: { | 165 | query: { |
| ... | @@ -201,7 +200,7 @@ export default { | ... | @@ -201,7 +200,7 @@ export default { |
| 201 | img { | 200 | img { |
| 202 | width: 100%; | 201 | width: 100%; |
| 203 | max-width: 100%; /* 防止宽度超出容器 */ | 202 | max-width: 100%; /* 防止宽度超出容器 */ |
| 204 | - object-fit: fill; /* 保持图片内容的完整性,可以根据需求调整为 cover 或 contain */ | 203 | + object-fit: cover; /* 保持图片内容的完整性,可以根据需求调整为 cover 或 contain */ |
| 205 | } | 204 | } |
| 206 | } | 205 | } |
| 207 | .hager-industry-solutions { | 206 | .hager-industry-solutions { | ... | ... |
-
Please register or login to post a comment