From ad83188c6ff8b697abda2bd3a648df7d7d3d47df Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 11 Sep 2025 16:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=20=E4=BA=A7=E5=93=81=E4=B8=AD=E5=BF=83=E7=AD=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/login.js | 92 +- src/api/publicService/productCenter.js | 10 +- src/components/ImagePreview/index.vue | 4 +- src/plugins/modal.js | 158 +-- src/store/modules/user.js | 261 ++-- src/utils/configure.js | 23 + src/utils/sm.js | 50 + .../components/addAndEditForm.vue | 12 +- src/views/login.vue | 42 +- .../components/card-container.vue | 134 ++ .../components/case-container.vue | 141 +++ .../publicService/productCenter/index.vue | 267 ++-- .../productCenter/product-detail-old.vue | 1113 +++++++++++++++++ .../productCenter/product-detail.vue | 214 +--- 15 files changed, 1967 insertions(+), 555 deletions(-) create mode 100644 src/utils/configure.js create mode 100644 src/utils/sm.js create mode 100644 src/views/publicService/productCenter/components/card-container.vue create mode 100644 src/views/publicService/productCenter/components/case-container.vue create mode 100644 src/views/publicService/productCenter/product-detail-old.vue diff --git a/package.json b/package.json index f0981b9..95e7d54 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "nprogress": "0.2.0", "quill": "2.0.2", "screenfull": "5.0.2", + "sm-crypto": "^0.3.13", "sortablejs": "1.10.2", "splitpanes": "2.4.1", "vue": "2.6.12", diff --git a/src/api/login.js b/src/api/login.js index 7b7388f..6a29d3b 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,60 +1,70 @@ import request from '@/utils/request' // 登录方法 -export function login(username, password, code, uuid) { - const data = { - username, - password, - code, - uuid - } - return request({ - url: '/login', - headers: { - isToken: false, - repeatSubmit: false - }, - method: 'post', - data: data - }) +export function login(username, password, code, uuid, loginType) { + const data = { + username, + password, + code, + uuid, + loginType, + } + return request({ + url: '/login', + headers: { + isToken: false, + repeatSubmit: false, + }, + method: 'post', + data: data, + }) } // 注册方法 export function register(data) { - return request({ - url: '/register', - headers: { - isToken: false - }, - method: 'post', - data: data - }) + return request({ + url: '/register', + headers: { + isToken: false, + }, + method: 'post', + data: data, + }) } // 获取用户详细信息 export function getInfo() { - return request({ - url: '/getInfo', - method: 'get' - }) + return request({ + url: '/getInfo', + method: 'get', + }) } // 退出方法 export function logout() { - return request({ - url: '/logout', - method: 'post' - }) + return request({ + url: '/logout', + method: 'post', + }) } // 获取验证码 export function getCodeImg() { - return request({ - url: '/captchaImage', - headers: { - isToken: false - }, - method: 'get', - timeout: 20000 - }) -} \ No newline at end of file + return request({ + url: '/captchaImage', + headers: { + isToken: false, + }, + method: 'get', + timeout: 20000, + }) +} + +// 获取短信验证码 +export function getPhoneCodeApi(data) { + return request({ + url: '/sendPhone', + method: 'POST', + data, + }) +} diff --git a/src/api/publicService/productCenter.js b/src/api/publicService/productCenter.js index 1331a31..890c977 100644 --- a/src/api/publicService/productCenter.js +++ b/src/api/publicService/productCenter.js @@ -1,5 +1,4 @@ import request from '@/utils/request' -import request_formdata from '@/utils/request_formdata' // 查询产品中心列表 export function getProductCenterListAPI(data) { @@ -9,3 +8,12 @@ export function getProductCenterListAPI(data) { data, }) } + +// 查询产品中心详情 +export function getProductCenterDetailAPI(data) { + return request({ + url: '/product/screen/getProductDetails', + method: 'POST', + data, + }) +} diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index fdc0d60..c9892dd 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -81,9 +81,9 @@ export default { diff --git a/src/views/publicService/productCenter/components/case-container.vue b/src/views/publicService/productCenter/components/case-container.vue new file mode 100644 index 0000000..02285da --- /dev/null +++ b/src/views/publicService/productCenter/components/case-container.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/src/views/publicService/productCenter/index.vue b/src/views/publicService/productCenter/index.vue index dc31dbc..3180a04 100644 --- a/src/views/publicService/productCenter/index.vue +++ b/src/views/publicService/productCenter/index.vue @@ -6,13 +6,13 @@ @@ -22,9 +22,7 @@
@@ -33,8 +31,12 @@

