Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-10-29 16:34:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9a9ef6c07b56a0ff46f5866320b6fd9cce47aa61
9a9ef6c0
1 parent
22493a66
解决方案头部图片比例调整
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
src/views/solution/index.vue
src/views/solution/index.vue
View file @
9a9ef6c
<template>
<div class="hager-solution-index">
<hager-box :style="{backgroundColor: '#F5F6FB', height:
top_img
_height }">
<hager-box :style="{backgroundColor: '#F5F6FB', height:
solution_box
_height }">
<div class="hager-solution-top">
<el-row v-if="!is_xs" :gutter="20" style="display: flex;">
<el-col :span="8">
...
...
@@ -14,10 +14,10 @@
</div>
</el-col>
<el-col :span="16">
<img :style="{ height:
top_img
_height, width: '100%' }" src="https://cdn.ipadbiz.cn/hager/banner/01.png">
<img :style="{ height:
solution_box
_height, width: '100%' }" src="https://cdn.ipadbiz.cn/hager/banner/01.png">
</el-col>
</el-row>
<img v-else :style="{ height:
top_img
_height, width: '100%' }" src="https://cdn.ipadbiz.cn/hager/banner/01.png">
<img v-else :style="{ height:
solution_mini
_height, width: '100%' }" src="https://cdn.ipadbiz.cn/hager/banner/01.png">
</div>
</hager-box>
<hager-box class="box-n">
...
...
@@ -76,6 +76,7 @@ import hagerH1 from '@/components/common/hagerH1.vue';
import hagerMore from '@/components/hagerMore.vue';
import hagerService from '@/components/common/hagerService.vue';
import { getSolutionListAPI } from "@/api/hager.js";
import $ from 'jquery';
export default {
components: { hagerBox, hagerH1, hagerMore, hagerService },
...
...
@@ -114,6 +115,8 @@ export default {
},
activeIndex: 0,
reach_end: false,
solution_box_height: '10rem',
solution_mini_height: '10rem',
}
},
async mounted () {
...
...
@@ -121,8 +124,23 @@ export default {
if (code) {
this.solution_list = data;
}
this.$nextTick(() => {
// 高度监听
this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.4 + 'px';
this.solution_mini_height = $('.hager-solution-top').outerWidth() * 0.6 + 'px';
});
window.addEventListener('resize', this.handleHeightResize);
},
beforeDestroy() {
// 在组件销毁前移除监听器,防止内存泄漏
window.removeEventListener('resize', this.handleHeightResize);
},
methods: {
handleHeightResize () {
// 高度监听
this.solution_box_height = $('.hager-solution-top').outerWidth() * 0.4 + 'px';
this.solution_mini_height = $('.hager-solution-top').outerWidth() * 0.6 + 'px';
},
splitListIntoChunks (list) {
const chunkSize = 4; // 每组4个项目
const result = [];
...
...
Please
register
or
login
to post a comment