hookehuyr

✨ feat: 产品中心详情自适应

1 <!-- 1 <!--
2 * @Date: 2024-09-29 14:26:41 2 * @Date: 2024-09-29 14:26:41
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-09-30 15:33:16 4 + * @LastEditTime: 2024-10-11 16:17:21
5 * @FilePath: /hager/src/views/product/detail.vue 5 * @FilePath: /hager/src/views/product/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 <div class="product-detail"> 9 <div class="product-detail">
10 <hager-box> 10 <hager-box>
11 - <div> 11 + <div v-if="!is_xs">
12 <el-breadcrumb separator="/"> 12 <el-breadcrumb separator="/">
13 <el-breadcrumb-item>所有产品</el-breadcrumb-item> 13 <el-breadcrumb-item>所有产品</el-breadcrumb-item>
14 <el-breadcrumb-item>配电产品</el-breadcrumb-item> 14 <el-breadcrumb-item>配电产品</el-breadcrumb-item>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 </div> 18 </div>
19 </hager-box> 19 </hager-box>
20 <hager-box class="box-n"> 20 <hager-box class="box-n">
21 - <el-row :gutter="10" style="margin-bottom: 3rem;"> 21 + <el-row v-if="!is_xs" :gutter="10" style="margin-bottom: 3rem;">
22 <el-col :span="10"> 22 <el-col :span="10">
23 <hager-carousel></hager-carousel> 23 <hager-carousel></hager-carousel>
24 </el-col> 24 </el-col>
...@@ -34,11 +34,25 @@ ...@@ -34,11 +34,25 @@
34 </div> 34 </div>
35 </el-col> 35 </el-col>
36 </el-row> 36 </el-row>
37 + <div v-else>
38 + <div class="product-detail-info">
39 + <div class="product-title" style="">HW+系列空气断路器</div>
40 + <div class="product-sub" style="margin: 1rem 0 2rem;">全新智能型hw+系列空气断路器,可搭载集通讯、自诊断、功能编程、维护预警、远程监控、测量、报警、保护功能于一体的Sentinel Energy控制器。</div>
41 + <ul class="product-info-list">
42 + <li>实现谐波测量,实时监测电能质量;</li>
43 + <li>图文显示多电量参数,系统状态一目了然;</li>
44 + <li>支持Modbus远程通讯协议,无线蓝牙连接等多种通讯方式,全方位提升客户的数字化体验。</li>
45 + </ul>
46 + </div>
47 + <div v-for="(item, index) in images" :key="index" class="product-item-img">
48 + <el-image style="height: 14rem;" :src="item" fit="cover"></el-image>
49 + </div>
50 + </div>
37 </hager-box> 51 </hager-box>
38 <hager-box class="box-2n"> 52 <hager-box class="box-2n">
39 <hager-h1 title="产品优势" sub="Product advantages"></hager-h1> 53 <hager-h1 title="产品优势" sub="Product advantages"></hager-h1>
40 - <div class="product-advantage" style=""> 54 + <div :class="['product-advantage', is_xs ? 'xs' : '']">
41 - <div class="item" v-for="(item, index) in 3" :key="index"> 55 + <div :class="['item', is_xs ? 'xs' : '']" v-for="(item, index) in 3" :key="index">
42 <el-row :gutter="0" v-for="(item, index) in 5" :key="index"> 56 <el-row :gutter="0" v-for="(item, index) in 5" :key="index">
43 <el-col :span="6">极致的分断能力:</el-col> 57 <el-col :span="6">极致的分断能力:</el-col>
44 <el-col :span="18">标配独立的故障指示触点、远程复位、ZSI保护功能</el-col> 58 <el-col :span="18">标配独立的故障指示触点、远程复位、ZSI保护功能</el-col>
...@@ -50,13 +64,13 @@ ...@@ -50,13 +64,13 @@
50 <hager-h1 title="产品资料" sub="Product Information"></hager-h1> 64 <hager-h1 title="产品资料" sub="Product Information"></hager-h1>
51 <div class="product-info"> 65 <div class="product-info">
52 <div class="info-control"> 66 <div class="info-control">
53 - <div class="control-left"> 67 + <div class="control-left xs">
54 - <div :class="['button', is_active === 0 ? 'active' : '']" @click="onClick(0)">产品样本</div> 68 + <div :class="['button xs', is_active === 0 ? 'active' : '']" @click="onClick(0)">产品样本</div>
55 - <div :class="['button', is_active === 1 ? 'active' : '']" @click="onClick(1)">技术参数</div> 69 + <div :class="['button xs', is_active === 1 ? 'active' : '']" @click="onClick(1)">技术参数</div>
56 - <div :class="['button', is_active === 2 ? 'active' : '']" @click="onClick(2)">产品说明书</div> 70 + <div :class="['button xs', is_active === 2 ? 'active' : '']" @click="onClick(2)">产品说明书</div>
57 - <div :class="['button', is_active === 3 ? 'active' : '']" @click="onClick(3)">安装教程</div> 71 + <div :class="['button xs', is_active === 3 ? 'active' : '']" @click="onClick(3)">安装教程</div>
58 </div> 72 </div>
59 - <div> 73 + <div v-if="!is_xs">
60 <div @click="goToDownload" :class="['button', is_download_checked ? 'active' : '']">下载选中</div> 74 <div @click="goToDownload" :class="['button', is_download_checked ? 'active' : '']">下载选中</div>
61 </div> 75 </div>
62 </div> 76 </div>
...@@ -101,7 +115,12 @@ export default { ...@@ -101,7 +115,12 @@ export default {
101 name: '产品样本', 115 name: '产品样本',
102 size: '123MB', 116 size: '123MB',
103 checked: false 117 checked: false
104 - }] 118 + }],
119 + images: [
120 + "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
121 + "https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg",
122 + "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
123 + ]
105 } 124 }
106 }, 125 },
107 computed: { 126 computed: {
...@@ -180,6 +199,12 @@ export default { ...@@ -180,6 +199,12 @@ export default {
180 background-color: #f0f0f0; 199 background-color: #f0f0f0;
181 border-top: 4px solid @primary-color; 200 border-top: 4px solid @primary-color;
182 line-height: 2; 201 line-height: 2;
202 + &.xs {
203 + padding-bottom: 1rem;
204 + }
205 + }
206 + &.xs {
207 + display: block;
183 } 208 }
184 } 209 }
185 .product-info { 210 .product-info {
...@@ -191,12 +216,19 @@ export default { ...@@ -191,12 +216,19 @@ export default {
191 .control-left { 216 .control-left {
192 display: flex; 217 display: flex;
193 flex: 1 0 0; 218 flex: 1 0 0;
219 + &.xs {
220 + display: flex;
221 + flex-wrap: nowrap; /* 禁止换行 */
222 + overflow-x: auto; /* 启用横向滚动 */
223 + -webkit-overflow-scrolling: touch; /* 使滚动更平滑,适用于移动端 */
224 + }
194 } 225 }
195 .button { 226 .button {
196 background-color: #f3f3f3; 227 background-color: #f3f3f3;
197 padding: 1rem 2.2rem; 228 padding: 1rem 2.2rem;
198 border-radius: 5px; 229 border-radius: 5px;
199 margin-right: 1rem; 230 margin-right: 1rem;
231 + text-align: center;
200 &:hover { 232 &:hover {
201 cursor: pointer; 233 cursor: pointer;
202 } 234 }
...@@ -204,6 +236,11 @@ export default { ...@@ -204,6 +236,11 @@ export default {
204 background-color: @primary-color; 236 background-color: @primary-color;
205 color: #fff; 237 color: #fff;
206 } 238 }
239 + &.xs {
240 + flex: 0 0 auto; /* 子元素保持固定大小 */
241 + width: 5rem; /* 可以根据需要设置宽度 */
242 + margin-right: 10px; /* 子元素之间的间距 */
243 + }
207 } 244 }
208 } 245 }
209 .info-list { 246 .info-list {
...@@ -243,5 +280,15 @@ export default { ...@@ -243,5 +280,15 @@ export default {
243 } 280 }
244 } 281 }
245 } 282 }
283 +
284 + .product-item-img {
285 + height: auto;
286 + padding: 1.5rem;
287 + text-align: center;
288 + color: #333;
289 + border-radius: 8px;
290 + background-color: #f3f3f3;
291 + margin-bottom: 1rem;
292 + }
246 } 293 }
247 </style> 294 </style>
......
1 <!-- 1 <!--
2 * @Date: 2024-09-27 16:53:09 2 * @Date: 2024-09-27 16:53:09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-11 15:19:35 4 + * @LastEditTime: 2024-10-11 15:25:43
5 * @FilePath: /hager/src/views/product/index.vue 5 * @FilePath: /hager/src/views/product/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 <div class="product-item-img"> 34 <div class="product-item-img">
35 <el-image style="width: 100%; height: 100%;" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" fit="fit"></el-image> 35 <el-image style="width: 100%; height: 100%;" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" fit="fit"></el-image>
36 </div> 36 </div>
37 - <p class="product-item-title">acb hw 空气断路器</p> 37 + <p @click="goToP(item)" class="product-item-title">acb hw 空气断路器</p>
38 </div> 38 </div>
39 </div> 39 </div>
40 <div style="height: 5rem;"></div> 40 <div style="height: 5rem;"></div>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
45 <div class="product-item-img"> 45 <div class="product-item-img">
46 <el-image style="width: 100%; height: 100%;" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" fit="fit"></el-image> 46 <el-image style="width: 100%; height: 100%;" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" fit="fit"></el-image>
47 </div> 47 </div>
48 - <p class="product-item-title">acb hw 空气断路器</p> 48 + <p @click="goToP(item)" class="product-item-title">acb hw 空气断路器</p>
49 </div> 49 </div>
50 </div> 50 </div>
51 <div style="height: 5rem;"></div> 51 <div style="height: 5rem;"></div>
......