添加搜素

master
suixy 2 days ago
parent 85f3152457
commit 8aa78e6e1d

@ -0,0 +1,7 @@
import request from '@/utils/request'
export function search(query) {
return request({
url: '/portal/search', method: 'get', params: query
})
}

@ -36,15 +36,17 @@ export default {
line-height: 4.2vw;
.left {
width: 60%;
width: 70%;
text-align: left;
letter-spacing: 1px;
font-size: 1vw;
}
.right {
width: 40%;
width: 30%;
text-align: right;
letter-spacing: 1px;
font-size: 1vw;
}
}
</style>

@ -3,12 +3,34 @@
<h2 class="title1" style="line-height: 40px">资料下载</h2>
<div>
<div v-for="i in data.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 v-for="i in data.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>-->
<el-table
:data="data.fileList"
style="width: 100%">
<el-table-column
prop="name"
width="300"
label="文件名称">
</el-table-column>
<el-table-column
prop="value"
label="文件介绍">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200">
<template slot-scope="scope">
<el-button @click="downFile(scope.row)" type="text" size="small">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="输入密码" :modal-append-to-body="false" :visible.sync="getPasswordVisible">

@ -19,7 +19,6 @@
</div>
</div>
</div>
<div v-if="false" class="subMenu1"
:style="{height:20 + 50 + 40*(Math.max(...subMenuList.map(e=>e.children.length || 0)))+'px'}"
v-show="(subMenuList||[]).length>0 && subMenuType === 2"
@ -62,7 +61,8 @@
</template>
<template v-for="ii in i.children">
<el-menu-item :index="ii.webMenuId" @click="toLink(ii)">
{{ ii.webMenuName }}
<div style="width: 100%;text-align: center">{{ ii.webMenuName }}</div>
</el-menu-item>
<!-- <el-submenu :index="ii.webMenuId" v-if="(ii.children || []).length >0">-->
<!-- <template slot="title">{{ ii.webMenuName }}</template>-->
@ -98,11 +98,11 @@ export default {
let id = e.webMenuId
console.log()
if (!id) return
if(id === 7){
if (id === 7) {
this.$router.push('/productCenter')
}else if (id === 2){
} else if (id === 2) {
this.$router.push('/contactUs')
}else if (id === 4){
} else if (id === 4) {
this.$router.push('/industrySolutions')
} else if (id === 24) {
this.$router.push('/serviceSupport')
@ -116,7 +116,7 @@ export default {
this.$router.push('/productCenter?id=' + id)
} else if (e.ancestors.split(',').includes("24")) {
this.$router.push('/serviceSupport?type=' + id)
}else{
} else {
this.$router.push('/test?id=' + id)
}
},
@ -329,9 +329,23 @@ export default {
}
/deep/ .el-submenu__title {
margin: 0 20px
margin: 0;
padding: 0;
}
</style>
<style>
.el-submenu {
width: 10vw;
}
.el-menu--horizontal {
transform: translateX(calc(-90px + 4vw)) !important;
}
.el-menu-item > div {
font-size: 1vw !important;
}
</style>

@ -321,6 +321,9 @@ export default {
@menuHeight: 11vw;
/deep/ .el-menu-item {
text-align: center !important;
}
</style>

@ -0,0 +1,149 @@
<template>
<div>
<div class="searchBtn">
<el-button @click="dialogVisible = true" size="small" icon="el-icon-search" circle></el-button>
</div>
<el-dialog top="5vh" width="80%" :append-to-body="true" title="搜索" :visible.sync="dialogVisible">
<el-input @keyup.enter.native="onSubmit" style="width: 100%" v-model="form.keyword" placeholder="搜索内容">
<i slot="suffix" class="el-input__icon el-icon-search" @click="onSubmit"></i>
</el-input>
<div style="width: 100%;text-align: center;font-size: 1.4vw;line-height: 3vw;font-weight: 600">{{
list.length || 0
}}个相关结果
</div>
<div class="container">
<div class="classify" v-if="list.length > 0">
<div class="classifyName">
行业方案
</div>
<div class="item" v-for="i in list" @click="toLink(i.link)">
<div class="itemTitle" v-html="i.snippet">
</div>
<div class="itemText">
{{ i.title }}
</div>
</div>
</div>
<div class="classify" v-if="list1.length > 0">
<div class="classifyName">
产品中心
</div>
<div class="item" v-for="i in list1" @click="toLink1(i.link)">
<div class="itemTitle" v-html="i.snippet">
</div>
<div class="itemText">
{{ i.title }}
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import {search} from '@/api/search'
export default {
data() {
return {
dialogVisible: false,
form: {},
list: [],
list1: [],
}
},
methods: {
onSubmit() {
search(this.form).then(res => {
this.list = []
this.list1 = []
res.data?.rows?.forEach(e => {
if (e.sourceType === 'web1') {
this.list1.push({
snippet: e.snippet,
title: e.title,
link: e.title.split('详情#')?.[1]?.split('-')
})
}
if (e.sourceType === 'web') {
this.list.push({
snippet: e.snippet,
title: e.title,
link: e.routeQuery?.id
})
}
})
})
},
toLink(e) {
this.$router.push(`/test?id=${e}`)
this.dialogVisible = false
},
toLink1(e) {
this.$router.push(`/productCenter/detail?type=${e[0]}&typeId=${e[1]}&id=${e[2]}`)
this.dialogVisible = false
}
},
mounted() {
},
}
</script>
<style scoped lang="less">
.searchBtn {
position: absolute;
top: 50%;
right: 20px;
transform: translateY(-50%);
}
.container {
width: calc(100% - 40px);
background-color: #0001;
height: calc(80vh - 125px - 3vw);
padding: 0 20px;
overflow: auto;
}
em {
color: red;
background: yellow;
font-style: normal;
}
.classify {
position: relative;
.classifyName {
background-color: #eee;
position: sticky;
top: 0;
color: #42b983;
font-size: 1.2vw;
line-height: 4vw;
}
.item {
width: 100%;
background-color: #fff;
border-bottom: 1px solid #ddd;
cursor: pointer;
.itemTitle {
line-height: 3vw;
font-size: 1vw;
font-weight: bold;
/deep/ em {
color: #42b983;
font-style: normal;
}
}
.itemText {
width: 100%;
font-size: 0.8vw;
}
}
}
</style>

@ -3,10 +3,11 @@
<div class="top">
<Menu class="menu"/>
<img :src="logo" alt="" class="logo" @click="toIndex">
<Search/>
</div>
<div class="shadow">
</div>
<div class="content">
<div class="content" id="content">
<router-view></router-view>
</div>
<div class="FloatingWindow">
@ -35,6 +36,7 @@
<script>
import qrcode from '@/assets/icon/QRCode.png'
import Menu from '@/components/menu/index'
import Search from '@/components/search/index'
import Chat from "@/components/chat/index.vue";
import logo from '@/assets/logo.png'
@ -42,7 +44,8 @@ export default {
name: 'Index',
components: {
Menu,
Chat
Chat,
Search
},
methods: {
toIndex(){
@ -130,6 +133,7 @@ export default {
width: 100%;
height: calc(100vh - @top-height);
z-index: 1;
overflow: auto;
}
.FloatingWindow {

@ -5,57 +5,32 @@ import Layout from '@/layout/index.vue'
Vue.use(Router)
export default new Router({
routes: [{
path: '/a', component: () => import('@/views/a/index.vue'),
},
routes: [
{
path: '/',
component: Layout, redirect: '/index',
children: [
{
path: 'test', component: () => import('@/views/page/index.vue'),
},
{
path: 'index', component: () => import('@/views/index/index.vue'),
},
{
path: 'productCenter', component: () => import('@/views/productCenter/index.vue'),
},
{
path: 'productCenter/detail', component: () => import('@/views/productCenter/detail.vue'),
},
{
path: 'industrySolutions', component: () => import('@/views/industrySolutions/index.vue'),
},
{
path: 'index', component: () => import('@/views/index/index.vue'),
},
{
path: '/contactUs',
component: () => import('@/views/contactUs/index.vue'),
},
{
path: '/contactUs/MediaCenterDetail',
component: () => import('@/views/contactUs/MediaCenterDetail.vue'),
},
{
path: '/serviceSupport',
component: () => import('@/views/serviceSupport/index.vue'),
},
]
},], scrollBehavior(to, from, savedPosition) {
if (to.hash) {
// 等 DOM 渲染完成再滚动
return new Promise((resolve) => {
setTimeout(() => {
const el = document.querySelector(to.hash);
if (el) {
el.scrollIntoView({behavior: 'smooth'});
}
resolve({left: 0, top: 0});
}, 200);
});
path: '/', component: Layout, redirect: '/index', children: [{
path: 'test', component: () => import('@/views/page/index.vue'),
}, {
path: 'index', component: () => import('@/views/index/index.vue'),
}, {
path: 'productCenter', component: () => import('@/views/productCenter/index.vue'),
}, {
path: 'productCenter/detail', component: () => import('@/views/productCenter/detail.vue'),
}, {
path: 'industrySolutions', component: () => import('@/views/industrySolutions/index.vue'),
}, {
path: 'index', component: () => import('@/views/index/index.vue'),
}, {
path: '/contactUs', component: () => import('@/views/contactUs/index.vue'),
}, {
path: '/contactUs/MediaCenterDetail', component: () => import('@/views/contactUs/MediaCenterDetail.vue'),
}, {
path: '/serviceSupport', component: () => import('@/views/serviceSupport/index.vue'),
},]
}], scrollBehavior() {
const el = document.getElementById('content')
if (el) {
el.scrollTop = 0
}
return {left: 0, top: 0};
return false
}
})

@ -1,31 +0,0 @@
<template>
<div class="browser-warning">
<i class="fas fa-exclamation-triangle"></i>
<div>
<strong>HTTP协议限制</strong> 当前页面使用HTTP协议唤起微信可能受限建议使用HTTPS协议提高成功率
</div>
</div>
</template>
<script>
export default {
name: 'BrowserWarning'
}
</script>
<style scoped>
.browser-warning {
background: #ff6b6b;
color: white;
padding: 15px;
border-radius: 8px;
margin-bottom: 20px;
display: flex;
align-items: center;
}
.browser-warning i {
margin-right: 10px;
font-size: 20px;
}
</style>

@ -1,139 +0,0 @@
<template>
<div class="card">
<div class="card-title">
<i class="fas fa-users"></i>
推荐好友
</div>
<div class="contact-list">
<div class="contact-item" v-for="contact in contacts" :key="contact.id">
<div class="avatar">{{ contact.avatar }}</div>
<div class="contact-info">
<div class="contact-name">{{ contact.name }}</div>
<div class="contact-id">微信号: {{ contact.wechatId }}</div>
</div>
<button class="add-btn" @click="$emit('add-contact', contact)" :disabled="contact.adding">
<span class="loading" v-if="contact.adding"></span>
{{ contact.adding ? '添加中...' : '添加' }}
</button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ContactList',
props: {
contacts: {
type: Array,
default: () => []
}
}
}
</script>
<style scoped>
.card {
background: #1f1f1f;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.card-title {
font-size: 18px;
margin-bottom: 15px;
color: #07C160;
display: flex;
align-items: center;
}
.card-title i {
margin-right: 10px;
}
.contact-list {
display: flex;
flex-direction: column;
gap: 15px;
}
.contact-item {
display: flex;
align-items: center;
padding: 15px;
background: #333;
border-radius: 8px;
transition: transform 0.2s;
}
.contact-item:hover {
transform: translateY(-2px);
background: #3a3a3a;
}
.avatar {
width: 50px;
height: 50px;
border-radius: 50%;
background: #07C160;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
color: white;
font-size: 20px;
font-weight: bold;
}
.contact-info {
flex: 1;
}
.contact-name {
font-size: 16px;
font-weight: 600;
margin-bottom: 5px;
}
.contact-id {
font-size: 14px;
color: #aaa;
}
.add-btn {
background: #07C160;
color: white;
border: none;
padding: 8px 15px;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
transition: background 0.3s;
}
.add-btn:hover {
background: #06ae56;
}
.add-btn:disabled {
background: #555;
cursor: not-allowed;
}
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
margin-right: 10px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>

@ -1,103 +0,0 @@
<template>
<div class="card">
<div class="card-title">
<i class="fas fa-qrcode"></i>
我的二维码
</div>
<div class="qr-section">
<div class="qr-code">
<svg width="130" height="130" viewBox="0 0 130 130">
<rect width="130" height="130" fill="white"/>
<rect x="10" y="10" width="25" height="25" fill="black"/>
<rect x="95" y="10" width="25" height="25" fill="black"/>
<rect x="10" y="95" width="25" height="25" fill="black"/>
<rect x="45" y="45" width="10" height="10" fill="black"/>
<rect x="75" y="45" width="10" height="10" fill="black"/>
<rect x="45" y="75" width="10" height="10" fill="black"/>
<rect x="75" y="75" width="10" height="10" fill="black"/>
</svg>
</div>
<div class="qr-text">
<p>扫描二维码添加我为好友</p>
<p>打开手机微信点击右上角"+"选择"扫一扫"扫描上方二维码即可添加好友</p>
<p v-if="!isHttps" class="info">HTTP/HTTPS100%</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'QrCodeSection',
props: {
isHttps: {
type: Boolean,
default: false
}
}
}
</script>
<style scoped>
.card {
background: #1f1f1f;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.card-title {
font-size: 18px;
margin-bottom: 15px;
color: #07C160;
display: flex;
align-items: center;
}
.card-title i {
margin-right: 10px;
}
.qr-section {
display: flex;
align-items: center;
gap: 20px;
margin-top: 20px;
}
.qr-code {
width: 150px;
height: 150px;
background: white;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 10px;
}
.qr-text {
flex: 1;
}
.qr-text p {
margin-bottom: 10px;
line-height: 1.5;
}
.info {
background: #cce7ff;
color: #004085;
padding: 8px;
border-radius: 4px;
}
@media (max-width: 768px) {
.qr-section {
flex-direction: column;
text-align: center;
}
}
</style>

@ -1,116 +0,0 @@
<template>
<div class="card">
<div class="card-title">
<i class="fas fa-search"></i>
搜索添加好友
</div>
<div class="search-box">
<input
type="text"
class="search-input"
:value="value"
@input="$emit('input', $event.target.value)"
placeholder="请输入微信号、手机号或昵称"
@keyup.enter="$emit('search')"
>
<button class="search-btn" @click="$emit('search')" :disabled="searching">
<span class="loading" v-if="searching"></span>
{{ searching ? '搜索中...' : '搜索' }}
</button>
</div>
<p>通过微信号手机号或昵称搜索添加好友</p>
</div>
</template>
<script>
export default {
name: 'SearchBox',
props: {
value: {
type: String,
default: ''
},
searching: {
type: Boolean,
default: false
}
}
}
</script>
<style scoped>
.card {
background: #1f1f1f;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.card-title {
font-size: 18px;
margin-bottom: 15px;
color: #07C160;
display: flex;
align-items: center;
}
.card-title i {
margin-right: 10px;
}
.search-box {
display: flex;
margin-bottom: 20px;
}
.search-input {
flex: 1;
padding: 12px 15px;
background: #333;
border: 1px solid #444;
border-radius: 8px 0 0 8px;
color: #e0e0e0;
font-size: 16px;
outline: none;
}
.search-input:focus {
border-color: #07C160;
}
.search-btn {
background: #07C160;
color: white;
border: none;
padding: 0 20px;
border-radius: 0 8px 8px 0;
cursor: pointer;
font-weight: 600;
transition: background 0.3s;
}
.search-btn:hover {
background: #06ae56;
}
.search-btn:disabled {
background: #555;
cursor: not-allowed;
}
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
margin-right: 10px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>

@ -1,46 +0,0 @@
<template>
<div class="status-message" :class="type">
{{ message }}
</div>
</template>
<script>
export default {
name: 'StatusMessage',
props: {
message: {
type: String,
required: true
},
type: {
type: String,
default: 'info',
validator: (value) => ['success', 'error', 'info'].includes(value)
}
}
}
</script>
<style scoped>
.status-message {
padding: 10px;
border-radius: 5px;
margin-top: 10px;
text-align: center;
}
.success {
background: #d4edda;
color: #155724;
}
.error {
background: #f8d7da;
color: #721c24;
}
.info {
background: #cce7ff;
color: #004085;
}
</style>

@ -1,289 +0,0 @@
<template>
<div class="wechat-add-friend">
<div class="container">
<div class="header">
<h1><i class="fab fa-weixin"></i> Vue 2 微信添加好友</h1>
<p>使用Vue 2组件实现的微信H5添加好友页面</p>
<div class="protocol-info">
<span>当前协议:</span>
<span class="protocol-tag" :class="protocolClass">{{ currentProtocol }}</span>
<span>唤起成功率: {{ successRate }}</span>
</div>
</div>
<div class="content">
<browser-warning v-if="!isHttps"/>
<search-box
v-model="searchText"
:searching="searching"
@search="handleSearch"
/>
<qr-code-section :is-https="isHttps"/>
<contact-list
:contacts="contacts"
@add-contact="addContact"
/>
<status-message
v-if="statusMessage"
:message="statusMessage"
:type="statusType"
/>
<div class="action-buttons">
<button class="action-btn primary-btn" @click="openWechat">
<i class="fab fa-weixin"></i>
打开微信添加好友
</button>
<button class="action-btn secondary-btn" @click="showTips">
<i class="fas fa-info-circle"></i>
使用提示
</button>
</div>
<div class="footer">
<p>© 2023 微信添加好友 | 基于Vue 2组件开发</p>
<p>当前环境: {{ userAgent }}</p>
</div>
</div>
</div>
</div>
</template>
<script>
import BrowserWarning from './BrowserWarning.vue'
import SearchBox from './SearchBox.vue'
import QrCodeSection from './QrCodeSection.vue'
import ContactList from './ContactList.vue'
import StatusMessage from './StatusMessage.vue'
export default {
name: 'WechatAddFriend',
components: {
BrowserWarning,
SearchBox,
QrCodeSection,
ContactList,
StatusMessage
},
data() {
return {
searchText: '',
searching: false,
statusMessage: '',
statusType: '',
userAgent: navigator.userAgent,
isHttps: window.location.protocol === 'https:',
contacts: [
{id: 1, name: '张三', wechatId: 'zhangsan2023', avatar: '张', adding: false},
{id: 2, name: '李四', wechatId: 'lisi_tech', avatar: '李', adding: false},
{id: 3, name: '王五', wechatId: 'wangwu888', avatar: '王', adding: false}
]
}
},
computed: {
currentProtocol() {
return this.isHttps ? 'HTTPS' : 'HTTP'
},
protocolClass() {
return this.isHttps ? 'protocol-https' : 'protocol-http'
},
successRate() {
return this.isHttps ? '较高' : '较低'
}
},
methods: {
showStatus(message, type = 'info') {
this.statusMessage = message
this.statusType = type
setTimeout(() => {
this.statusMessage = ''
this.statusType = ''
}, 5000)
},
handleSearch() {
if (!this.searchText.trim()) {
this.showStatus('请输入搜索内容', 'error')
return
}
this.searching = true
this.showStatus(`正在搜索: ${this.searchText}`, 'info')
setTimeout(() => {
this.searching = false
this.openWechatDirect()
this.showStatus(`搜索完成,正在尝试唤起微信...`, 'success')
}, 1500)
},
addContact(contact) {
contact.adding = true
this.showStatus(`正在向 ${contact.name} 发送好友请求...`, 'info')
setTimeout(() => {
contact.adding = false
this.openWechatDirect()
this.showStatus(`已发送好友请求给 ${contact.name},请在新打开的微信中确认`, 'success')
}, 2000)
},
openWechatDirect() {
const wechatScheme = 'weixin://'
window.location.href = wechatScheme
setTimeout(() => {
if (!document.hidden) {
if (this.isHttps) {
this.showStatus('唤起失败:请确保已安装微信桌面版', 'error')
} else {
this.showStatus('唤起失败HTTP环境下限制较多建议使用二维码方案', 'error')
}
}
}, 1000)
},
openWechat() {
this.showStatus('正在尝试唤起微信...', 'info')
this.openWechatDirect()
setTimeout(() => {
if (!document.hidden) {
this.showStatus('自动唤起失败,请尝试二维码添加或手动打开微信', 'error')
}
}, 1500)
},
showTips() {
const tips = this.isHttps ?
"HTTPS环境提示\n\n• 唤起成功率较高\n• 浏览器限制较少\n• 用户体验良好" :
"HTTP环境提示\n\n• 唤起成功率较低\n• 浏览器可能阻止自动唤起\n• 建议使用二维码方案"
alert(tips)
}
},
mounted() {
console.log('Vue 2 微信添加好友组件已加载')
}
}
</script>
<style scoped>
.wechat-add-friend {
width: 100%;
max-width: 900px;
margin: 0 auto;
}
.container {
background: #2d2d2d;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.header {
background: #07C160;
color: white;
padding: 20px;
text-align: center;
}
.header h1 {
font-size: 24px;
margin-bottom: 10px;
}
.header p {
font-size: 16px;
opacity: 0.9;
}
.content {
padding: 30px;
}
.action-buttons {
display: flex;
gap: 15px;
margin-top: 20px;
}
.action-btn {
flex: 1;
padding: 12px;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
transition: all 0.3s;
}
.primary-btn {
background: #07C160;
color: white;
}
.primary-btn:hover {
background: #06ae56;
transform: translateY(-2px);
}
.secondary-btn {
background: #444;
color: #e0e0e0;
}
.secondary-btn:hover {
background: #555;
transform: translateY(-2px);
}
.footer {
margin-top: 30px;
text-align: center;
font-size: 14px;
color: #888;
padding-top: 20px;
border-top: 1px solid #444;
}
.protocol-info {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin-top: 15px;
font-size: 14px;
}
.protocol-tag {
padding: 4px 8px;
border-radius: 4px;
font-weight: bold;
}
.protocol-https {
background: #07C160;
color: white;
}
.protocol-http {
background: #ff6b6b;
color: white;
}
@media (max-width: 768px) {
.content {
padding: 20px;
}
.action-buttons {
flex-direction: column;
}
}
</style>

@ -4,7 +4,7 @@
<div class="subTitle">典型案例</div>
<div class="content">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="i.homeConfigTypeName" :name="`${i.configTypeId}`" v-for="(i,k) in list">
<el-tab-pane :label="i.homeConfigTypeName" :name="`${i.configTypeId}`" v-for="(i,k) in data">
<transition name="fade">
<div v-if="activeName === `${i.configTypeId}`" style="position:relative;">
<div class="left">
@ -42,6 +42,7 @@ import {getHomeCaseTitleList, getTypicalHomeCaseInfo} from "@/api";
export default {
name: 'ProductCenter',
props: ['data'],
data() {
return {
banner,
@ -114,6 +115,7 @@ export default {
})
},
getCaseInfo(e) {
this.$router.push(`/productCenter/detail?type=${e.linkData[0]}&typeId=${e.linkData[1]}&id=${e.linkData[2]}`)
this.$router.push("test?id=" + e.configTypeId)
},
learnMore() {

@ -1,8 +1,8 @@
<template>
<div>
<Carousel class="carousel" :bannerList="bannerList"/>
<ClassicCase class="classicCase"/>
<ProductCenter class="productCenter"/>
<ClassicCase class="classicCase" :data="components.classicCaseData ||[]"/>
<ProductCenter class="productCenter" :data="components.productCenterData ||[]"/>
<!-- <NewsCenter class="newsCenter"/>-->
<ContactUs class="contactUs"/>
<Copyright class="copyright"/>
@ -16,6 +16,9 @@ import ClassicCase from './classicCase1'
import NewsCenter from './newsCenter'
import ContactUs from './contactUs'
import Copyright from '@/components/copyright'
import {getHwWeb} from "@/api/hwWeb";
export default {
name: 'Index',
@ -27,9 +30,13 @@ export default {
ContactUs,
Copyright
},
mounted() {
getHwWeb(-1).then(res => {
this.components = JSON.parse(res?.data?.webJsonString || '{}')
})
},
data() {
return {
bannerList: [
{
portalConfigPic: 'http://www.highwayiot.com/home/2/6/3rrzpl/resource/2018/10/23/5bcedfaf21a51.jpg',
@ -47,6 +54,7 @@ export default {
// portalConfigDesc: 'INDUSTRIAL IOT CUSTOMIZATION SOLUTION PROVIDER'
},
],
components: {},
}
}
}

@ -3,7 +3,7 @@
<div class="title">PRODUCT CENTER</div>
<div class="subTitle">产品中心</div>
<div class="productList">
<template v-for="(i,k) in productList">
<template v-for="(i,k) in data">
<div class="productItem" @click="toLink(i)">
<div class="imageArea">
@ -36,6 +36,7 @@ import {getPortalConfigTypeList} from "@/api";
export default {
name: 'ProductCenter',
props: ['data'],
data() {
return {
productList: [
@ -84,7 +85,9 @@ export default {
},
methods:{
toLink(e){
this.$router.push('/productCenter#item' + e.configTypeId)
console.log(e)
// this.$router.push('/productCenter#item' + e.configTypeId)
this.$router.push(`/productCenter/detail?type=${e.linkData[0]}&typeId=${e.linkData[1]}&id=${e.linkData[2]}`)
console.log(e.configTypeId)
},
getData(){

@ -9,7 +9,8 @@
<div class="tabs">
<div class="content">
<div @click="checkTabs(i,k)"
:style="`width:${tabsActive === i.webMenuId ? (100/tabsData.length+'%'):`calc(${100/tabsData.length}% - 2px)`}`"
style="white-space: nowrap;overflow: auto"
:style="`fontSize:clamp(0.7vw,calc(${(60/tabsData.length)}vw / ${ i.webMenuName.length}),1.4vw);width:${tabsActive === i.webMenuId ? (100/tabsData.length+'%'):`calc(${100/tabsData.length}% - 2px)`}`"
:class="`tab ${tabsActive === i.webMenuId ? 'active':''}`" v-for="(i,k) in tabsData">
{{ i.webMenuName }}
</div>

@ -21,7 +21,7 @@
<transition name="fade">
<div v-if="activeName === `${k}`" style="position:relative;">
<template v-for="ii in i.list">
<div class="content" @click.stop="toDetail(ii.id)">
<div class="content" @click.stop="toDetail(ii.id,i.id)">
<el-card class="custom-card" shadow="hover" style="min-height: 300px;height: 30vw;box-sizing: border-box">
<!-- 标题 -->

@ -1,16 +1,18 @@
const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true, runtimeCompiler: true,
transpileDependencies: true, runtimeCompiler: true,
devServer: {
host: "0.0.0.0", port: 8899, open: true, https: false, proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
'/dev-api': {
// target: `http://175.27.215.92:8899/prod-api`,
target: `http://1.13.177.47:8899/prod-api`, changeOrigin: true, pathRewrite: {
["^" + '/dev-api']: "",
devServer: {
host: "0.0.0.0", port: 8899, open: true, https: false, proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
'/prod-api': {
// target: `http://175.27.215.92:8899/prod-api`,
target: `http://192.168.137.1:9081`,
// target: `http://1.13.177.47:8899/prod-api`,
changeOrigin: true, pathRewrite: {
["^" + '/prod-api']: "",
},
},
},
},
},
},
})

Loading…
Cancel
Save