detail.vue
10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!--
* @Date: 2024-09-29 14:26:41
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-21 18:30:13
* @FilePath: /hager/src/views/product/detail.vue
* @Description: 文件描述
-->
<template>
<div class="product-detail">
<hager-box>
<div style="margin-top: 1.5rem;">
<el-breadcrumb separator="/">
<el-breadcrumb-item>所有产品</el-breadcrumb-item>
<el-breadcrumb-item>配电产品</el-breadcrumb-item>
<el-breadcrumb-item>低压主配电</el-breadcrumb-item>
<el-breadcrumb-item>HW+系列空气断路器</el-breadcrumb-item>
</el-breadcrumb>
</div>
</hager-box>
<hager-box class="box-n">
<el-row v-if="!is_xs" :gutter="10" style="margin-bottom: 3rem;">
<el-col :span="10">
<hager-carousel :images="images"></hager-carousel>
</el-col>
<el-col :span="14">
<div class="product-detail-info">
<div class="product-title" style="">HW+系列空气断路器</div>
<div class="product-sub" style="margin: 1rem 0 2rem;">全新智能型hw+系列空气断路器,可搭载集通讯、自诊断、功能编程、维护预警、远程监控、测量、报警、保护功能于一体的Sentinel Energy控制器。</div>
<ul class="product-info-list">
<li>实现谐波测量,实时监测电能质量;</li>
<li>图文显示多电量参数,系统状态一目了然;</li>
<li>支持Modbus远程通讯协议,无线蓝牙连接等多种通讯方式,全方位提升客户的数字化体验。</li>
</ul>
</div>
</el-col>
</el-row>
<div v-else>
<div class="product-detail-info">
<div class="product-title" style="">HW+系列空气断路器</div>
<div class="product-sub" style="margin: 1rem 0 2rem;">全新智能型hw+系列空气断路器,可搭载集通讯、自诊断、功能编程、维护预警、远程监控、测量、报警、保护功能于一体的Sentinel Energy控制器。</div>
<ul class="product-info-list">
<li>实现谐波测量,实时监测电能质量;</li>
<li>图文显示多电量参数,系统状态一目了然;</li>
<li>支持Modbus远程通讯协议,无线蓝牙连接等多种通讯方式,全方位提升客户的数字化体验。</li>
</ul>
</div>
<div v-for="(item, index) in images" :key="index" class="product-item-img">
<el-image style="height: 14rem;" :src="item" fit="cover"></el-image>
</div>
</div>
</hager-box>
<hager-box class="box-2n">
<hager-h1 title="产品优势" sub="Product advantages"></hager-h1>
<div :class="['product-advantage', is_xs ? 'xs' : '']">
<div :class="['item', is_xs ? 'xs' : '']" v-for="(item, index) in 3" :key="index">
<el-row :gutter="0" v-for="(item, index) in 5" :key="index">
<el-col :span="6">极致的分断能力:</el-col>
<el-col :span="18">标配独立的故障指示触点、远程复位、ZSI保护功能</el-col>
</el-row>
</div>
</div>
</hager-box>
<hager-box class="box-n">
<hager-h1 title="产品资料" sub="Product Information"></hager-h1>
<div class="product-info">
<div class="info-control">
<div :class="['control-left', is_xs ? 'xs' : '']">
<div :class="['button', is_xs ? 'xs' : '', is_active === 0 ? 'active' : '']" @click="onClick(0)">产品样本</div>
<div :class="['button', is_xs ? 'xs' : '', is_active === 1 ? 'active' : '']" @click="onClick(1)">技术参数</div>
<div :class="['button', is_xs ? 'xs' : '', is_active === 2 ? 'active' : '']" @click="onClick(2)">产品说明书</div>
<div :class="['button', is_xs ? 'xs' : '', is_active === 3 ? 'active' : '']" @click="onClick(3)">安装教程</div>
</div>
<div v-if="!is_xs">
<div @click="goToDownload" :class="['button', is_download_checked ? 'active' : '']">发送到邮箱</div>
</div>
</div>
<div>
<div class="mini-download-wrapper" v-if="is_xs">
<div>
<span @click="checkAll">全选</span>
<span v-if="checked_sum">已选 {{ checked_sum }}</span>
</div>
<div @click="goToDownload" :class="['button', is_download_checked ? 'active' : '']">发送到邮箱</div>
</div>
<div class="info-list" v-for="(item, index) in download_list" :key="index">
<div class="info-list-title">
<i v-if="item.checked" @click="item.checked = !item.checked" class="el-icon-folder-checked download-checked"></i>
<i v-else @click="item.checked = !item.checked" class="el-icon-folder download-unchecked"></i>
<i class="el-icon-document" style="font-size: 1.25rem; margin-left: 1rem;"></i> {{ item.name }} {{ item.size }}
</div>
<div class="info-list-control">
<div @click="preview(item)">预览</div>
<div @click="sendEmail" class="icon-wrapper">
<img style="height: 1rem;" src="https://cdn.ipadbiz.cn/hager/icon/%E9%82%AE%E4%BB%B6@2x.png">
</div>
</div>
</div>
</div>
</div>
</hager-box>
</div>
</template>
<script>
import mixin from 'common/mixin';
import hagerBox from '@/components/common/hagerBox';
import hagerCarousel from '@/components/hagerCarousel';
import hagerH1 from '@/components/common/hagerH1.vue';
import { MessageBox, Message } from 'element-ui';
export default {
components: { hagerBox, hagerCarousel, hagerH1 },
mixins: [mixin.init],
data () {
return {
is_active: 0,
download_list: [{
id: '123',
name: '产品样本',
size: '123MB',
checked: false
}, {
id: '123',
name: '产品样本',
size: '123MB',
checked: false
}],
images: [
"https://cdn.ipadbiz.cn/hager/img/product/P11.jpg",
"https://cdn.ipadbiz.cn/hager/img/product/t01.jpg",
"https://cdn.ipadbiz.cn/hager/img/product/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240920151453.png",
"https://cdn.ipadbiz.cn/hager/img/product/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240920151457.png",
]
}
},
computed: {
is_download_checked () {
return this.download_list.filter(item => item.checked).length > 0;
},
checked_sum () {
return this.download_list.filter(item => item.checked).length;
},
},
mounted () {
},
methods: {
onClick (n) {
this.is_active = n;
},
goToDownload () {
if (this.is_download_checked) {
// 发送邮箱接口
Message({
type: 'success',
message: '发送成功'
});
}
},
checkAll () {
this.download_list.forEach(item => item.checked = true);
},
sendEmail () {
// 发送邮箱接口
Message({
type: 'success',
message: '发送成功'
});
},
preview (item) {
window.open(item, '_blank');
}
}
}
</script>
<style lang="less" scoped>
.product-detail {
.box-n {
background-color: #fff;
padding: 2rem 0;
}
.box-2n {
background-color: #f1f1f1;
padding: 2rem 0;
}
.product-detail-info {
.product-title {
font-size: 2rem;
font-weight: bold;
color: @secondary-color;
}
.product-sub {
margin: 1rem 0 2rem;
color: @text-color;
}
.product-info-list {
padding: 0 1rem;
li {
line-height: 2;
font-size: 0.9rem;
}
}
}
.product-advantage {
margin-top: 1rem;
display: flex;
flex-wrap: wrap;
gap: 3rem;
.item {
flex: 0 1 calc(50% - 3rem); /* 每行2个元素,减去gap的宽度 */
box-sizing: border-box; /* 确保padding和border不会影响宽度计算 */
padding-top: 1rem;
background-color: #f0f0f0;
border-top: 4px solid @primary-color;
line-height: 2;
&.xs {
padding-bottom: 1rem;
}
}
&.xs {
display: block;
}
}
.product-info {
.info-control {
display: flex;
border-bottom: 4px solid @primary-color;
padding-bottom: 1rem;
margin-top: 2rem;
.control-left {
display: flex;
flex: 1 0 0;
&.xs {
display: flex;
flex-wrap: nowrap; /* 禁止换行 */
overflow-x: auto; /* 启用横向滚动 */
-webkit-overflow-scrolling: touch; /* 使滚动更平滑,适用于移动端 */
}
}
.button {
background-color: #f3f3f3;
padding: 1rem 2.2rem;
border-radius: 5px;
margin-right: 1rem;
text-align: center;
&:hover {
cursor: pointer;
}
&.active {
background-color: @primary-color;
color: #fff;
}
&.xs {
flex: 0 0 auto; /* 子元素保持固定大小 */
width: 5rem; /* 可以根据需要设置宽度 */
margin-right: 10px; /* 子元素之间的间距 */
}
}
}
.info-list {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 2rem;
color: #6b6b6b;
.info-list-title {
display: flex; align-items: center;
}
.info-list-control {
display: flex;
justify-content: center;
align-items: center;
color: @primary-color;
div {
margin-right: 1rem;
&:hover {
cursor: pointer;
color: @primary-color;
text-decoration: underline;
}
}
.icon-wrapper {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
img {
max-width: 100%; /* 确保图片不会超出容器 */
height: auto; /* 保持图片的宽高比 */
}
}
}
.download-checked {
font-size: 1.5rem;
color: @primary-color;
&:hover {
cursor: pointer;
}
}
.download-unchecked {
font-size: 1.5rem;
&:hover {
cursor: pointer;
}
}
}
.mini-download-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1rem;
.button {
background-color: #f3f3f3;
padding: 0.85rem 1rem;
border-radius: 5px;
text-align: center;
&.active {
background-color: @primary-color;
color: #fff;
}
}
}
}
.product-item-img {
height: auto;
padding: 1.5rem;
text-align: center;
color: #333;
border-radius: 8px;
background-color: #FFF;
margin-bottom: 1rem;
border: 1px solid #ebebeb;
}
}
</style>