updata
@ -42,11 +42,11 @@ export function logoutAPI(params) {
|
||||
})
|
||||
}
|
||||
|
||||
//获取验证码 1
|
||||
//获取验证码
|
||||
export function getCodeAPI(params) {
|
||||
return request({
|
||||
url: `/user/mobilecode${suffix}`,
|
||||
method: 'get',
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
@ -263,3 +263,23 @@ export function reqGetCodeAPI(data) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 注册/登录获取验证码
|
||||
export function sendCode(data) {
|
||||
return request({
|
||||
url: `/user/mobilecode.dspy`,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 注册
|
||||
export function register(data) {
|
||||
console.log(data);
|
||||
|
||||
return request({
|
||||
url: `/customer/registerUser${suffix}`,
|
||||
method: 'post',
|
||||
data,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ export const asyncRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
component: () => import('@/views/product/productHome/productIndex/index.vue'),
|
||||
component: () => import('@/views/product/allProduct/index.vue'),
|
||||
name: 'ProductHome',
|
||||
meta: {
|
||||
title: "全部产品",
|
||||
@ -395,48 +395,49 @@ export const asyncRoutes = [
|
||||
},
|
||||
|
||||
// 官网
|
||||
// {
|
||||
// path: getHomePath() == '/ncmatchHome/index' ? "/ncmatchHome" : "/homePage",
|
||||
// component: () => import("@/views/homePage/indexLast.vue"),
|
||||
// name: "homePage",
|
||||
// redirect: "/homePage/index",
|
||||
// meta: { fullPath: "/homePage/index", title: "官网首页", noCache: true, icon: 'el-icon-s-home' },
|
||||
// children: [
|
||||
// {
|
||||
// path: "index",
|
||||
// component: () => import("@/views/homePage/mainPage/index.vue"),
|
||||
// name: "homePageIndex",
|
||||
// hidden: true,
|
||||
// meta: { title: "首页", fullPath: "/homePage/index" },
|
||||
// },
|
||||
// {
|
||||
// path: "detail",
|
||||
// component: () => import("@/views/homePage/detail/index.vue"),
|
||||
// name: "detail",
|
||||
// hidden: true,
|
||||
// meta: { title: "详情", cache: true },
|
||||
// }, {
|
||||
// path: "hospital",
|
||||
// component: () => import("@/views/homePage/solve/hospital/index.vue"),
|
||||
// name: "hospital",
|
||||
// hidden: true,
|
||||
// meta: { title: "灵医智能体" },
|
||||
// }, {
|
||||
// path: "customerService",
|
||||
// component: () => import("@/views/homePage/solve/customerService/index.vue"),
|
||||
// name: "customerService",
|
||||
// hidden: true,
|
||||
// meta: { title: "客悦" },
|
||||
{
|
||||
path: getHomePath() == '/ncmatchHome/index' ? "/ncmatchHome" : "/homePage",
|
||||
component: () => import("@/views/homePage/indexLast.vue"),
|
||||
name: "homePage",
|
||||
redirect: "/homePage/index",
|
||||
hidden: true,
|
||||
meta: { fullPath: "/homePage/index", title: "官网首页", noCache: true, icon: 'el-icon-s-home', hidden: true },
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: () => import("@/views/homePage/mainPage/index.vue"),
|
||||
name: "homePageIndex",
|
||||
hidden: true,
|
||||
meta: { title: "首页", fullPath: "/homePage/index" },
|
||||
},
|
||||
{
|
||||
path: "detail",
|
||||
component: () => import("@/views/homePage/detail/index.vue"),
|
||||
name: "detail",
|
||||
hidden: true,
|
||||
meta: { title: "详情", cache: true },
|
||||
}, {
|
||||
path: "hospital",
|
||||
component: () => import("@/views/homePage/solve/hospital/index.vue"),
|
||||
name: "hospital",
|
||||
hidden: true,
|
||||
meta: { title: "灵医智能体" },
|
||||
}, {
|
||||
path: "customerService",
|
||||
component: () => import("@/views/homePage/solve/customerService/index.vue"),
|
||||
name: "customerService",
|
||||
hidden: true,
|
||||
meta: { title: "客悦" },
|
||||
|
||||
// }, {
|
||||
// path: "about",
|
||||
// component: () => import("@/views/homePage/about/index.vue"),
|
||||
// name: "about",
|
||||
// hidden: true,
|
||||
// meta: { title: "关于" },
|
||||
}, {
|
||||
path: "about",
|
||||
component: () => import("@/views/homePage/about/index.vue"),
|
||||
name: "about",
|
||||
hidden: true,
|
||||
meta: { title: "关于" },
|
||||
|
||||
// }]
|
||||
// },
|
||||
}]
|
||||
},
|
||||
// 咨询表单
|
||||
{
|
||||
path: "/consultingMangement",
|
||||
@ -899,157 +900,161 @@ export const asyncRoutes = [
|
||||
]
|
||||
},
|
||||
|
||||
// // 客户 - 注释掉
|
||||
// {
|
||||
// path: "/customer", component: Layout, redirect: "/customer/workOrderManagement", meta: {
|
||||
// title: "客户", icon: "el-icon-s-custom", noCache: true, fullPath: "/customer",
|
||||
// },
|
||||
// children: [
|
||||
// // 工单
|
||||
// {
|
||||
// path: "workOrderManagement",
|
||||
// component: () => import("@/views/customer/workOrderManagement"),
|
||||
// name: "WorkOrderManagement",
|
||||
// meta: { title: "工单管理", fullPath: "/customer/workOrderManagement" },
|
||||
// },
|
||||
// // 退订
|
||||
// {
|
||||
// path: "unsubscribe",
|
||||
// // 客户
|
||||
{
|
||||
path: "/customer",
|
||||
component: Layout,
|
||||
redirect: "/customer/workOrderManagement",
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: "客户", icon: "el-icon-s-custom", noCache: true, fullPath: "/customer", hidden: true
|
||||
},
|
||||
children: [
|
||||
// 工单
|
||||
{
|
||||
path: "workOrderManagement",
|
||||
component: () => import("@/views/customer/workOrderManagement"),
|
||||
name: "WorkOrderManagement",
|
||||
meta: { title: "工单管理", fullPath: "/customer/workOrderManagement" },
|
||||
},
|
||||
// 退订
|
||||
{
|
||||
path: "unsubscribe",
|
||||
|
||||
// component: () => import("@/views/customer/unsubscribe"),
|
||||
// name: "Unsubscribe",
|
||||
// alwaysShow: true, // 确保父菜单始终显示
|
||||
// meta: {
|
||||
// title: "退订管理",
|
||||
// alwaysShow: true
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "BaiduNetdisk",
|
||||
// component: () => import("@/views/customer/unsubscribe/BaiduNetdisk.vue"),
|
||||
// name: "BaiduNetdisk",
|
||||
// meta: { title: "百度云" }
|
||||
// },
|
||||
component: () => import("@/views/customer/unsubscribe"),
|
||||
name: "Unsubscribe",
|
||||
alwaysShow: true, // 确保父菜单始终显示
|
||||
meta: {
|
||||
title: "退订管理",
|
||||
alwaysShow: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "BaiduNetdisk",
|
||||
component: () => import("@/views/customer/unsubscribe/BaiduNetdisk.vue"),
|
||||
name: "BaiduNetdisk",
|
||||
meta: { title: "百度云" }
|
||||
},
|
||||
|
||||
// ]
|
||||
// },
|
||||
// // 完善信息
|
||||
// {
|
||||
// path: 'approve',
|
||||
// component: () => import('@/views/customer/ncApprove/index.vue'),
|
||||
// name: "Approve",
|
||||
// meta: { title: "信息完善", fullPath: "/customer/ncApprove" },
|
||||
// },
|
||||
// // 渠道管理
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "channelMangement",
|
||||
// component: () => import("@/views/customer/channelMangement/index.vue"),
|
||||
// name: "ChannelMangement",
|
||||
// meta: { title: "渠道管理", fullPath: "/customer/channelMangement" },
|
||||
// },
|
||||
// //渠道产品管理
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "channelProductMangement",
|
||||
// component: () => import("@/views/customer/channelMangement/channelProductMangement/index.vue"),
|
||||
// name: "channelProductMangement",
|
||||
// meta: { title: "渠道产品管理", fullPath: "/customer/channelMangement/channelProductMangement", noCache: true },
|
||||
// },
|
||||
// // 无权限
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "noChannelPermission",
|
||||
// component: () => import("@/views/customer/channelMangement/noChannelPermission/index.vue"),
|
||||
// name: "noChannelPermission",
|
||||
// meta: { title: "无权限", fullPath: "/customer/channelMangement/noChannelPermission", noCache: true },
|
||||
// },
|
||||
// // 聊天
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "chat",
|
||||
// component: () => import("@/views/product/productHome/chat/index.vue"),
|
||||
// name: "chat",
|
||||
// meta: {
|
||||
// title: "聊天", fullPath: "/product/productHome/chat", noCache: true
|
||||
// },
|
||||
// },
|
||||
]
|
||||
},
|
||||
// 完善信息
|
||||
{
|
||||
path: 'approve',
|
||||
component: () => import('@/views/customer/ncApprove/index.vue'),
|
||||
name: "Approve",
|
||||
meta: { title: "信息完善", fullPath: "/customer/ncApprove" },
|
||||
},
|
||||
// 渠道管理
|
||||
{
|
||||
hidden: true,
|
||||
path: "channelMangement",
|
||||
component: () => import("@/views/customer/channelMangement/index.vue"),
|
||||
name: "ChannelMangement",
|
||||
meta: { title: "渠道管理", fullPath: "/customer/channelMangement" },
|
||||
},
|
||||
//渠道产品管理
|
||||
{
|
||||
hidden: true,
|
||||
path: "channelProductMangement",
|
||||
component: () => import("@/views/customer/channelMangement/channelProductMangement/index.vue"),
|
||||
name: "channelProductMangement",
|
||||
meta: { title: "渠道产品管理", fullPath: "/customer/channelMangement/channelProductMangement", noCache: true },
|
||||
},
|
||||
// 无权限
|
||||
{
|
||||
hidden: true,
|
||||
path: "noChannelPermission",
|
||||
component: () => import("@/views/customer/channelMangement/noChannelPermission/index.vue"),
|
||||
name: "noChannelPermission",
|
||||
meta: { title: "无权限", fullPath: "/customer/channelMangement/noChannelPermission", noCache: true },
|
||||
},
|
||||
// 聊天
|
||||
{
|
||||
hidden: true,
|
||||
path: "chat",
|
||||
component: () => import("@/views/product/productHome/chat/index.vue"),
|
||||
name: "chat",
|
||||
meta: {
|
||||
title: "聊天", fullPath: "/product/productHome/chat", noCache: true
|
||||
},
|
||||
},
|
||||
|
||||
// // 个人中心
|
||||
// 个人中心
|
||||
{
|
||||
hidden: true,
|
||||
path: "customerInformation",
|
||||
component: () => import("@/views/customer/customerInformation"),
|
||||
name: "customerInformation",
|
||||
meta: { title: "个人中心", fullPath: "/customer/customerInformation" },
|
||||
},
|
||||
// 充值管理
|
||||
{
|
||||
path: "rechargeRecord",
|
||||
component: () => import("@/views/customer/rechargeRecord"),
|
||||
name: "RechargeRecord",
|
||||
meta: { title: "充值管理", fullPath: "/customer/rechargeRecord" },
|
||||
},
|
||||
// 订单管理
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "customerInformation",
|
||||
// component: () => import("@/views/customer/customerInformation"),
|
||||
// name: "customerInformation",
|
||||
// meta: { title: "个人中心", fullPath: "/customer/customerInformation" },
|
||||
// },
|
||||
// // 充值管理
|
||||
// {
|
||||
// path: "rechargeRecord",
|
||||
// component: () => import("@/views/customer/rechargeRecord"),
|
||||
// name: "RechargeRecord",
|
||||
// meta: { title: "充值管理", fullPath: "/customer/rechargeRecord" },
|
||||
// },
|
||||
// // 订单管理
|
||||
// // {
|
||||
// // path: "orderManagement",
|
||||
// // component: () => import("@/views/customer/orderManagement"),
|
||||
// // name: "OrderManagement",
|
||||
// // meta: { title: "产品订单", fullPath: "/customer/orderManagement", noCache: true, },
|
||||
// // },
|
||||
// // 订单详情
|
||||
// {
|
||||
// path: "orderDetil",
|
||||
// component: () => import("@/views/customer/orderDetil"),
|
||||
// name: "orderDetil",
|
||||
// hidden: true,
|
||||
// meta: { title: "订单详情", fullPath: "/customer/orderDetil", noCache: true, },
|
||||
// },
|
||||
// // 促销邀请码
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "promotionalInvitationCode",
|
||||
// component: () => import("@/views/customer/promotionalInvitationCode"),
|
||||
// name: "PromotionalInvitationCode",
|
||||
// meta: { title: "促销邀请码", fullPath: "/customer/promotionalInvitationCode" },
|
||||
// path: "orderManagement",
|
||||
// component: () => import("@/views/customer/orderManagement"),
|
||||
// name: "OrderManagement",
|
||||
// meta: { title: "产品订单", fullPath: "/customer/orderManagement", noCache: true, },
|
||||
// },
|
||||
// 订单详情
|
||||
{
|
||||
path: "orderDetil",
|
||||
component: () => import("@/views/customer/orderDetil"),
|
||||
name: "orderDetil",
|
||||
hidden: true,
|
||||
meta: { title: "订单详情", fullPath: "/customer/orderDetil", noCache: true, },
|
||||
},
|
||||
// 促销邀请码
|
||||
{
|
||||
hidden: true,
|
||||
path: "promotionalInvitationCode",
|
||||
component: () => import("@/views/customer/promotionalInvitationCode"),
|
||||
name: "PromotionalInvitationCode",
|
||||
meta: { title: "促销邀请码", fullPath: "/customer/promotionalInvitationCode" },
|
||||
},
|
||||
|
||||
// // 资源示例
|
||||
// 资源示例
|
||||
|
||||
// // ssh登录
|
||||
// // {
|
||||
// ssh登录
|
||||
// {
|
||||
|
||||
// // path: "sshTerminal",
|
||||
// // component: () => import(
|
||||
// // // "@/views/customer/userResource/iframeJiNan.vue"//iframe报错
|
||||
// // "@/views/customer/userResource/SshTerminal.vue"
|
||||
// // ),
|
||||
// // name: "sshTerminal",
|
||||
// // meta: { title: "ssh登录", fullPath: "/customer/SshTerminal", noCache: true },
|
||||
// // },
|
||||
// // 审批记录
|
||||
// {
|
||||
// hidden: true, path: "approvalRecord", component: () => import(
|
||||
// // "@/views/customer/approvalRecord/iframeJiNan.vue"//iframe报错
|
||||
// "@/views/customer/approvalRecord"
|
||||
// ), name: "approvalRecord", meta: { title: "审批记录", fullPath: "/customer/approvalRecord" },
|
||||
// },
|
||||
// // 发票管理
|
||||
// {
|
||||
// path: "invoice",
|
||||
// component: () => import("@/views/customer/invoice"),
|
||||
// name: "Invoice",
|
||||
// meta: { title: "发票管理", fullPath: "/customer/invoice" },
|
||||
// },
|
||||
// // 产品最新页
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: "productIndex",
|
||||
// component: () => import("@/views/product/productHome/productIndex/index.vue"),
|
||||
// name: "ProductIndex",
|
||||
// meta: { title: "产品最新页", fullPath: "/product/productHome/productIndex", noCache: true },
|
||||
// },],
|
||||
// path: "sshTerminal",
|
||||
// component: () => import(
|
||||
// // "@/views/customer/userResource/iframeJiNan.vue"//iframe报错
|
||||
// "@/views/customer/userResource/SshTerminal.vue"
|
||||
// ),
|
||||
// name: "sshTerminal",
|
||||
// meta: { title: "ssh登录", fullPath: "/customer/SshTerminal", noCache: true },
|
||||
// },
|
||||
// 审批记录
|
||||
{
|
||||
hidden: true, path: "approvalRecord", component: () => import(
|
||||
// "@/views/customer/approvalRecord/iframeJiNan.vue"//iframe报错
|
||||
"@/views/customer/approvalRecord"
|
||||
), name: "approvalRecord", meta: { title: "审批记录", fullPath: "/customer/approvalRecord" },
|
||||
},
|
||||
// 发票管理
|
||||
{
|
||||
path: "invoice",
|
||||
component: () => import("@/views/customer/invoice"),
|
||||
name: "Invoice",
|
||||
meta: { title: "发票管理", fullPath: "/customer/invoice" },
|
||||
},
|
||||
// 产品最新页
|
||||
{
|
||||
hidden: true,
|
||||
path: "productIndex",
|
||||
component: () => import("@/views/product/productHome/productIndex/index.vue"),
|
||||
name: "ProductIndex",
|
||||
meta: { title: "产品最新页", fullPath: "/product/productHome/productIndex", noCache: true },
|
||||
},],
|
||||
},
|
||||
// 资质审核
|
||||
{
|
||||
path: "/qualificationReview",
|
||||
|
||||
BIN
f/web-kboss/src/views/homePage/detail/img/1.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/2.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/3.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/4.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/5.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/6.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/7.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
f/web-kboss/src/views/homePage/detail/img/Frame.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
f/web-kboss/src/views/homePage/detail/img/FrameOne.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
f/web-kboss/src/views/homePage/detail/img/Group.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
@ -191,6 +191,7 @@ export default Vue.extend({
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
background-color: #f6f8fd;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 产品列表 -->
|
||||
<div>
|
||||
<div class="product-container">
|
||||
<ul v-if="type === 'homePage'" class="productListContent" style="padding-top: 16px;">
|
||||
<li class="product-item" v-for="item in productList" :key="item.id">
|
||||
<div v-if="item.img!=null" class="product-image">
|
||||
@ -38,7 +38,7 @@
|
||||
<span class="spec-value">{{ item.net_card }}</span>
|
||||
</div>
|
||||
<div v-if="item.cart_flag!=='1'" class="spec-item">
|
||||
<span cl ass="spec-label">商品描述:</span>
|
||||
<span class="spec-label">商品描述:</span>
|
||||
<span class="spec-value showText">{{ item.requirement_summary }}</span>
|
||||
</div>
|
||||
<div v-if="item.cart_flag!=='1'" class="spec-item">
|
||||
@ -289,45 +289,53 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.el-pagination{
|
||||
text-align: center !important;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.showText {
|
||||
//显示四行
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 4;
|
||||
-webkit-box-orient: vertical;
|
||||
line-clamp: 4;
|
||||
-webkit-line-clamp: 4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.product-container {
|
||||
width: 1300px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.productListContent {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
// padding: 16px;
|
||||
padding-top: 16px;
|
||||
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
// width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
box-sizing: border-box;
|
||||
// background-color: white;
|
||||
padding: 0 20px;
|
||||
|
||||
.product-item {
|
||||
width: 100%;
|
||||
background: #F7F9FD;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
// box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
padding: 24px;
|
||||
margin-bottom: 20px;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
// &:hover {
|
||||
// transform: translateY(-2px);
|
||||
// box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
||||
// }
|
||||
|
||||
.product-image {
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
@ -463,4 +471,55 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 1200px) {
|
||||
.productListContent {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
max-width: 1000px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.productListContent {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.productListContent {
|
||||
grid-template-columns: 1fr;
|
||||
max-width: 600px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.product-item {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
.price {
|
||||
font-size: 24px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.detail-btn, .delete-btn {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
style="display: flex;align-items: center;justify-content: center;width: 100%;max-width: 1400px;">
|
||||
style="display: flex;align-items: center;justify-content: center;width: 100%;">
|
||||
|
||||
<!-- <img @click="goHome" class="logo-clickable" style="width: 200px;height: 60px;padding-right: 20px;"
|
||||
src="https://www.opencomputing.cn/idfile?path=logo_ncmatch.png" alt=""> -->
|
||||
@ -17,7 +17,7 @@
|
||||
<el-option label="需求" value="2"></el-option>
|
||||
</el-select>
|
||||
<input v-model="keyword" type="text" class="search-input" placeholder="搜你想搜..." @input="handleInputChange"
|
||||
@focus="handleInputFocus" @blur="handleInputBlur">
|
||||
@focus="handleInputFocus" @blur="handleInputBlur" @keyup.enter="handleEnterSearch">
|
||||
|
||||
<button class="search-btn" @click="handleSearch">搜索</button>
|
||||
</div>
|
||||
@ -323,6 +323,23 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 处理回车搜索
|
||||
handleEnterSearch() {
|
||||
console.log('=== 回车搜索触发 ===');
|
||||
|
||||
// 隐藏联想搜索框
|
||||
this.showSearchResults = false;
|
||||
|
||||
// 如果输入框为空,不执行搜索
|
||||
if (!this.keyword.trim()) {
|
||||
this.$message.warning('请输入搜索关键词');
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行搜索
|
||||
this.handleSearch();
|
||||
},
|
||||
|
||||
// 处理搜索
|
||||
handleSearch(result) {
|
||||
// 立即阻止事件传播,确保方法能被正确执行
|
||||
|
||||
@ -1,5 +1,17 @@
|
||||
<template>
|
||||
<div class="main-box">
|
||||
<div class="class">
|
||||
<div class="class-box" @mouseenter="hoverClassBox = 1" @mouseleave="hoverClassBox = 0" :class="{ active: hoverClassBox === 1 }">
|
||||
<div class="class-title" @click="sendInfo('2')">
|
||||
发布需求
|
||||
</div>
|
||||
</div>
|
||||
<div class="class-box" @mouseenter="hoverClassBox = 2" @mouseleave="hoverClassBox = 0" :class="{ active: hoverClassBox === 2 }">
|
||||
<div class="class-title" @click="sendInfo('1')">
|
||||
发布商品
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 25px;">
|
||||
<span style="margin-top: 100px;" class="title">
|
||||
@ -10,8 +22,23 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 发布商品/需求弹窗 -->
|
||||
<el-dialog :title="publish_type === '2' ? '发布需求' : '发布商品'" width="60vw" top="5vh"
|
||||
:visible.sync="sendProductVisible">
|
||||
<sendProduct :isEdit="false" v-if="publish_type" @success="sendProductSuccess" :publish_type="publish_type">
|
||||
</sendProduct>
|
||||
</el-dialog>
|
||||
|
||||
<div style="width: 100%;max-width: 1600px;">
|
||||
<!-- 审核提示弹窗 -->
|
||||
<el-dialog title="温馨提示" :visible.sync="showTip" width="30%">
|
||||
<span>您还没有完善企业信息,完善企业信息审核通过后您可以发布需求与商品。</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<span> <span style="margin-right: 10px;"> 跳转到</span> <el-button size="small" type="primary"
|
||||
@click="goInfo">信息完善</el-button></span>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <div style="width: 100%;max-width: 1600px;"> -->
|
||||
<div class="category-filter">
|
||||
<!-- 新增的需求和商品radio按钮组 -->
|
||||
<div class="radio-group-container">
|
||||
@ -78,20 +105,23 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reqGetSupplyAndDemandSquareList, reqCompanyCategorySearch, reqSupplyAndDemandFirstCategory } from '@/api/ncmatch'
|
||||
import { reqGetSupplyAndDemandSquareList, reqCompanyCategorySearch, reqSupplyAndDemandFirstCategory, reqEnterpriseAuditInfoSearch } from '@/api/ncmatch'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'supplyAndDemandSquare',
|
||||
components: {
|
||||
productCard: () => import('@/views/homePage/ncmatch/mainPage/productCard/index.vue'),
|
||||
sendProduct: () => import('@/views/homePage/ncmatch/mainPage/sendProduct/index.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 新增 hover 状态控制
|
||||
hoverClassBox: 0, // 0: 无悬停, 1: 第一个悬停, 2: 第二个悬停
|
||||
page_size: 8,
|
||||
current_page: 1,
|
||||
typeList: [],
|
||||
@ -109,6 +139,9 @@ export default {
|
||||
secondCategories: [],
|
||||
activeFirstId: null,
|
||||
activeSecondId: null,
|
||||
// 新增发布相关状态
|
||||
showTip: false,
|
||||
sendProductVisible: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -127,18 +160,63 @@ export default {
|
||||
logoutUrl: state => state.login.logoutUrl,
|
||||
loginStateVuex: state => state.login.loginState,
|
||||
logoInfoNew: state => state.product.logoInfoNew,
|
||||
|
||||
|
||||
}),
|
||||
loginState() {
|
||||
const userId = sessionStorage.getItem('userId');
|
||||
return this.loginStateVuex || (userId !== null && userId !== 'null' && userId !== '');
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 发布需求/商品方法
|
||||
sendInfo(type) {
|
||||
if (this.loginState) {
|
||||
reqEnterpriseAuditInfoSearch({
|
||||
url_link: window.location.href,
|
||||
}).then(res => {
|
||||
const dataList = res && res.data && res.data.data
|
||||
const hasAuditInfo = Array.isArray(dataList) && dataList.length !== 0
|
||||
const roles = sessionStorage.getItem('jueseNew')
|
||||
const isCustomer = roles ? roles.includes('客户') : true
|
||||
|
||||
// 安全检查:确保 data[0] 存在
|
||||
if (hasAuditInfo && dataList[0]) {
|
||||
const auditStatus = dataList[0].audit_status
|
||||
|
||||
if (auditStatus === 'pending') {
|
||||
this.$message.warning('您的审核状态为待审核,请等待审核通过后发布~')
|
||||
} else if (auditStatus === 'rejected') {
|
||||
this.$message.warning('您的审核状态为驳回,请重新提交~')
|
||||
} else {
|
||||
// 审核通过或其他状态,允许发布
|
||||
this.publish_type = type
|
||||
this.sendProductVisible = true
|
||||
}
|
||||
} else if (!isCustomer) {
|
||||
// 非客户角色,允许发布
|
||||
this.publish_type = type
|
||||
this.sendProductVisible = true
|
||||
} else {
|
||||
// 没有审核信息且是客户角色,显示提示
|
||||
this.showTip = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
},
|
||||
|
||||
// 发布成功回调
|
||||
sendProductSuccess() {
|
||||
this.sendProductVisible = false; // 关闭弹窗
|
||||
this.initData() // 刷新列表
|
||||
},
|
||||
|
||||
// 跳转到信息完善页面
|
||||
goInfo() {
|
||||
this.showTip = false
|
||||
this.$router.push('/customer/approve')
|
||||
},
|
||||
|
||||
getOneLevelCategory(){
|
||||
// reqSupplyAndDemandFirstCategory({url_link:window.location.href}).then(res=>{
|
||||
// if(res.status){
|
||||
@ -331,6 +409,41 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.class{
|
||||
margin: 40px 0;
|
||||
min-width: 1200px;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding:8px 10px;
|
||||
.class-box{
|
||||
width: 50%;
|
||||
padding: 10px 20px;
|
||||
// border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
border: 1px solid transparent;
|
||||
text-align: center;
|
||||
|
||||
/* 悬停时的渐变背景 */
|
||||
&:hover,
|
||||
&.active {
|
||||
background: linear-gradient(to right, #2979fe, #2eb8fa);
|
||||
border-color: #2979fe;
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 12px rgba(41, 121, 254, 0.3);
|
||||
|
||||
.class-title {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.class-title{
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
@ -360,7 +473,7 @@ export default {
|
||||
|
||||
.radio-group {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
//background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
// box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
@ -473,16 +586,15 @@ export default {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
max-width: 1600px;
|
||||
|
||||
}
|
||||
|
||||
.category-filter {
|
||||
// padding: 20px;
|
||||
bottom: 1rem;
|
||||
background-color: #fff;
|
||||
// background-color: #;
|
||||
border-radius: 8px;
|
||||
margin: 20px;
|
||||
margin-left: 0;
|
||||
@ -553,4 +665,8 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
.el-pagination{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -241,6 +241,10 @@ export default {
|
||||
SendCode_text1: "获取验证码", // 重置密码验证码按钮文本
|
||||
isDisabled: false, // 手机登录验证码按钮是否禁用
|
||||
isDisabled1: false, // 重置密码验证码按钮是否禁用
|
||||
time_count: 60, // 手机登录验证码倒计时
|
||||
time_count1: 60, // 重置密码验证码倒计时
|
||||
timer: null, // 手机登录验证码定时器
|
||||
timer1: null, // 重置密码验证码定时器
|
||||
|
||||
// 对话框和加载状态
|
||||
dialogVisible: false, // 重置密码对话框是否可见
|
||||
@ -260,7 +264,7 @@ export default {
|
||||
rules: {
|
||||
username: [{ required: true, message: "请输入用户名/手机号", trigger: "blur" }],
|
||||
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入验证码", trigger: "blur" }],
|
||||
vcode: [{ required: true, message: "请输入验证码", trigger: "blur" }],
|
||||
},
|
||||
|
||||
// 大写锁定提示
|
||||
@ -286,7 +290,8 @@ export default {
|
||||
// Logo显示控制
|
||||
isLogo: false,
|
||||
isShowSaleProduct: false, // 是否显示销售产品
|
||||
vedioObj: {} // 视频通话对象
|
||||
vedioObj: {}, // 视频通话对象
|
||||
socket: null, // WebSocket连接
|
||||
}
|
||||
},
|
||||
|
||||
@ -317,8 +322,14 @@ export default {
|
||||
beforeDestroy() {
|
||||
// 组件销毁前清理定时器和事件监听
|
||||
clearInterval(this.timer)
|
||||
clearInterval(this.timer1)
|
||||
clearInterval(this.getCodeTimer)
|
||||
window.removeEventListener('keydown', this.handleEnter);
|
||||
|
||||
// 关闭WebSocket连接
|
||||
if (this.socket) {
|
||||
this.socket.close();
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@ -635,7 +646,17 @@ export default {
|
||||
|
||||
// 获取手机登录验证码
|
||||
getCode() {
|
||||
getCodeAPI({ username: this.loginForm.username }).then((res) => {
|
||||
// 验证手机号格式
|
||||
if (!this.loginForm.username || !/^1[3-9]\d{9}$/.test(this.loginForm.username)) {
|
||||
this.$message.error('请输入正确的手机号');
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用新的API参数:mobile和action_type
|
||||
getCodeAPI({
|
||||
mobile: this.loginForm.username,
|
||||
action_type: 'login'
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
if (res.status) {
|
||||
this.loginForm.codeid = res.codeid;
|
||||
@ -643,9 +664,9 @@ export default {
|
||||
clearInterval(that.timer)
|
||||
this.time_count = 59
|
||||
this.SendCode_text = "重新发送" + this.time_count + "s";
|
||||
this.isDisabled = true;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.time_count > 0) {
|
||||
this.isDisabled = true;
|
||||
this.time_count--;
|
||||
this.SendCode_text = "重新发送" + this.time_count + "s";
|
||||
} else {
|
||||
@ -679,15 +700,28 @@ export default {
|
||||
|
||||
// 获取重置密码验证码
|
||||
getCode1() {
|
||||
retrieveCodeAPI({ username: this.form.username }).then((res) => {
|
||||
// 验证手机号格式
|
||||
if (!this.form.username || !/^1[3-9]\d{9}$/.test(this.form.username)) {
|
||||
this.$message.error('请输入正确的手机号');
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用新的API参数:mobile和action_type
|
||||
retrieveCodeAPI({
|
||||
mobile: this.form.username,
|
||||
action_type: 'login'
|
||||
}).then((res) => {
|
||||
if (res.status == true) {
|
||||
this.form.id = res.userid;
|
||||
this.form.codeid = res.codeid;
|
||||
let that = this;
|
||||
this.time_count1 = 59;
|
||||
this.isDisabled1 = true;
|
||||
this.SendCode_text1 = "重新发送" + this.time_count1 + "s";
|
||||
|
||||
if (!that.timer1) {
|
||||
that.timer1 = setInterval(() => {
|
||||
if (that.time_count1 > 0) {
|
||||
this.isDisabled1 = true;
|
||||
that.time_count1--;
|
||||
that.SendCode_text1 = "重新发送" + that.time_count1 + "s";
|
||||
} else {
|
||||
@ -723,7 +757,7 @@ export default {
|
||||
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
|
||||
},
|
||||
|
||||
// 处理登录
|
||||
// 处理登录 - 账号登录保持原逻辑不变
|
||||
handleLogin(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
@ -901,10 +935,10 @@ export default {
|
||||
});
|
||||
this.isDisabled1 = false;
|
||||
this.dialogVisible = false;
|
||||
that.SendCode_text1 = "获取验证码";
|
||||
clearInterval(that.timer1);
|
||||
that.timer1 = null;
|
||||
that.time_count1 = 60;
|
||||
this.SendCode_text1 = "获取验证码";
|
||||
clearInterval(this.timer1);
|
||||
this.timer1 = null;
|
||||
this.time_count1 = 60;
|
||||
this.$refs.form.resetFields();
|
||||
} else {
|
||||
this.$message({
|
||||
@ -926,7 +960,6 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$cursor: black;
|
||||
$light_gray: #eee;
|
||||
@ -951,8 +984,9 @@ $dark_gray: #889aa4;
|
||||
display: flex;
|
||||
width: 1400px;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
// align-items: center;
|
||||
margin-top: -100px;
|
||||
margin-top: -60px;
|
||||
|
||||
.left {
|
||||
.title {
|
||||
|
||||
644
f/web-kboss/src/views/product/allProduct/index.vue
Normal file
@ -0,0 +1,644 @@
|
||||
<template>
|
||||
<div class="product-service-page">
|
||||
|
||||
<!-- 产品分类导航 -->
|
||||
<div class="category-nav">
|
||||
<div v-for="category in panelData"
|
||||
:key="category.firTitle"
|
||||
class="nav-item"
|
||||
:class="{ active: activeCategory === category.firTitle }"
|
||||
@click="switchCategory(category)">
|
||||
{{ category.firTitle }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 产品内容区域 -->
|
||||
<div class="product-content">
|
||||
<!-- 左侧菜单区域(只有有二级或三级菜单时才显示) -->
|
||||
<div v-if="hasMenuSidebar" class="menu-sidebar">
|
||||
<!-- 二级菜单 -->
|
||||
<div v-if="hasSecondLevel" class="subcategory-section">
|
||||
<div class="subcategory-list">
|
||||
<div v-for="subItem in currentSubcategories"
|
||||
:key="getSubItemKey(subItem)"
|
||||
class="subcategory-item"
|
||||
:class="{ active: activeSubId === getSubItemKey(subItem) }"
|
||||
@click="switchSubcategory(subItem)">
|
||||
<span class="subcategory-name">{{ subItem.secTitle }}</span>
|
||||
<span v-if="getProductCount(subItem)" class="product-count">
|
||||
{{ getProductCount(subItem) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 三级菜单(如果有且不是算/网分类) -->
|
||||
<div v-if="hasThirdLevel && !isSpecialCategory" class="third-level-section">
|
||||
<div class="third-level-list">
|
||||
<div v-for="thirdItem in thirdLevelData"
|
||||
:key="getThirdItemKey(thirdItem)"
|
||||
class="third-level-item"
|
||||
:class="{ active: activeThirdId === getThirdItemKey(thirdItem) }"
|
||||
@click="switchThirdLevel(thirdItem)">
|
||||
{{ thirdItem.thrTitle }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<div class="main-content" :class="{ 'full-width': !hasMenuSidebar }">
|
||||
<!-- 产品网格 -->
|
||||
<div class="product-grid">
|
||||
<div v-for="product in currentProducts"
|
||||
:key="product.id"
|
||||
class="product-card"
|
||||
@click="handleProductClick(product)">
|
||||
<div class="product-header">
|
||||
<h3 class="product-name">{{ product.name }}</h3>
|
||||
<span v-if="product.discount" class="discount-badge">
|
||||
{{ product.discount }}折
|
||||
</span>
|
||||
</div>
|
||||
<div class="product-desc">
|
||||
{{ getProductDescription(product) }}
|
||||
</div>
|
||||
<div class="product-footer">
|
||||
<span class="product-type">{{ product.type }}</span>
|
||||
<button class="detail-btn">查看详情</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<div v-if="!hasProducts" class="empty-state">
|
||||
<div class="empty-icon">📦</div>
|
||||
<p class="empty-text">暂无产品数据</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reqNavList } from "@/api/newHome";
|
||||
|
||||
export default {
|
||||
name: "ProductServicePage",
|
||||
data() {
|
||||
return {
|
||||
panelData: [],
|
||||
activeCategory: '',
|
||||
activeSubId: null,
|
||||
activeThirdId: null,
|
||||
currentProducts: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
currentSubcategories() {
|
||||
if (!this.activeCategory || !this.panelData.length) return [];
|
||||
const category = this.panelData.find(item => item.firTitle === this.activeCategory);
|
||||
return category ? category.secMenu : [];
|
||||
},
|
||||
hasSecondLevel() {
|
||||
return this.currentSubcategories && this.currentSubcategories.length > 0;
|
||||
},
|
||||
hasThirdLevel() {
|
||||
return this.thirdLevelData && this.thirdLevelData.length > 0;
|
||||
},
|
||||
hasProducts() {
|
||||
return this.currentProducts && this.currentProducts.length > 0;
|
||||
},
|
||||
hasMenuSidebar() {
|
||||
return this.hasSecondLevel || this.hasThirdLevel;
|
||||
},
|
||||
isSpecialCategory() {
|
||||
return this.activeCategory === '算' || this.activeCategory === '网';
|
||||
},
|
||||
thirdLevelData() {
|
||||
if (!this.activeSubId || !this.currentSubcategories.length) return [];
|
||||
|
||||
// 从activeSubId中提取真实的subItem id
|
||||
const realSubId = this.activeSubId.split('_')[0];
|
||||
const subItem = this.currentSubcategories.find(item =>
|
||||
item.id === realSubId || item.id?.toString() === realSubId
|
||||
);
|
||||
|
||||
return subItem && subItem.thrMenu ? subItem.thrMenu : [];
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.loadNavData();
|
||||
this.initializeDefaultData();
|
||||
},
|
||||
methods: {
|
||||
// 生成唯一的二级菜单项key
|
||||
getSubItemKey(subItem) {
|
||||
// 使用分类标题和ID组合确保唯一性
|
||||
return `${subItem.id}_${this.activeCategory}_${subItem.secTitle}`;
|
||||
},
|
||||
|
||||
// 生成唯一的三级菜单项key
|
||||
getThirdItemKey(thirdItem) {
|
||||
// 使用三级菜单ID和父级ID组合确保唯一性
|
||||
return `${thirdItem.id}_${this.activeSubId}_${thirdItem.thrTitle}`;
|
||||
},
|
||||
|
||||
// 加载导航数据
|
||||
async loadNavData() {
|
||||
try {
|
||||
const response = await reqNavList({ url_link: window.location.href });
|
||||
if (response.status && response.data.product_service) {
|
||||
this.panelData = this.processNavData(response.data.product_service);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载产品数据失败:", error);
|
||||
this.panelData = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 处理导航数据 - 修复数据结构
|
||||
processNavData(data) {
|
||||
return data.map((category, categoryIndex) => {
|
||||
// 确保一级分类有唯一标识
|
||||
if (!category.uniqueId) {
|
||||
category.uniqueId = `category_${categoryIndex}_${category.firTitle}`;
|
||||
}
|
||||
|
||||
if (category.secMenu) {
|
||||
category.secMenu.forEach((secItem, secIndex) => {
|
||||
// 确保二级菜单项有唯一标识
|
||||
if (!secItem.id) {
|
||||
secItem.id = `sec_${categoryIndex}_${secIndex}`;
|
||||
}
|
||||
|
||||
if (secItem.thrMenu) {
|
||||
secItem.thrMenu.forEach((thrItem, thrIndex) => {
|
||||
// 确保三级菜单项有唯一标识
|
||||
if (!thrItem.id) {
|
||||
thrItem.id = `thr_${categoryIndex}_${secIndex}_${thrIndex}`;
|
||||
}
|
||||
|
||||
if (thrItem.value) {
|
||||
thrItem.value.forEach(product => {
|
||||
product.type = secItem.secTitle;
|
||||
// 确保产品有唯一ID
|
||||
if (!product.id) {
|
||||
product.id = `product_${categoryIndex}_${secIndex}_${thrIndex}_${Math.random().toString(36).substr(2, 9)}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return category;
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化默认数据
|
||||
initializeDefaultData() {
|
||||
if (this.panelData.length > 0) {
|
||||
const firstCategory = this.panelData[0];
|
||||
this.activeCategory = firstCategory.firTitle;
|
||||
this.setDefaultSubcategory(firstCategory);
|
||||
}
|
||||
},
|
||||
|
||||
// 根据分类设置默认二级菜单
|
||||
setDefaultSubcategory(category) {
|
||||
if (category.secMenu && category.secMenu.length > 0) {
|
||||
let defaultSubItem = category.secMenu[0];
|
||||
|
||||
if (category.firTitle === '算') {
|
||||
const zhishuanItem = category.secMenu.find(item =>
|
||||
item.secTitle && item.secTitle.includes('智算')
|
||||
);
|
||||
if (zhishuanItem) defaultSubItem = zhishuanItem;
|
||||
} else if (category.firTitle === '网') {
|
||||
const networkItem = category.secMenu.find(item =>
|
||||
item.secTitle && item.secTitle.includes('算力网络')
|
||||
);
|
||||
if (networkItem) defaultSubItem = networkItem;
|
||||
}
|
||||
|
||||
this.activeSubId = this.getSubItemKey(defaultSubItem);
|
||||
this.updateProductList(defaultSubItem);
|
||||
} else {
|
||||
this.activeSubId = null;
|
||||
this.activeThirdId = null;
|
||||
this.currentProducts = this.getAllProductsFromCategory(category);
|
||||
}
|
||||
},
|
||||
|
||||
// 获取分类下的所有产品
|
||||
getAllProductsFromCategory(category) {
|
||||
let allProducts = [];
|
||||
if (category.secMenu) {
|
||||
category.secMenu.forEach(secItem => {
|
||||
if (secItem.thrMenu) {
|
||||
secItem.thrMenu.forEach(thrItem => {
|
||||
if (thrItem.value) {
|
||||
allProducts = allProducts.concat(thrItem.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return allProducts;
|
||||
},
|
||||
|
||||
// 切换分类
|
||||
switchCategory(category) {
|
||||
this.activeCategory = category.firTitle;
|
||||
this.activeSubId = null;
|
||||
this.activeThirdId = null;
|
||||
this.setDefaultSubcategory(category);
|
||||
},
|
||||
|
||||
// 切换二级分类
|
||||
switchSubcategory(subItem) {
|
||||
this.activeSubId = this.getSubItemKey(subItem);
|
||||
this.activeThirdId = null;
|
||||
this.updateProductList(subItem);
|
||||
},
|
||||
|
||||
// 切换三级分类
|
||||
switchThirdLevel(thirdItem) {
|
||||
this.activeThirdId = this.getThirdItemKey(thirdItem);
|
||||
this.currentProducts = thirdItem.value || [];
|
||||
},
|
||||
|
||||
// 更新产品列表
|
||||
updateProductList(subItem) {
|
||||
if (this.isSpecialCategory) {
|
||||
this.currentProducts = this.getAllProductsFromSubcategory(subItem);
|
||||
return;
|
||||
}
|
||||
|
||||
if (subItem.thrMenu && subItem.thrMenu.length > 0) {
|
||||
this.activeThirdId = null;
|
||||
this.currentProducts = this.getAllProductsFromSubcategory(subItem);
|
||||
} else {
|
||||
this.activeThirdId = null;
|
||||
this.currentProducts = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 获取二级分类下的所有产品
|
||||
getAllProductsFromSubcategory(subItem) {
|
||||
let allProducts = [];
|
||||
if (subItem.thrMenu) {
|
||||
subItem.thrMenu.forEach(thrItem => {
|
||||
if (thrItem.value) {
|
||||
allProducts = allProducts.concat(thrItem.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
return allProducts;
|
||||
},
|
||||
|
||||
// 获取产品数量
|
||||
getProductCount(subItem) {
|
||||
if (!subItem.thrMenu) return 0;
|
||||
return subItem.thrMenu.reduce((total, thirdItem) => {
|
||||
return total + (thirdItem.value ? thirdItem.value.length : 0);
|
||||
}, 0);
|
||||
},
|
||||
|
||||
// 获取产品描述
|
||||
getProductDescription(product) {
|
||||
const descriptions = {
|
||||
'云服务器_GPU': '高性能GPU云服务器,适合AI训练、科学计算等场景',
|
||||
'云服务器_BCC': '平衡型云服务器,满足大多数业务需求',
|
||||
'专属服务器': '独享物理服务器,提供更高性能和安全隔离',
|
||||
'轻量应用服务器': '轻量级应用部署,简单易用',
|
||||
'专线接入': '高速稳定的专线网络接入服务',
|
||||
'文字识别': '高精度文字识别,支持多种场景和语言',
|
||||
'AI能力引擎': '强大的AI能力引擎,赋能各种智能应用',
|
||||
'大数据平台': '全面的大数据处理和分析平台',
|
||||
'云服务平台': '一站式云服务平台,便捷高效',
|
||||
'智能内容科技': '智能内容生成与处理技术',
|
||||
'SME企业服务': '中小企业专属服务解决方案',
|
||||
'视频云平台': '专业的视频云处理与分发平台',
|
||||
'智能短信': '智能化短信服务和营销解决方案'
|
||||
};
|
||||
return descriptions[product.name] || '专业的云服务产品,提供稳定可靠的服务';
|
||||
},
|
||||
|
||||
// 点击产品
|
||||
handleProductClick(product) {
|
||||
// 原有的产品点击逻辑保持不变
|
||||
const userId = sessionStorage.getItem('userId');
|
||||
|
||||
if (product.type === '百度云') {
|
||||
if (userId) {
|
||||
localStorage.setItem('redirectUrl', product.url);
|
||||
localStorage.setItem('userRescourseUrl', product.listUrl);
|
||||
this.$router.push({
|
||||
name: 'baiduProductShow',
|
||||
params: {
|
||||
listUrl: product.listUrl,
|
||||
url: product.url
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/login",
|
||||
query: {
|
||||
fromPath: 'productService',
|
||||
type: 'bd',
|
||||
listUrl: product.listUrl,
|
||||
url: product.url
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (product.type === '阿里云') {
|
||||
if (userId) {
|
||||
window.open(product.url);
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/login",
|
||||
query: {
|
||||
fromPath: 'productService',
|
||||
type: 'ali',
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (product.type === '智算' || product.type === '算力网络') {
|
||||
if (product.name === '容器云') {
|
||||
if (userId) {
|
||||
this.$router.push('/product/productHome/k8s/createK8s');
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/login",
|
||||
query: {
|
||||
fromPath: 'productService',
|
||||
type: 'rqy',
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: '/homePage/detail',
|
||||
query: {
|
||||
id: product.id,
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (product.name === '灵医智能体') {
|
||||
this.$router.push('/homePage/hospital');
|
||||
} else if (product.name === '客悦·智能客服') {
|
||||
this.$router.push('/homePage/customerService');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/* 样式保持不变 */
|
||||
.product-service-page {
|
||||
margin: 0 auto;
|
||||
padding: 24px;
|
||||
background: #fff;
|
||||
min-height: calc(100vh - 100px);
|
||||
|
||||
.category-nav {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-bottom: 32px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
|
||||
.nav-item {
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
color: #1E6FFF;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #1E6FFF;
|
||||
border-bottom-color: #1E6FFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-content {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
|
||||
.menu-sidebar {
|
||||
width: 280px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
flex-shrink: 0;
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1a1a1a;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.subcategory-section {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.subcategory-list,
|
||||
.third-level-list {
|
||||
.subcategory-item,
|
||||
.third-level-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 4px;
|
||||
|
||||
&:hover {
|
||||
background: rgba(30, 111, 255, 0.05);
|
||||
color: #1E6FFF;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: rgba(30, 111, 255, 0.1);
|
||||
color: #1E6FFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.subcategory-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.product-count {
|
||||
background: #e8f4ff;
|
||||
color: #1E6FFF;
|
||||
font-size: 12px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
min-width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.third-level-list {
|
||||
.third-level-item {
|
||||
padding-left: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
|
||||
&.full-width {
|
||||
flex: 1;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
|
||||
.product-card {
|
||||
background: #fff;
|
||||
border: 1px solid #f0f0f0;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
border-color: #1E6FFF;
|
||||
}
|
||||
|
||||
.product-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.product-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1a1a1a;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.discount-badge {
|
||||
background: linear-gradient(135deg, #ff6b6b, #ff4757);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 16px;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.product-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.product-type {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
background: #f8f9fa;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.detail-btn {
|
||||
background: #1E6FFF;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s;
|
||||
|
||||
&:hover {
|
||||
background: #0d5ae0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 60px 20px;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.product-service-page {
|
||||
padding: 16px;
|
||||
|
||||
.product-content {
|
||||
flex-direction: column;
|
||||
|
||||
.menu-sidebar {
|
||||
width: 100%;
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
order: 1;
|
||||
|
||||
&.full-width {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
grid-template-columns: 1fr !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -11,8 +11,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 其他部分保持不变 -->
|
||||
<div class="section">
|
||||
<div class="bigTitle">资源概览</div>
|
||||
<ul class="recUl overView">
|
||||
@ -235,7 +233,7 @@ export default Vue.extend({
|
||||
console.log(`跳转到资源概览,筛选类型: ${todoName}`, query);
|
||||
|
||||
this.$router.push({
|
||||
path: '/overview',
|
||||
path: '/orderManagement/orderManagement',
|
||||
query: query
|
||||
});
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
alt="">
|
||||
</div>
|
||||
|
||||
<!-- 头部图标 - 与登录页面保持一致 -->
|
||||
<!-- 头部图标 -->
|
||||
<img @click="goHomePage" style="cursor: pointer" class="logo-top1" :src="logoImg" alt="" v-if="isLogo && isShow">
|
||||
<img @click="goHomePage" style="cursor: pointer" class="logo-top" src="../../assets/kyy/LOGONew.png" alt=""
|
||||
v-else-if="isShow">
|
||||
@ -22,7 +22,6 @@
|
||||
<!-- 表单标题区域 -->
|
||||
<div class="title-container">
|
||||
<span class="title">注册</span>
|
||||
<!-- 跳转到登录页面的链接 -->
|
||||
<span class="subtitle" @click="handleLogin">前往登录 ></span>
|
||||
</div>
|
||||
|
||||
@ -31,10 +30,9 @@
|
||||
<el-form-item prop="mobile" class="form-item-custom full-width">
|
||||
<div class="form-item">
|
||||
<span class="svg-container country-code">
|
||||
+86 <!-- 国家区号 -->
|
||||
+86
|
||||
</span>
|
||||
<!-- 手机号输入框 -->
|
||||
<el-input ref="mobile" v-model="registForm.mobile" placeholder="请输入" type="text"
|
||||
<el-input ref="mobile" v-model="registForm.mobile" placeholder="请输入手机号" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -42,16 +40,16 @@
|
||||
|
||||
<!-- 验证码输入区域 -->
|
||||
<div class="form-row">
|
||||
<el-form-item prop="smsCode" class="form-item-custom full-width">
|
||||
<el-form-item prop="vcode" class="form-item-custom full-width">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
验证码 <!-- 验证码标签 -->
|
||||
验证码
|
||||
</span>
|
||||
<!-- 验证码输入框 -->
|
||||
<el-input ref="smsCode" v-model="registForm.smsCode" placeholder="请输入" type="text"
|
||||
<el-input ref="vcode" v-model="registForm.vcode" placeholder="请输入验证码" type="text"
|
||||
class="custom-input" />
|
||||
<!-- 获取验证码按钮,带倒计时功能 -->
|
||||
<span class="get-code-btn" @click="getSmsCode">{{ countdown > 0 ? `${countdown}s后重新获取` : '获取验证码' }}</span>
|
||||
<span class="get-code-btn" @click="getSmsCode" :class="{ disabled: countdown > 0 }">
|
||||
{{ countdown > 0 ? `${countdown}s后重新获取` : '获取验证码' }}
|
||||
</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@ -66,10 +64,9 @@
|
||||
<el-form-item class="form-item-custom full-width">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
账户名 <!-- 账户名标签 -->
|
||||
账户名
|
||||
</span>
|
||||
<!-- 账户名输入框 -->
|
||||
<el-input ref="username" v-model="registForm.username" placeholder="请输入" name="username" type="text"
|
||||
<el-input ref="username" v-model="registForm.username" placeholder="请输入账户名(默认手机号)" name="username" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -80,12 +77,10 @@
|
||||
<el-form-item class="form-item-custom full-width">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
密码 <!-- 密码标签 -->
|
||||
密码
|
||||
</span>
|
||||
<!-- 密码输入框,带显示/隐藏密码功能 -->
|
||||
<el-input :key="passwordType" ref="password" v-model="registForm.password" :type="passwordType"
|
||||
placeholder="请输入" name="password" class="custom-input" />
|
||||
<!-- 显示/隐藏密码按钮 -->
|
||||
placeholder="请输入密码" name="password" class="custom-input" />
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
||||
</span>
|
||||
@ -93,101 +88,15 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第二行:显示名和邮箱(已注释,保留但不显示) -->
|
||||
<!-- <div class="form-row">
|
||||
<el-form-item prop="nick_name" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/用户.svg" alt="">
|
||||
</span>
|
||||
<el-input ref="nick_name" v-model="registForm.nick_name" placeholder="请输入显示名" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="email" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/邮箱.svg" alt="">
|
||||
</span>
|
||||
<el-input ref="email" v-model="registForm.email" placeholder="请输入邮件地址" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
|
||||
<!-- 第三行:手机号和地址(已注释,保留但不显示) -->
|
||||
<!-- <div class="form-row">
|
||||
<el-form-item prop="mobile" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/手机.svg" alt="">
|
||||
</span>
|
||||
<el-input ref="mobile" v-model="registForm.mobile" placeholder="请输入手机号" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="address" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/地址.svg" alt="">
|
||||
</span>
|
||||
<el-cascader class="custom-cascader" v-model="registForm.address" :options="cityArr()" :props="props"
|
||||
placeholder="请选择地址"></el-cascader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
|
||||
<!-- 第四行:行业和机构类型(已注释,保留但不显示) -->
|
||||
<!-- <div class="form-row">
|
||||
<el-form-item prop="main_business" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/地址.svg" alt="">
|
||||
</span>
|
||||
<el-select ref="address" v-model="registForm.main_business" placeholder="请选择行业" class="custom-select">
|
||||
<el-option v-for="item in main_business_list" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="org_type" class="form-item-custom">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/机构.svg" alt="">
|
||||
</span>
|
||||
<el-select v-model="registForm.org_type" placeholder="请选择机构类型" @change="change" class="custom-select">
|
||||
<el-option label="个人客户" value="2"></el-option>
|
||||
<el-option label="公司客户" value="3"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
|
||||
<!-- 机构名称(条件显示,已注释,保留但不显示) -->
|
||||
<!-- <el-form-item prop="orgname" v-if="registForm.org_type == '3'" class="form-item-custom full-width">
|
||||
<div class="form-item">
|
||||
<span class="svg-container">
|
||||
<img style="width: 14px;height: 14px;" src="../../assets/kyy/用户.svg" alt="">
|
||||
</span>
|
||||
<el-input ref="orgname" v-model="registForm.orgname" placeholder="请输入机构名称" type="text"
|
||||
class="custom-input" />
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
|
||||
<!-- 用户协议勾选区域 -->
|
||||
<div class="agreement">
|
||||
<el-checkbox v-model="agreeProtocol">
|
||||
我已阅读并同意 《用户协议》、《隐私政策》、《产品服务协议》
|
||||
我已阅读并同意《用户协议》、《隐私政策》、《产品服务协议》
|
||||
</el-checkbox>
|
||||
</div>
|
||||
|
||||
<!-- 注册按钮区域 -->
|
||||
<div class="twoBtn">
|
||||
<!-- 注册按钮,点击触发注册流程 -->
|
||||
<el-button class="register-btn" :loading="loading" type="primary"
|
||||
@click.native.prevent="handleRegister('registForm')">
|
||||
立即注册
|
||||
@ -200,8 +109,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 导入API函数和工具函数
|
||||
import { registerUserAPI, getLogoAPI } from "@/api/login";
|
||||
import { getLogoAPI, register, sendCode } from "@/api/login";
|
||||
import { cityArr } from '@/assets/province.js'
|
||||
import { mapState } from "vuex";
|
||||
import { getHomePath } from '@/views/setting/tools'
|
||||
@ -224,46 +132,24 @@ export default {
|
||||
countdown: 0,
|
||||
// 倒计时定时器
|
||||
countdownTimer: null,
|
||||
// 行业列表(已注释,保留但不使用)
|
||||
main_business_list: [
|
||||
{ value: '大学教育', label: '大学教育' },
|
||||
{ value: '智慧医疗', label: '智慧医疗' },
|
||||
{ value: '智能制造', label: '智能制造' },
|
||||
{ value: '自动驾驶', label: '自动驾驶' },
|
||||
{ value: '游戏渲染', label: '游戏渲染' },
|
||||
{ value: '金融科技', label: '金融科技' },
|
||||
{ value: '虚拟现实', label: '虚拟现实' },
|
||||
{ value: '生物技术', label: '生物技术' },
|
||||
{ value: '航空航天', label: '航空航天' },
|
||||
],
|
||||
// 级联选择器配置(已注释,保留但不使用)
|
||||
props: {
|
||||
value: 'name',
|
||||
label: 'name',
|
||||
expandTrigger: 'click',
|
||||
},
|
||||
// 短信验证码的codeid
|
||||
codeid: '',
|
||||
|
||||
// 当前页面URL
|
||||
url: window.location.href,
|
||||
value: '',
|
||||
// 注册表单数据
|
||||
registForm: {
|
||||
username: "", // 账户名(非必填)
|
||||
password: "", // 密码(非必填)
|
||||
email: "", // 邮箱(已注释)
|
||||
nick_name: "", // 显示名(已注释)
|
||||
address: "", // 地址(已注释)
|
||||
mobile: "", // 手机号(必填)
|
||||
org_type: "", // 机构类型(已注释)
|
||||
orgname: "", // 机构名称(已注释)
|
||||
main_business: "", // 主营业务(已注释)
|
||||
smsCode: "", // 验证码(必填)
|
||||
wechat_openid: localStorage.getItem('wechat_openid') // 微信openid
|
||||
vcode: "", // 验证码(必填)
|
||||
username: "", // 账户名(非必填,默认手机号)
|
||||
password: "", // 密码(非必填)
|
||||
org_type: "2", // 机构类型(必填,固定为2)
|
||||
wechat_openid: localStorage.getItem('wechat_openid') || "", // 微信openid(默认为空)
|
||||
domain_name: "" // 域名
|
||||
},
|
||||
imageUrl: "",
|
||||
currentFile: null,
|
||||
// 邀请码(从路由参数获取)
|
||||
invitecode: this.$route.query.invitecode,
|
||||
// 表单验证规则 - 只验证手机号和验证码
|
||||
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
// 手机号验证规则
|
||||
mobile: [
|
||||
@ -274,27 +160,9 @@ export default {
|
||||
{ required: true, trigger: "blur", message: "请输入手机号" },
|
||||
],
|
||||
// 验证码验证规则
|
||||
smsCode: [
|
||||
vcode: [
|
||||
{ required: true, message: "请输入验证码", trigger: "blur" }
|
||||
]
|
||||
// 以下为已注释的验证规则,保留但不使用
|
||||
// address: [
|
||||
// { required: true, message: "请输入地址", trigger: "blur" }
|
||||
// ],
|
||||
// main_business: [
|
||||
// { required: true, message: "请输入行业", trigger: "blur" }
|
||||
// ],
|
||||
// nick_name: [
|
||||
// { required: true, message: "请输入显示名", trigger: "blur" },
|
||||
// ],
|
||||
// email: [
|
||||
// {
|
||||
// pattern: /[\w.]+\@[-a-z0-9]+(\.[-a-z0-9]+)*/ig,
|
||||
// message: "请输入有效的邮箱",
|
||||
// },
|
||||
// { required: true, trigger: "blur", message: "请输入邮箱" },
|
||||
// ],
|
||||
// orgname: [{ required: true, message: "请输入机构", trigger: "blur" }],
|
||||
},
|
||||
// 密码显示类型(password/text)
|
||||
passwordType: "password",
|
||||
@ -302,11 +170,6 @@ export default {
|
||||
loading: false,
|
||||
redirect: undefined,
|
||||
otherQuery: {},
|
||||
// 机构类型列表(已注释,保留但不使用)
|
||||
// org_type: [
|
||||
// { value: "2", label: "个人客户" },
|
||||
// { value: "3", label: "公司客户" },
|
||||
// ],
|
||||
};
|
||||
},
|
||||
|
||||
@ -317,12 +180,8 @@ export default {
|
||||
|
||||
// 组件挂载后调用
|
||||
mounted() {
|
||||
// 初始化用户名
|
||||
this.registForm.username = '';
|
||||
// 如果有邀请码,设置到表单中
|
||||
if (this.invitecode) {
|
||||
this.registForm.invitecode = this.invitecode;
|
||||
}
|
||||
// 初始化域名
|
||||
this.registForm.domain_name = window.location.hostname;
|
||||
},
|
||||
|
||||
computed: {
|
||||
@ -333,7 +192,7 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 跳转到首页 - 与登录页面保持一致
|
||||
// 跳转到首页
|
||||
goHomePage() {
|
||||
if (this.logoUrlOut) {
|
||||
window.location.href = this.logoUrlOut
|
||||
@ -347,7 +206,7 @@ export default {
|
||||
return cityArr;
|
||||
},
|
||||
|
||||
// 初始化函数 - 获取Logo等信息,与登录页面保持一致
|
||||
// 初始化函数 - 获取Logo等信息
|
||||
init() {
|
||||
let params = {
|
||||
url_link: this.GetQueryString(this.url)
|
||||
@ -359,7 +218,7 @@ export default {
|
||||
this.isShow = true
|
||||
this.$store.commit('setLogoInfoNew', res.data[0].additional_msg);
|
||||
|
||||
// 特殊机构处理 - 与登录页面保持一致
|
||||
// 特殊机构处理
|
||||
if (res.data[0].orgname == '中关村数智人工智能产业联盟') {
|
||||
this.logoUrlOut = 'https://www.ncmatch.cn'
|
||||
}
|
||||
@ -390,13 +249,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 机构类型改变时的处理函数(已注释,保留但不使用)
|
||||
change(row) {
|
||||
if (row == 3) {
|
||||
this.registForm.orgname = null;
|
||||
}
|
||||
},
|
||||
|
||||
// 显示/隐藏密码
|
||||
showPwd() {
|
||||
if (this.passwordType === "password") {
|
||||
@ -410,7 +262,7 @@ export default {
|
||||
},
|
||||
|
||||
// 获取短信验证码
|
||||
getSmsCode() {
|
||||
async getSmsCode() {
|
||||
// 如果正在倒计时,直接返回
|
||||
if (this.countdown > 0) return;
|
||||
|
||||
@ -423,7 +275,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证手机号格式是否正确
|
||||
const mobileRegex = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
|
||||
if (!mobileRegex.test(this.registForm.mobile)) {
|
||||
this.$message({
|
||||
@ -433,29 +284,61 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
// 这里实际应该调用获取验证码的API
|
||||
// getSmsCodeAPI({ mobile: this.registForm.mobile }).then(res => {
|
||||
// if (res.status) {
|
||||
// this.$message({
|
||||
// message: "验证码已发送",
|
||||
// type: "success",
|
||||
// });
|
||||
// this.startCountdown();
|
||||
// } else {
|
||||
// this.$message({
|
||||
// message: res.msg,
|
||||
// type: "error",
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
let params = {
|
||||
mobile: this.registForm.mobile,
|
||||
action_type: "register",
|
||||
};
|
||||
|
||||
// 模拟发送验证码成功
|
||||
try {
|
||||
let res = await sendCode(params)
|
||||
console.log('短信验证码完整响应:', res);
|
||||
|
||||
if (res.status == true) {
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: "success",
|
||||
});
|
||||
|
||||
// 修复:安全地获取 codeid,处理不同的响应结构
|
||||
let codeid = '';
|
||||
|
||||
// 尝试从不同的响应结构获取 codeid
|
||||
if (res.data && res.data.codeid) {
|
||||
// 结构: { data: { codeid: 'xxx' } }
|
||||
codeid = res.data.codeid;
|
||||
} else if (res.codeid) {
|
||||
// 结构: { codeid: 'xxx' }
|
||||
codeid = res.codeid;
|
||||
} else if (res.data && typeof res.data === 'string') {
|
||||
// 结构: { data: 'xxx' } 且 data 直接是 codeid
|
||||
codeid = res.data;
|
||||
} else if (res.data && res.data.data && res.data.data.codeid) {
|
||||
// 结构: { data: { data: { codeid: 'xxx' } } }
|
||||
codeid = res.data.data.codeid;
|
||||
} else {
|
||||
// 如果都没有找到,使用手机号和时间戳生成一个临时的 codeid
|
||||
console.warn('无法从响应中获取 codeid,使用临时值。响应结构:', res);
|
||||
codeid = `temp_${this.registForm.mobile}_${Date.now()}`;
|
||||
}
|
||||
|
||||
this.codeid = codeid;
|
||||
console.log('最终获取的 codeid:', this.codeid);
|
||||
|
||||
// 开始倒计时
|
||||
this.startCountdown();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.message || "验证码发送失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('发送验证码失败:', error);
|
||||
this.$message({
|
||||
message: "验证码发送失败,请重试",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 开始验证码倒计时
|
||||
@ -469,17 +352,6 @@ export default {
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
// 头像上传成功处理(已注释,保留但不使用)
|
||||
handleAvatarSuccess(file, fileList) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
this.currentFile = file;
|
||||
},
|
||||
|
||||
// 移除文件处理(已注释,保留但不使用)
|
||||
handleRemove(file, fileList) {
|
||||
// 移除照片
|
||||
},
|
||||
|
||||
// 跳转到登录页面
|
||||
handleLogin() {
|
||||
this.$router.push({ name: "Login" });
|
||||
@ -496,7 +368,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
// 第二步:进行表单验证(只验证手机号和验证码)
|
||||
// 第二步:进行表单验证
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
// 表单验证通过,开始注册流程
|
||||
@ -505,16 +377,22 @@ export default {
|
||||
// 第三步:构建注册数据
|
||||
const registerData = {
|
||||
mobile: this.registForm.mobile, // 手机号(必填)
|
||||
smsCode: this.registForm.smsCode, // 验证码(必填)
|
||||
username: this.registForm.username, // 账户名(非必填)
|
||||
password: this.registForm.password, // 密码(非必填)
|
||||
wechat_openid: this.registForm.wechat_openid, // 微信openid
|
||||
domain_name: this.photosUrl ? this.photosUrl.domain_name : '' // 域名
|
||||
vcode: this.registForm.vcode, // 验证码(必填)
|
||||
codeid: this.codeid, // 短信接口返回的codeid(必填)
|
||||
org_type: "2", // 机构类型(必填,固定为2)
|
||||
username: this.registForm.username || this.registForm.mobile, // 用户名(默认手机号)
|
||||
password: this.registForm.password, // 密码
|
||||
nick_name: this.registForm.mobile, // 显示名(默认手机号)
|
||||
wechat_openid: this.registForm.wechat_openid, // 微信openid(默认为空)
|
||||
domain_name: this.registForm.domain_name || window.location.hostname // 域名
|
||||
};
|
||||
|
||||
console.log('注册参数:', registerData);
|
||||
|
||||
// 第四步:调用注册API
|
||||
registerUserAPI(registerData).then((res) => {
|
||||
register(registerData).then((res) => {
|
||||
this.loading = false;
|
||||
console.log('注册返回:', res);
|
||||
if (res.status == true) {
|
||||
// 注册成功
|
||||
this.$message({
|
||||
@ -526,12 +404,13 @@ export default {
|
||||
} else {
|
||||
// 注册失败,显示错误信息
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
message: res.message || res.msg || "注册失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
}).catch((error) => {
|
||||
// 网络错误处理
|
||||
console.error('注册失败:', error);
|
||||
this.loading = false;
|
||||
this.$message({
|
||||
message: "注册失败,请重试",
|
||||
@ -547,22 +426,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 将对象转换为FormData格式(已注释,保留但不使用)
|
||||
getFormData(object) {
|
||||
const formData = new FormData();
|
||||
Object.keys(object).forEach((key) => {
|
||||
const value = object[key];
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((subValue, i) => {
|
||||
formData.append(key + `[${i}]`, subValue);
|
||||
});
|
||||
} else {
|
||||
formData.append(key, object[key]);
|
||||
}
|
||||
});
|
||||
return formData;
|
||||
},
|
||||
},
|
||||
|
||||
// 组件销毁前清理定时器
|
||||
@ -596,7 +459,7 @@ $light-gray: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
// 头部图标样式 - 与登录页面保持一致
|
||||
// 头部图标样式
|
||||
.logo-top {
|
||||
width: 200px !important;
|
||||
height: 70px !important;
|
||||
@ -771,9 +634,13 @@ $light-gray: #909399;
|
||||
background: rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
&.disabled {
|
||||
color: $light-gray;
|
||||
cursor: not-allowed;
|
||||
|
||||
&:hover {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -18,12 +18,12 @@ export function getHomePath() {
|
||||
!url_link.includes('/domain/')) {
|
||||
|
||||
if (domain_url.includes('ncmatch') || domain_url.includes('9527')) {
|
||||
homePath = '/ncmatchHome/index'
|
||||
homePath = '/homePage/index'
|
||||
} else if (domain_url.includes('kaiyuancloud') || domain_url.includes('opencomputing') || domain_url.includes('localhost')) {
|
||||
homePath = '/homePage/index'
|
||||
}
|
||||
}else if(url_link.includes('ncmatch')){
|
||||
homePath = '/ncmatchHome/index'
|
||||
homePath = '/homePage/index'
|
||||
}else{
|
||||
homePath = '/homePage/index'
|
||||
}
|
||||
|
||||