Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-12-12 14:25:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d29c4a14cb3b253566549fd527c0d361b21c0bcb
d29c4a14
1 parent
662a9e10
解决方案详情路由调整
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
38 deletions
src/components/common/hagerFooter.vue
src/route.js
src/views/index.vue
src/views/search.vue
src/views/solution/case.vue
src/views/solution/detail.vue
src/views/solution/index.vue
src/components/common/hagerFooter.vue
View file @
d29c4a1
<!--
* @Date: 2024-09-26 13:42:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-
04 11:40:52
* @LastEditTime: 2024-12-
12 14:13:11
* @FilePath: /hager/src/components/common/hagerFooter.vue
* @Description: 文件描述
-->
...
...
@@ -198,11 +198,7 @@ export default {
},
goToSolution (item) {
this.$router.push({
path: '/solution/detail',
query: {
id: item.id,
timestamp: Date.now()
}
path: `/solution/detail/${item.id}/${Date.now()}`,
});
},
goToCorp (item) {
...
...
src/route.js
View file @
d29c4a1
/*
* @Date: 2024-08-26 10:42:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
3:51:12
* @LastEditTime: 2024-12-12 1
4:03:26
* @FilePath: /hager/src/route.js
* @Description: 文件描述
*/
...
...
@@ -25,7 +25,7 @@ export default [{
children
:
[]
},
{
path
:
'/product/detail/:id'
,
name
:
'详情页'
,
name
:
'详情页
1
'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
title
:
'海格电气'
,
...
...
@@ -34,7 +34,7 @@ export default [{
children
:
[]
},
{
path
:
'/product/detail/:id/:timestamp'
,
name
:
'详情页'
,
name
:
'详情页
2
'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
title
:
'海格电气'
,
...
...
@@ -43,7 +43,7 @@ export default [{
children
:
[]
},
{
path
:
'/product/detail/:id/:category_id/:timestamp'
,
name
:
'详情页'
,
name
:
'详情页
3
'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
title
:
'海格电气'
,
...
...
@@ -60,8 +60,17 @@ export default [{
},
children
:
[]
},
{
path
:
'/solution/detail'
,
name
:
'解决方案详情'
,
path
:
'/solution/detail/:id/:timestamp'
,
name
:
'解决方案详情1'
,
component
:
()
=>
import
(
'@/views/solution/detail'
),
meta
:
{
title
:
'解决方案 | Hager China'
,
tag
:
'solution'
},
children
:
[]
},
{
path
:
'/solution/detail/:id/:current_index/:timestamp'
,
name
:
'解决方案详情2'
,
component
:
()
=>
import
(
'@/views/solution/detail'
),
meta
:
{
title
:
'解决方案 | Hager China'
,
...
...
src/views/index.vue
View file @
d29c4a1
<!--
* @Date: 2024-08-27 10:06:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
2:48:04
* @LastEditTime: 2024-12-12 1
4:14:08
* @FilePath: /hager/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -323,11 +323,7 @@ export default {
},
goToSolution (v) {
this.$router.push({
path: '/solution/detail',
query: {
id: v.id,
timestamp: Date.now()
}
path: `/solution/detail/${v.id}/${Date.now()}`,
});
},
goToProduct (v) {
...
...
src/views/search.vue
View file @
d29c4a1
<!--
* @Date: 2024-10-20 16:57:48
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
3:52:16
* @LastEditTime: 2024-12-12 1
4:14:55
* @FilePath: /hager/src/views/search.vue
* @Description: 文件描述
-->
...
...
@@ -248,10 +248,7 @@ export default {
},
goToCase (id) {
this.$router.push({
path: '/solution/detail',
query: {
id: id
}
path: `/solution/detail/${id}/${Date.now()}`,
});
},
goToSolution (v) { // 跳转产品详情
...
...
src/views/solution/case.vue
View file @
d29c4a1
...
...
@@ -157,7 +157,7 @@ export default {
},
computed: {
casePath () {
return `/solution/detail
?id=${this.success_info.category_id}¤t_index=${this.$route.query.current_index
}`;
return `/solution/detail
/${this.success_info.category_id}/${this.$route.query.current_index}/${Date.now()
}`;
}
},
watch: {
...
...
src/views/solution/detail.vue
View file @
d29c4a1
<!--
* @Date: 2024-09-29 15:49:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
3:53:39
* @LastEditTime: 2024-12-12 1
4:21:31
* @FilePath: /hager/src/views/solution/detail.vue
* @Description: 文件描述
-->
...
...
@@ -216,7 +216,7 @@ export default {
this.initialize();
},
watch: {
'$route.
query
.id' (old, val) {
'$route.
params
.id' (old, val) {
if (old !== val) {
this.initialize();
}
...
...
@@ -224,12 +224,12 @@ export default {
},
methods: {
async initialize () {
const { code, data } = await getSolutionCaseAPI({ cid: this.$route.
query
.id });
const { code, data } = await getSolutionCaseAPI({ cid: this.$route.
params
.id });
if (code) {
this.case_info = data;
this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner08.png';
this.case_list = data.list;
this.current_index = this.$route.
query.current_index ? +this.$route.query
.current_index : 0;
this.current_index = this.$route.
params.current_index ? +this.$route.params
.current_index : 0;
this.current_id = this.case_list[this.current_index]['id'];
this.success_data_list = this.case_list[this.current_index].list ?? [];
this.category_description = this.case_list[this.current_index].category_description ?? '';
...
...
@@ -250,7 +250,7 @@ export default {
},
goToProduct (v) {
this.$router.push({
path: `/product/detail/${v.id}
}
`,
path: `/product/detail/${v.id}`,
});
},
goToCase (v) {
...
...
@@ -313,11 +313,7 @@ export default {
})
// 记录点击的分类ID,用于返回定位到该分类
this.$router.push({
path: '/solution/detail',
query: {
...this.$route.query, // 先展开原来的参数
current_index: this.current_index
}
path: `/solution/detail/${this.$route.params.id}/${this.current_index}/${Date.now()}`,
});
}
}
...
...
src/views/solution/index.vue
View file @
d29c4a1
...
...
@@ -161,10 +161,7 @@ export default {
},
goToSolution (v) {
this.$router.push({
path: '/solution/detail',
query: {
id: v.id
}
path: `/solution/detail/${v.id}/${Date.now()}`,
});
},
prevSolutionBtn () {
...
...
Please
register
or
login
to post a comment