This commit is contained in:
hrx 2025-11-11 15:10:20 +08:00
parent f702d39c5b
commit bf19a7b14d
22 changed files with 1965 additions and 745 deletions

View File

@ -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,
})
}

View File

@ -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" },
// },
// // 订单管理
// // {
// // 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" },
// },
// 个人中心
{
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" },
},
// // 资源示例
// 资源示例
// // 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",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff

View File

@ -191,6 +191,7 @@ export default Vue.extend({
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #f6f8fd;
}

View File

@ -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">
@ -37,15 +37,15 @@
<span class="spec-label">网卡:</span>
<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>
<div v-if="item.cart_flag!=='1'" class="spec-item">
<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">
<div v-if="item.cart_flag!=='1'" class="spec-item">
<span class="spec-label">相关参数:</span>
<span class="spec-value showText">{{ item.related_parameters }}</span>
</div>
<div v-if="item.cart_flag!=='1'" class="spec-item">
<div v-if="item.cart_flag!=='1'" class="spec-item">
<span class="spec-label">应用场景:</span>
<span class="spec-value showText">{{ item.application_scenario }}</span>
</div>
@ -59,16 +59,16 @@
<span @click="openDetail(item)" class="detail-btn">
详情 <i v-if="loadingStates[item.id]" class="el-icon-loading"></i> <span v-else>>></span>
</span>
<span
:style="{ color: item.favorite === '1' ? 'red' : 'green' }"
<span
:style="{ color: item.favorite === '1' ? 'red' : 'green' }"
@click="collect(item)"
class="detail-btn"
style="cursor: pointer;"
>
{{ item.favorite === '1' ? '取消收藏' : '收藏' }}
<i v-if="collectLoadingStates[item.id]" class="el-icon-loading"></i>
<i
v-else
<i
v-else
:class="item.favorite === '1' ? 'el-icon-star-off' : 'el-icon-star-on'"
style="width: 14px;height: 14px;margin-left: 2px;"
></i>
@ -120,16 +120,16 @@
<span @click="openDetail(item)" class="detail-btn">
详情 <i v-if="loadingStates[item.id]" class="el-icon-loading"></i> <span v-else>>></span>
</span>
<span
:style="{ color: item.favorite === '1' ? 'red' : 'green' }"
<span
:style="{ color: item.favorite === '1' ? 'red' : 'green' }"
@click="collect(item)"
class="detail-btn"
style="cursor: pointer;"
>
{{ item.favorite === '1' ? '取消收藏' : '收藏' }}
<i v-if="collectLoadingStates[item.id]" class="el-icon-loading"></i>
<i
v-else
<i
v-else
:class="item.favorite === '1' ? 'el-icon-star-off' : 'el-icon-star-on'"
style="width: 14px;height: 14px;margin-left: 2px;"
></i>
@ -221,18 +221,18 @@ export default {
}else if(this.contentType === 'favorite'){
this.deleteFavorite(item);
}
// reqPublishProductDelete({
// id:item.id,
// }).then(res=>{
// console.log("",res);
// })
},
},
collect(item){
this.$set(this.collectLoadingStates, item.id, true);
// /
if(item.favorite=='1'){
reqFavoriteDelete({
id:item.productid?item.productid:item.id,
}).then(res=>{
@ -261,7 +261,7 @@ export default {
}
})
}
},
openTalk() {
this.$store.commit('setShowTalk', true);
@ -272,7 +272,7 @@ export default {
id:item.productid?item.productid:item.id,
from:'f'
}).then(res => {
if(res.status){
this.$store.commit('SETPRODUCTDETAIL', res.data);
this.$store.commit('SHOWPRODUCTDETAIL', true);
@ -282,52 +282,60 @@ export default {
this.$set(this.loadingStates, item.id, false);
}
})
}
}
}
</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;
@ -445,22 +453,73 @@ export default {
white-space: nowrap;
}
.delete-btn {
display: flex;
align-items: center;
justify-content: flex-start;
font-size: 14px;
color: #e74c3c;
cursor: pointer;
width: fit-content;
white-space: nowrap;
&.loading {
cursor: not-allowed;
opacity: 0.7;
}
}
.delete-btn {
display: flex;
align-items: center;
justify-content: flex-start;
font-size: 14px;
color: #e74c3c;
cursor: pointer;
width: fit-content;
white-space: nowrap;
&.loading {
cursor: not-allowed;
opacity: 0.7;
}
}
}
}
}
</style>
//
@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>

View File

@ -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) {
//

View File

@ -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>

View File

@ -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;
}
// 使APImobileaction_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;
}
// 使APImobileaction_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 {

View 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 [];
// activeSubIdsubItem 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) {
// 使IDID
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>

View File

@ -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
});
}

View File

@ -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",
};
//
this.$message({
message: "验证码已发送",
type: "success",
});
//
this.startCountdown();
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;
}
}
}

View File

@ -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'
}