添加产品页面

master
suixy 3 months ago
parent 646dd5f7b7
commit 87c4feb562

@ -27,7 +27,7 @@ export default new Router({
}, { }, {
path: 'productCenter/edit', component: () => import('@/views/productCenter/edit/index.vue'), path: 'productCenter/edit', component: () => import('@/views/productCenter/edit/index.vue'),
}, { }, {
path: 'productCenter/detail/edit', component: () => import('@/views/productCenter/detail2.vue'), path: 'productCenter/detail/edit', component: () => import('@/views/productCenter/edit/detail.vue'),
}, },
{ {
path: 'industrySolutions', component: () => import('@/views/industrySolutions/index.vue'), path: 'industrySolutions', component: () => import('@/views/industrySolutions/index.vue'),

@ -0,0 +1,598 @@
<template>
<div>
{{data}}
<div class="banner">
<UploadEl style="width: 100%; height: 100%;position:absolute;top: 0;left: 0;" :data="{icon:data.banner}"/>
<UploadEl style="width: 40%; height: 40%;position:absolute;right:10%;top: 30%;" :data="{icon:data.banner1}"/>
<div class="bannerInfo" contenteditable="true" @blur="edit1('bannerTitle',$event)">{{ data.bannerTitle }}</div>
<div class="bannerValue" contenteditable="true" @blur="edit1('bannerValue',$event)">{{ data.bannerValue }}</div>
</div>
<div class="product-container">
<!-- 左侧大图 + 缩略图 -->
<div class="product-left">
<!-- 大图 -->
<div class="main-img">
<el-image :src="activeImg" fit="contain"></el-image>
</div>
<!-- 缩略图 -->
<div class="thumb-list">
<div
v-for="(img, index) in data.imgList"
:key="index"
class="thumb-item"
:class="{ active: activeIndex === index }"
@mouseenter="changeImg(index)"
>
<UploadEl style=" " :data="{icon:img}"/>
</div>
<div class="thumb-item"
@click="data.imgList.push('')">
<i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 60px"></i>
</div>
</div>
</div>
<!-- 右侧文字 -->
<div class="product-right">
<h2 class="title">产品特点</h2>
<ul class="features">
<li v-for="(item, i) in data.features" :key="i">
<i class="el-icon-circle-check"></i>
<span contenteditable="true" @blur="edit2('name',i,$event)">
{{ item.name }}
</span>
</li>
<li class="thumb-item"
@click="data.features.push({name:''})">
<i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 60px"></i>
</li>
</ul>
</div>
</div>
<div class="param-container" style="padding: 5vw 10vw;background-color: #0001">
<h2 class="title1" style="line-height: 40px">产品参数</h2>
<div class="paramsTable" v-for="(param, index) in data.params" :key="index">
<div class="th">
<div class="th1" contenteditable="true" @blur="edit3('title',index,$event)">{{ param.title }}</div>
<div class="th2">参数值</div>
</div>
<div class="td">
<div v-for="(item, idx) in param.list" :key="idx">
<div class="td1" contenteditable="true" @blur="edit4('name',index,idx,$event)">{{ item.name }}</div>
<div class="td2" contenteditable="true" @blur="edit4('value',index,idx,$event)">{{ item.value }}</div>
</div>
</div>
<div class="td">
<div class="td1"
@click="data.params[index].list.push({name:'',value:''})">
<i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 60px"></i>
</div>
</div>
</div>
<div class="td"
@click="data.params.push({title:'',list:[]})">
<i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 60px"></i>
</div>
</div>
<div class="param-container" style="padding: 5vw 10vw;background-color: #fff">
<h2 class="title1" style="line-height: 40px">资料下载</h2>
<div>
<div v-for="i in fileList" class="fileCard" style="text-align: left">
<div class="cardTitle">{{ i.name }}</div>
<div class="cardValue">{{ i.value }}</div>
<el-button @click="downFile(i)" type="primary" class="downIcon" icon="el-icon-download " circle></el-button>
</div>
</div>
</div>
<ContactUs class="contactUs"/>
<Copyright class="copyright"/>
</div>
</template>
<script>
import ContactUs from '@/components/contactUs'
import Copyright from '@/components/copyright'
import {selectMenuTree} from "@/api/productCenter";
import UploadEl from "@/components/editEl/uploadEl.vue";
export default {
name: 'ProductCenter',
components: {
UploadEl,
ContactUs,
Copyright,
},
data() {
return {
fileList: [
{
name: '操作指南',
value: '硬件操作指南',
url: ''
},
{
name: '操作指南',
value: '硬件操作指南',
url: ''
},
],
activeIndex: 0,
data:{
banner: 'https://www.genrace.com/template/default/images/pages/prodDetail-banner.jpg',
banner1:'https://www.genrace.com/static/upload/image/20250414/1744615648137412.png',
bannerTitle: 'HW-R300系列',
bannerValue: '中端距离1路输入体积小巧TCP/RS485。',
imgList: [
"http://1.13.177.47:9665/statics/2025/08/25/%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91_20250825192156A181.png",
"https://www.genrace.com/static/upload/image/20250414/1744615648137412.png",
"http://1.13.177.47:9665/statics/2025/08/25/23_20250825192255A182.png",
],
features: [{name:"紧凑型圆极化天线"},],
params:[
{
title:'参数',
list:[
{ name: "射频协议", value: "ISO/IEC 18000-63 /EPC Gen2v2" },
{ name: "工作频段", value: "中国频段920-925MHz\n其他国家频段可定制" },
{ name: "发射功率", value: "10-26dBm 可调,步进 1 dB精度±1dB" },
{ name: "天线增益", value: "3dBi" },
{ name: "天线驻波比", value: "≦21" },
{ name: "盘点速率", value: "120 tag/s" },
{ name: "读卡距离", value: "读取TPALN9662标签,最大读距1.4m(读距随标签型号不同而有所差异)" },
{ name: "通讯接口", value: "TCP/IPM12-4-A航空头、 RS485M12-5-B 航空头)" },
{ name: "通讯协议", value: "Modbus-RTU通信协议网口TCP提供基于C#的SDK接口适配工业总线协议外接网关选配" },
{ name: "GPIO端口", value: "M12-5-B 航空接口,兼容 5~24V 电平1路输入" },
{ name: "声音指示", value: "1个蜂鸣器" },
{ name: "开发接口", value: "支持 C#、JAVA" },
{ name: "供电电源", value: "1224VDC(推荐 12V 标配适配器)" },
{ name: "整机峰值功率", value: "2.5W" },
{ name: "外形尺寸", value: "90mm*90mm*32 mm" },
{ name: "产品重量", value: "约288g" },
{ name: "外壳材料", value: "铝合金+PC" },
{ name: "外壳颜色", value: "黑色、银色" },
{ name: "工作温度", value: "-25℃~60℃" },
{ name: "存储温度", value: "-40℃~85℃" },
{ name: "工作湿度", value: "5%~95%RH 无冷凝" },
{ name: "IP等级", value: "IP54" },
]
},
]
}
}
},
computed: {
activeImg() {
return this.data.imgList[this.activeIndex];
},
},
mounted() {
this.getData()
},
watch: {
'$route'() {
this.getData()
}
},
methods: {
changeImg(index) {
this.activeIndex = index;
},
edit1(key, e) {
this.data[key] = e.target.innerText
},
edit2(key, index, e) {
this.data.features[index][key] = e.target.innerText
},
edit3(key, index, e) {
this.data.params[index][key] = e.target.innerText
},
edit4(key, index,index1, e) {
this.data.params[index].list[index1][key] = e.target.innerText
},
getData() {
selectMenuTree().then(e => {
console.log(e)
})
},
downFile(e) {
const blob = new Blob([''], {type: 'text/plain'});
//
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = '文档.txt'; //
//
link.click();
//
URL.revokeObjectURL(link.href);
}
}
}
</script>
<style lang="less" scoped>
@import "~@/style.less";
.banner {
width: 100%;
height: 35.5vw;
position: relative;
.bannerInfo {
position: absolute;
top: 35%;
left: 19%;
width: 40%;
text-align: left;
font-size: 2.5vw;
color: #000;
font-weight: 700;
line-height: 3vw;
letter-spacing: 2px;
word-break: break-all;
}
.bannerValue {
position: absolute;
top: calc(35% + 3vw);
left: 19%;
width: 40%;
text-align: left;
font-size: 1vw;
color: #000;
font-weight: 500;
line-height: 2vw;
word-break: break-all;
}
.bannerBtn {
position: absolute;
top: 58%;
left: 19%;
width: 11.5vw;
font-size: 1.2vw;
line-height: 2vw;
letter-spacing: 2px;
}
.tabs {
position: absolute;
bottom: 0;
width: 100%;
background: linear-gradient(to bottom, fade(@standard-color, 10), fade(#fff, 10));
backdrop-filter: saturate(50%) blur(4px);
.content {
width: 62%;
position: relative;
left: 50%;
bottom: 0;
transform: translateX(-50%);
.tab {
display: inline-block;
width: 50%;
line-height: 6.2vw;
font-size: 1.6vw;
letter-spacing: 3px;
}
.tab.active {
color: @standard-color;
width: calc(50% - 3px);
border: 1px solid #fff;
box-shadow: 0 0 3px #0002;
}
}
}
}
.tabs {
text-align: left;
margin-top: 2.3vw;
/deep/ .el-tabs__header {
margin: 0 10vw 15px;
}
/deep/ .el-tabs__content {
padding: 0 10vw;
background-color: fade(@standard-color, 10);
}
/deep/ .el-tabs__nav-wrap::after {
display: none;
}
/deep/ .el-tabs__item {
letter-spacing: 3px;
padding: 0 2vw;
height: 2.9vw;
font-size: 1.6vw;
}
/deep/ .el-tabs__item {
line-height: 2.9vw;
}
/deep/ .el-tabs__item.is-active {
font-weight: 600;
color: @standard-color;
}
/deep/ .el-tabs__active-bar {
height: 4px;
background-color: @standard-color;
}
.content {
padding: 2.2vw 0;
display: inline-block;
width: 47%;
cursor: pointer;
&:nth-child(2n){
margin-left: 5%;
}
&:hover{
.itemTitle {
color: #5c8eff;
}
.img-wrap {
.image{
transform: scale(1.2);
}
}
}
.custom-card {
width: 100%;
padding: 16px;
border-radius: 16px;
display: inline-block;
}
.itemTitle {
font-size: 26px;
font-weight: 600;
margin: 0;
text-align: center;
transition: all 0.5s ease;
}
.description {
font-size: 14px;
color: #666;
margin: 0;
margin-top: 12px;
line-height: 1.6;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制两行 */
-webkit-box-orient: vertical;
text-overflow: ellipsis;
}
.btn-wrap {
display: flex;
justify-content: center;
}
.more-btn {
margin-top: 12px;
background-color: transparent;
border: 1px solid #dcdfe6;
border-radius: 20px;
padding: 6px 16px;
font-size: 14px;
color: #333;
display: flex;
align-items: center;
gap: 4px;
}
.more-btn:hover {
border-color: #409eff;
color: #409eff;
background-color: rgba(64, 158, 255, 0.05);
}
.icon {
font-size: 16px;
margin-left: 4px;
}
.img-wrap {
margin-top: 12px;
overflow: hidden;
.image{
transition: transform 0.5s ease;
}
}
}
}
.contactUs {
width: 100%;
background-color: #2e445c;
}
.copyright {
width: 100%;
background-color: #1d3348;
}
.product-container {
padding: 5vw 10vw;
display: flex;
gap: 40px;
}
.product-left {
width: 400px;
}
.main-img {
width: 100%;
height: 300px;
border: 1px solid #eee;
display: flex;
justify-content: center;
align-items: center;
}
.thumb-list {
margin-top: 16px;
display: flex;
gap: 10px;
}
.thumb-item {
width: 80px;
height: 60px;
border: 2px solid transparent;
cursor: pointer;
}
.thumb-item.active {
border-color: #409eff;
}
.thumb-item .el-image {
width: 100%;
height: 100%;
}
.product-right {
flex: 1;
}
.title {
font-size: 20px;
font-weight: bold;
margin-bottom: 12px;
}
.features {
list-style: none;
padding: 0;
margin: 0;
}
.features li {
font-size: 14px;
margin-bottom: 10px;
color: #333;
display: flex;
align-items: center;
line-height: 24px;
}
.features i {
color: #409eff;
margin-right: 6px;
}
.paramsTable{
.th{
background-color: #DBDFE7;
line-height: 3vw;
font-size: 1.3vw;
font-weight: 700;
text-align: left;
.th1{
width: calc(30% - 2vw - 2px);
display: inline-block;
padding-left: 2vw;
border-right: 1px solid #0001
}
.th2{
width: calc(70% - 2vw - 2px);
display: inline-block;
padding-left: 2vw;
}
}
.td{
line-height: 3vw;
font-size: 0.9vw;
text-align: left;
.td1{
background-color: #F2F4F8;
width: calc(30% - 2vw - 2px);
display: inline-block;
padding-left: 2vw;
border: 1px solid #0001
}
.td2{
background-color: #EEEEEE;
width: calc(70% - 2vw - 2px);
display: inline-block;
padding-left: 2vw;
border: 1px solid #0001
}
}
}
.fileCard {
display: inline-block;
width: 40%;
height: 100px;
border: 1px solid #ccc;
border-radius: 10px;
margin-top: 1vw;
position: relative;
.cardTitle {
position: absolute;
top: 10px;
left: 20px;
font-size: 22px;
font-weight: 700;
line-height: 45px;
width: calc(100% - 80px);
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.cardValue {
position: absolute;
top: 55px;
width: calc(100% - 80px);
left: 20px;
font-size: 14px;
line-height: 45px;
color: #aaa;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.downIcon {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
}
&:nth-child(2n) {
margin-left: 5%;
}
}
</style>
Loading…
Cancel
Save