Index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <DefaultLayout>
  3. <!-- banner -->
  4. <section class="banner-section">
  5. <img src="@assets/cases-banner.png" alt="" srcset="">
  6. </section>
  7. <!-- 智慧解决方案 -->
  8. <section class="smart-solutions">
  9. <div class="container">
  10. <!-- 标题区域 -->
  11. <div class="title-section">
  12. <h2 class="main-title">智慧解决方案</h2>
  13. <p class="sub-title">SMART SOLUTION</p>
  14. <p class="description">智慧管理系统采用先进的开发技术,为智慧产业提供一站式解决方案</p>
  15. </div>
  16. <!-- 解决方案列表 -->
  17. <div class="solutions-grid">
  18. <div v-for="solution in visibleSolutions" :key="solution.id" @click="goToCaseDetail(solution)"
  19. class="solution-card">
  20. <div class="card-image">
  21. <img :src="solution.image" :alt="solution.title" />
  22. </div>
  23. <div class="card-content">
  24. <h3 class="card-title">{{ solution.title }}</h3>
  25. <p class="card-description">{{ solution.description }}</p>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- 切换按钮 -->
  30. <div class="navigation-buttons">
  31. <button class="nav-btn prev-btn" :class="{ disabled: currentPage === 0 }" @click="prevPage"
  32. :disabled="currentPage === 0">
  33. <img src="@assets/slide-arrow-left.png" alt="上一页" />
  34. </button>
  35. <button class="nav-btn next-btn" :class="{ disabled: currentPage >= maxPage }" @click="nextPage"
  36. :disabled="currentPage >= maxPage">
  37. <img src="@assets/slide-arrow-right.png" alt="下一页" />
  38. </button>
  39. </div>
  40. </div>
  41. </section>
  42. <!-- 更多案例 -->
  43. <section class="more-cases">
  44. <div class="container">
  45. <!-- 标题区域 -->
  46. <div class="title-section">
  47. <h2 class="main-title">更多案例</h2>
  48. <p class="sub-title">MORE CASES</p>
  49. </div>
  50. <!-- 案例列表 -->
  51. <div class="cases-list">
  52. <div v-for="(caseItem, caseIndex) in casesList" :key="caseItem.id" class="case-item"
  53. :class="{ 'fifth-row': Math.floor(caseIndex / 2) === 4 }" @click="goToCaseDetail(caseItem)">
  54. <div class="case-content">
  55. <h3 class="case-title">{{ caseItem.title }}</h3>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </section>
  61. </DefaultLayout>
  62. </template>
  63. <script>
  64. import { ref, computed, onMounted } from 'vue'
  65. import { getProjectClassifyList, getProjectList } from '@/api/modules/home'
  66. import { useRouter } from 'vue-router'
  67. import DefaultLayout from '@/layouts/DefaultLayout.vue'
  68. export default {
  69. name: 'ProductsPage',
  70. components: {
  71. DefaultLayout
  72. },
  73. setup() {
  74. const router = useRouter()
  75. // 环境变量
  76. const imgHost = import.meta.env.VITE_APP_IMG_HOST || ''
  77. const currentPage = ref(0)
  78. const itemsPerPage = 6 // 每页显示6个(2行 × 3列)
  79. // 解决方案数据
  80. let solutions = ref([
  81. {
  82. id: 1,
  83. title: '智慧农业(种植+养殖)',
  84. description: '通过物联网设备和数据分析,实现精准农业管理,提高农业生产效率和产品质量。',
  85. image: '/src/assets/products-youshi-01.png'
  86. },
  87. {
  88. id: 2,
  89. title: '智慧停车',
  90. description: '通过智能化停车管理系统,实现停车位的智能分配和管理,提升停车效率。',
  91. image: '/src/assets/products-youshi-02.png'
  92. },
  93. {
  94. id: 3,
  95. title: '数据服务系统',
  96. description: '为政府部门提供数据整合、分析和可视化服务,支持科学决策和管理优化。',
  97. image: '/src/assets/products-youshi-03.png'
  98. },
  99. {
  100. id: 4,
  101. title: '景区一码游系统',
  102. description: '通过移动互联网技术,为游客提供便捷的景区服务,提升旅游体验。',
  103. image: '/src/assets/products-youshi-04.png'
  104. },
  105. {
  106. id: 5,
  107. title: '智慧林场',
  108. description: '通过物联网和大数据技术,实现森林资源的智能监管和保护。',
  109. image: '/src/assets/products-youshi-05.png'
  110. },
  111. {
  112. id: 6,
  113. title: '森林防火',
  114. description: '利用先进的监测技术和预警系统,实现森林火灾的早期发现和快速响应。',
  115. image: '/src/assets/products-youshi-06.png'
  116. },
  117. {
  118. id: 7,
  119. title: '智慧城市',
  120. description: '构建智慧城市管理平台,实现城市运行的智能化监管和服务。',
  121. image: '/src/assets/products-youshi-01.png'
  122. },
  123. {
  124. id: 8,
  125. title: '智慧医疗',
  126. description: '通过数字化技术提升医疗服务质量,实现医疗资源的优化配置。',
  127. image: '/src/assets/products-youshi-02.png'
  128. }
  129. ])
  130. // 更多案例数据
  131. let casesList = ref([
  132. { id: 1, title: '海南教育局大数据中心建设项目' },
  133. { id: 2, title: '贵阳某龙新区疫情网络安全监测项目' },
  134. { id: 3, title: '六盘水区民法院网络安全项目' },
  135. { id: 4, title: '某某人民银行' },
  136. { id: 5, title: '阿里大数据中心项目' },
  137. { id: 6, title: '贵阳市花溪区大学城项目' },
  138. { id: 7, title: '修文县商务局' },
  139. { id: 8, title: '贵州某通信集团公司综合考核管理系统项目' },
  140. { id: 9, title: '贵州省金沙开发区政务子信息产业园区15栋' },
  141. { id: 10, title: '六盘水市人民法院网络安全项目' },
  142. { id: 11, title: '贵州大学中科院学子化学院项目' },
  143. { id: 12, title: '修文县商务局' },
  144. { id: 13, title: '贵州某通信集团公司综合考核管理系统项目' },
  145. { id: 14, title: '贵州省金沙开发区政务子信息产业园区' },
  146. { id: 15, title: '六盘水市人民法院网络安全项目' },
  147. { id: 16, title: '兴义安龙县法院网络安全' },
  148. { id: 17, title: '贵阳市人力资源大数据智能化' },
  149. { id: 18, title: '贵州省食药监药品监管智能化项目智能化' },
  150. { id: 19, title: '兴义安龙县正式网络安全工程' },
  151. { id: 20, title: '兴义安龙县法院网络安全工程' }
  152. ])
  153. // 跳转到案例详情页
  154. const goToCaseDetail = (caseItem) => {
  155. console.log('跳转到案例详情页caseItem',caseItem)
  156. router.push({
  157. name: 'Casesdetails',
  158. query: { id: caseItem.id,classifyId:caseItem.classifyId }
  159. })
  160. }
  161. // 计算当前页显示的解决方案
  162. const visibleSolutions = computed(() => {
  163. const start = currentPage.value * itemsPerPage
  164. const end = start + itemsPerPage
  165. return solutions.value.slice(start, end)
  166. })
  167. // 计算最大页数
  168. const maxPage = computed(() => {
  169. return Math.ceil(solutions.value.length / itemsPerPage) - 1
  170. })
  171. // 上一页
  172. const prevPage = () => {
  173. if (currentPage.value > 0) {
  174. currentPage.value--
  175. }
  176. }
  177. // 下一页
  178. const nextPage = () => {
  179. if (currentPage.value < maxPage.value) {
  180. currentPage.value++
  181. }
  182. }
  183. // API调用方法
  184. const loadProductsData = async () => {
  185. try {
  186. // 获取产品分类列表 (用于solutions)
  187. // const classifyData = await getProjectClassifyList({ classifyType: 1 })
  188. // console.log('产品分类数据:', classifyData)
  189. // if (classifyData && classifyData.rows && classifyData.rows.length > 0) {
  190. // // 更新solutions数据
  191. // solutions.value = classifyData.rows.map(item => ({
  192. // id: item.id,
  193. // title: item.classifyName,
  194. // description: item.classifyDesc || '为您提供专业的解决方案',
  195. // image: item.projectImage ? imgHost + item.projectImage : '/src/assets/products-youshi-01.png'
  196. // }))
  197. // }
  198. // 获取案例列表 (用于casesList)
  199. const casesData = await getProjectList({ projectType: 2 })
  200. console.log('案例数据:', casesData)
  201. if (casesData && casesData.rows && casesData.rows.length > 0) {
  202. // 更新casesList数据
  203. casesList.value = casesData.rows.map(item => ({
  204. id: item.id,
  205. title: item.projectName || item.title
  206. }))
  207. // 更新solutions数据
  208. solutions.value = casesData.rows.map(item => ({
  209. id: item.id,
  210. classifyId:item.classifyId,
  211. title: item.classifyName,
  212. description: item.classifyDesc || '为您提供专业的解决方案',
  213. image: item.projectImage ? imgHost + item.projectImage : '/src/assets/products-youshi-01.png'
  214. }))
  215. }
  216. } catch (error) {
  217. console.error('加载产品数据失败:', error)
  218. }
  219. }
  220. onMounted(() => {
  221. loadProductsData()
  222. })
  223. return {
  224. currentPage,
  225. solutions,
  226. visibleSolutions,
  227. maxPage,
  228. prevPage,
  229. nextPage,
  230. casesList,
  231. goToCaseDetail
  232. }
  233. }
  234. }
  235. </script>
  236. <style lang="scss" scoped>
  237. // banner区域
  238. .banner-section {
  239. position: relative;
  240. img {
  241. width: 100%;
  242. }
  243. }
  244. // 智慧解决方案区域
  245. .smart-solutions {
  246. padding: 80px 0;
  247. background: url('@assets/cases-bg-01.png') center/cover no-repeat;
  248. position: relative;
  249. .container {
  250. margin: 0 auto;
  251. padding: 0 20px;
  252. position: relative;
  253. z-index: 2;
  254. }
  255. .title-section {
  256. text-align: center;
  257. margin-bottom: 60px;
  258. .main-title {
  259. font-size: 42px;
  260. font-weight: bold;
  261. color: #333;
  262. margin-bottom: 10px;
  263. position: relative;
  264. display: inline-block;
  265. }
  266. .sub-title {
  267. font-size: 16px;
  268. color: #999;
  269. margin-bottom: 20px;
  270. letter-spacing: 2px;
  271. font-weight: 500;
  272. }
  273. .description {
  274. font-size: 16px;
  275. color: #333;
  276. line-height: 1.6;
  277. max-width: 600px;
  278. margin: 0 auto;
  279. }
  280. }
  281. .solutions-grid {
  282. display: grid;
  283. grid-template-columns: repeat(3, 1fr);
  284. grid-template-rows: repeat(2, 1fr);
  285. gap: 30px;
  286. margin-bottom: 50px;
  287. }
  288. .solution-card {
  289. background: #fff;
  290. border-radius: 8px;
  291. overflow: hidden;
  292. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  293. transition: transform 0.3s ease, box-shadow 0.3s ease;
  294. &:hover {
  295. transform: translateY(-5px);
  296. box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  297. }
  298. .card-image {
  299. height: 282px;
  300. overflow: hidden;
  301. img {
  302. width: 100%;
  303. height: 100%;
  304. object-fit: contain;
  305. transition: transform 0.3s ease;
  306. }
  307. }
  308. &:hover .card-image img {
  309. transform: scale(1.05);
  310. }
  311. .card-content {
  312. padding: 20px;
  313. .card-title {
  314. font-size: 24px;
  315. font-weight: bold;
  316. color: #333;
  317. margin-bottom: 10px;
  318. text-align: center;
  319. }
  320. .card-description {
  321. font-size: 16px;
  322. color: #666;
  323. line-height: 1.6;
  324. text-align: center;
  325. }
  326. }
  327. }
  328. .navigation-buttons {
  329. display: flex;
  330. justify-content: center;
  331. gap: 20px;
  332. .nav-btn {
  333. width: 50px;
  334. height: 50px;
  335. border: none;
  336. background: #fff;
  337. border-radius: 50%;
  338. cursor: pointer;
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  343. transition: all 0.3s ease;
  344. &:hover:not(.disabled) {
  345. transform: translateY(-2px);
  346. box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  347. }
  348. &.disabled {
  349. opacity: 0.3;
  350. cursor: not-allowed;
  351. }
  352. img {
  353. width: 20px;
  354. height: 20px;
  355. }
  356. }
  357. }
  358. // 响应式设计
  359. @media (max-width: 768px) {
  360. padding: 60px 0;
  361. .title-section {
  362. .main-title {
  363. font-size: 32px;
  364. }
  365. }
  366. .solutions-grid {
  367. grid-template-columns: 1fr;
  368. grid-template-rows: repeat(6, 1fr);
  369. gap: 20px;
  370. }
  371. .solution-card {
  372. .card-image {
  373. height: 150px;
  374. }
  375. }
  376. }
  377. @media (max-width: 1024px) and (min-width: 769px) {
  378. .solutions-grid {
  379. grid-template-columns: repeat(2, 1fr);
  380. grid-template-rows: repeat(3, 1fr);
  381. }
  382. }
  383. }
  384. // 更多案例区域
  385. .more-cases {
  386. padding: 80px 0;
  387. background: #fff;
  388. position: relative;
  389. &::before {
  390. position: absolute;
  391. content: '';
  392. left: 0;
  393. right: 0;
  394. top: 0;
  395. bottom: -138px;
  396. background: url('@assets/cases-bg-02.png') no-repeat center center;
  397. background-size: cover;
  398. }
  399. .container {
  400. position: relative;
  401. margin: 0 auto;
  402. padding: 0 20px;
  403. }
  404. .title-section {
  405. text-align: center;
  406. margin-bottom: 60px;
  407. .main-title {
  408. font-size: 42px;
  409. font-weight: bold;
  410. color: #333;
  411. margin-bottom: 10px;
  412. position: relative;
  413. display: inline-block;
  414. }
  415. .sub-title {
  416. font-size: 16px;
  417. color: #999;
  418. margin-bottom: 20px;
  419. letter-spacing: 2px;
  420. font-weight: 500;
  421. }
  422. }
  423. .cases-list {
  424. display: grid;
  425. grid-template-columns: repeat(2, 1fr);
  426. gap: 25px 40px;
  427. padding: 68px 164px;
  428. background-color: rgba(255, 255, 255, 0.3);
  429. backdrop-filter: blur(8px);
  430. border-radius: 16px;
  431. .case-item {
  432. background: transparent;
  433. border: none;
  434. cursor: pointer;
  435. transition: all 0.3s ease;
  436. &:hover {
  437. background: rgba(74, 144, 226, 0.05);
  438. border-radius: 4px;
  439. }
  440. &:hover .case-title {
  441. color: #4a90e2;
  442. }
  443. // 第五行特殊样式
  444. &.fifth-row {
  445. margin-bottom: 20px;
  446. }
  447. .case-content {
  448. text-align: left;
  449. .case-title {
  450. font-size: 16px;
  451. font-weight: 500;
  452. color: #333;
  453. margin-bottom: 0;
  454. line-height: 1.4;
  455. display: flex;
  456. align-items: center;
  457. &:before {
  458. content: '•';
  459. color: #4a90e2;
  460. font-size: 20px;
  461. margin-right: 10px;
  462. line-height: 1;
  463. }
  464. }
  465. }
  466. }
  467. }
  468. // 响应式设计
  469. @media (max-width: 768px) {
  470. padding: 60px 0;
  471. .title-section {
  472. .main-title {
  473. font-size: 32px;
  474. }
  475. }
  476. .cases-list {
  477. grid-template-columns: 1fr;
  478. gap: 20px;
  479. .case-item {
  480. padding: 12px 0;
  481. margin-bottom: 10px;
  482. &:hover {
  483. padding: 12px 8px;
  484. }
  485. &.fifth-row {
  486. margin-bottom: 30px;
  487. }
  488. }
  489. }
  490. }
  491. }
  492. </style>