{{ item.name }}

@@ -57,152 +59,91 @@ import { getProductCenterListAPI } from '@/api/publicService/productCenter' export default { name: 'ProductCenter', + dicts: ['tb_product_type'], data() { return { - activeNav: 'products', - activeCategory: 'all', - searchKeyword: '', - hoveredCard: null, - apiBase: process.env.VUE_APP_BASE_API, - navItems: [ - { - key: 'products', - label: '产品中心', - icon: '/img/psp/productCenter/products.png', - }, - { - key: 'components', - label: '公共组件', - icon: '/img/psp/productCenter/components.png', - }, - { - key: 'materials', - label: '宣传物料', - icon: '/img/psp/productCenter/materials.png', - }, - { - key: 'docs', - label: '文档中心', - icon: '/img/psp/productCenter/docs.png', - }, - ], - categories: [ - { key: 'all', label: '全部' }, - { key: 'smart', label: '智慧基建' }, - { key: 'system', label: '智慧后勤' }, - { key: 'safety', label: '数智安监' }, - ], - services: [ - { - id: 1, - title: '绿智食堂', - image: '/profile/avatar/2025/09/03/001_20250903132300A001.JPG', - category: 'smart', - description: '智能化食堂管理系统', - }, - { - id: 2, - title: '智能机具管理系统', - image: '/placeholder.svg?height=200&width=300', - category: 'system', - description: '设备智能化管理平台', - }, - { - id: 3, - title: '智慧楼宇', - image: '/placeholder.svg?height=200&width=300', - category: 'smart', - description: '楼宇智能化控制系统', - }, - { - id: 4, - title: '产业工人实名制', - image: '/placeholder.svg?height=200&width=300', - category: 'system', - description: '工人身份认证管理', - }, - { - id: 5, - title: '安全质量智慧决策中心', - image: '/placeholder.svg?height=200&width=300', - category: 'safety', - description: '安全质量智能决策平台', - }, - { - id: 6, - title: '智慧工地', - image: '/placeholder.svg?height=200&width=300', - category: 'smart', - description: '工地智能化管理系统', - }, - { - id: 7, - title: 'VR警示教育室', - image: '/placeholder.svg?height=200&width=300', - category: 'safety', - description: 'VR安全教育培训系统', - }, - { - id: 8, - title: '应急智中心建设', - image: '/placeholder.svg?height=200&width=300', - category: 'safety', - description: '应急响应智能化中心', - }, - ], - + activeTypeValue: 'all', // 当前激活的分类 + leftMenuList: [], // 左侧菜单列表 productListAll: [], // 所有产品列表 + showProductList: [], // 需要显示的产品列表 } }, - computed: { - filteredServices() { - // let filtered = this.services - // // 按分类筛选 - // if (this.activeCategory !== 'all') { - // filtered = filtered.filter( - // (service) => service.category === this.activeCategory, - // ) - // } - // // 按搜索关键词筛选 - // if (this.searchKeyword.trim()) { - // const keyword = this.searchKeyword.toLowerCase() - // filtered = filtered.filter( - // (service) => - // service.title.toLowerCase().includes(keyword) || - // service.description.toLowerCase().includes(keyword), - // ) - // } - // return filtered - }, - }, + created() { this.getProductCenterListInScreenFun() }, + mounted() { + // 监听字典数据加载完成事件 + this.$on('dictReady', (dict) => { + this.initLeftMenuList() + }) + + // 如果字典数据已经加载完成,直接初始化 + if (this.dict && this.dict.type && this.dict.type.tb_product_type) { + this.initLeftMenuList() + } + }, methods: { - handleNavChange(navKey) { - this.activeNav = navKey - // 可以根据导航项做页面跳转或其他操作 - }, + // 初始化左侧菜单列表 + initLeftMenuList() { + try { + if ( + this.dict && + this.dict.type && + this.dict.type.tb_product_type + ) { + // 清空现有菜单 + this.leftMenuList = [ + { + label: '全部', + value: 'all', + }, + ] + // 添加字典数据到菜单 + this.dict.type.tb_product_type.forEach((item) => { + this.leftMenuList.push({ + label: item.label, + value: item.value, + }) + }) + } + } catch (error) {} + }, + // 访问演示地址 handleDemo(service) { - window.open(service.link, '_blank') - }, - // 在 index.vue 中的 handleDetail 方法 - handleDetail(service) { - // console.log('查看详情:', service.title) - // this.$router.push({ - // name: 'ProductDetail', - // params: { id: service.id }, - // }) + if (service.isAccess == 0) { + this.$modal.msgWarning('该产品不支持访问') + return + } + // 确保 URL 是完整的绝对路径 + let url = service.linkUrl + // 如果 URL 不是以 http:// 或 https:// 开头,则添加 https:// + if (!url.startsWith('http://') && !url.startsWith('https://')) { + // 如果 URL 以 www. 开头,直接添加 https:// + if (url.startsWith('www.')) { + url = 'https://' + url + } else { + // 其他情况,添加 https:// + url = 'https://' + url + } + } + + window.open(url, '_blank') + }, + // 查看详情 + handleDetail(service) { this.$router.push({ name: 'ProductDetail', params: { id: service.id }, }) }, + // 鼠标悬浮 handleCardHover(serviceId) { this.hoveredCard = serviceId }, + // 鼠标离开 handleCardLeave() { this.hoveredCard = null }, @@ -210,10 +151,21 @@ export default { // 获取产品列表 async getProductCenterListInScreenFun() { const res = await getProductCenterListAPI({}) - - console.log(res, 'res') this.productListAll = res.data - // this.services = res.data + this.showProductList = this.productListAll + }, + }, + + // 监听分类变化 + watch: { + activeTypeValue(newVal) { + if (newVal === 'all') { + this.showProductList = this.productListAll + } else { + this.showProductList = this.productListAll.filter( + (item) => item.typeId === newVal, + ) + } }, }, } @@ -364,7 +316,7 @@ export default { .services-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + grid-template-columns: repeat(4, 1fr); gap: 20px; } @@ -427,26 +379,45 @@ export default { font-size: 12px; cursor: pointer; transition: all 0.2s ease; - border: 1px solid transparent; + border: none; flex: 1; text-align: center; } .btn-primary { - background-color: #4a90e2; + // background-color: #4a90e2; color: white; - border-color: #4a90e2; + // border-color: #4a90e2; + + background: linear-gradient(180deg, #00c7ef 0%, #005eef 100%); +} + +.isDisabled { + background-color: #ccc; + color: #fff; + border-color: #ccc; + cursor: not-allowed; } .btn-primary:hover { - background-color: #357abd; - border-color: #357abd; + // background-color: #357abd; + // border-color: #357abd; + background: linear-gradient(180deg, #00c7ef 0%, #005eef 100%); } .btn-outline { background-color: transparent; color: #4a90e2; - border-color: #4a90e2; + // border-color: #4a90e2; + + // border-image: linear-gradient( + // 180deg, + // rgba(0, 199, 239, 1), + // rgba(0, 94, 239, 1) + // ) + // 1 1; + + border: 1px solid #00c7ef; } .btn-outline:hover { @@ -475,6 +446,12 @@ export default { width: 100%; } + .services-grid { + grid-template-columns: repeat(2, 1fr); + } +} + +@media (max-width: 480px) { .services-grid { grid-template-columns: 1fr; } diff --git a/src/views/publicService/productCenter/product-detail-old.vue b/src/views/publicService/productCenter/product-detail-old.vue new file mode 100644 index 0000000..fa3d81c --- /dev/null +++ b/src/views/publicService/productCenter/product-detail-old.vue @@ -0,0 +1,1113 @@ + + + + + diff --git a/src/views/publicService/productCenter/product-detail.vue b/src/views/publicService/productCenter/product-detail.vue index a664aa7..1bbfaa4 100644 --- a/src/views/publicService/productCenter/product-detail.vue +++ b/src/views/publicService/productCenter/product-detail.vue @@ -17,7 +17,7 @@
- 产品介绍 + 产品介绍
@@ -25,171 +25,33 @@

- 基于移动互联网(微信、APP),整合所有数据资源(在线订餐、充值、点评),由内到外的为学校师生提供便民服务,深度定制餐厅、校 - 本文档精准、适用于智慧食堂数据资源,通过设备、消费设备、自助充值、智慧收银、零售管理、多样化计 - 方式),致力提升学校整体服务和管理的能力,打造名副其实与时俱进的互联网餐厅。 + {{ productDetail.introduction }}

- -
-
-

宣传手册

- 查看更多 -
- -
- - -
-
-

宣传视频

- 查看更多 -
- - -
- - -
-
-

产品案例

- 查看更多 -
- -
+ + + +