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 13:56:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
662a9e1045ac62940ce367243d151a994988d6b8
662a9e10
1 parent
084c7dae
产品详情页路由调整
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
43 deletions
src/components/accordion/AccordionItem.vue
src/components/common/hagerHeader.vue
src/components/hagerMenu.vue
src/route.js
src/views/product/detail.vue
src/views/product/index.vue
src/views/search.vue
src/views/solution/detail.vue
src/components/accordion/AccordionItem.vue
View file @
662a9e1
...
...
@@ -51,11 +51,7 @@ export default {
},
goToDetail (v) { // 跳转产品详情
this.$router.push({
path: '/product/detail',
query: {
id: v.id,
timestamp: Date.now()
}
path: `/product/detail${v.id}/${Date.now()}`,
});
}
}
...
...
src/components/common/hagerHeader.vue
View file @
662a9e1
...
...
@@ -382,12 +382,7 @@ export default {
},
goToP (item) { // 跳转产品详情
this.$router.push({
path: '/product/detail',
query: {
id: item.id,
category_id: item.category_id,
timestamp: Date.now()
}
path: `/product/detail/${item.id}/${item.category_id}/${Date.now()}`,
});
this.closeMenu();
},
...
...
src/components/hagerMenu.vue
View file @
662a9e1
<!--
* @Date: 2024-10-10 10:37:16
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 13:
39:03
* @LastEditTime: 2024-12-12 13:
50:39
* @FilePath: /hager/src/components/hagerMenu.vue
* @Description: 文件描述
-->
...
...
@@ -149,10 +149,7 @@ export default {
goToThird(id) {
this.$emit("close");
this.$router.push({
path: "/product/detail",
query: {
id: id,
},
path: `/product/detail/${id}`,
});
},
//
...
...
src/route.js
View file @
662a9e1
/*
* @Date: 2024-08-26 10:42:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 13:
38:2
2
* @LastEditTime: 2024-12-12 13:
51:1
2
* @FilePath: /hager/src/route.js
* @Description: 文件描述
*/
...
...
@@ -24,7 +24,25 @@ export default [{
},
children
:
[]
},
{
path
:
'/product/detail'
,
path
:
'/product/detail/:id'
,
name
:
'详情页'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
title
:
'海格电气'
,
tag
:
'product'
},
children
:
[]
},
{
path
:
'/product/detail/:id/:timestamp'
,
name
:
'详情页'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
title
:
'海格电气'
,
tag
:
'product'
},
children
:
[]
},
{
path
:
'/product/detail/:id/:category_id/:timestamp'
,
name
:
'详情页'
,
component
:
()
=>
import
(
'@/views/product/detail'
),
meta
:
{
...
...
src/views/product/detail.vue
View file @
662a9e1
<!--
* @Date: 2024-09-29 14:26:41
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-1
1-06 15:34:53
* @LastEditTime: 2024-1
2-12 13:54:06
* @FilePath: /hager/src/views/product/detail.vue
* @Description: 文件描述
-->
...
...
@@ -204,7 +204,7 @@ export default {
},
watch: {
// 监听路由参数变化时,更新输入框的值
async '$route.
query
.id' (val, old) {
async '$route.
params
.id' (val, old) {
if (old !== val) {
this.getInfo();
}
...
...
@@ -253,7 +253,7 @@ export default {
checked_sum: 0,
}];
this.info_images = [];
const { code, data } = await getProductInfoAPI( { id: this.$route.
query
.id });
const { code, data } = await getProductInfoAPI( { id: this.$route.
params
.id });
if (code) {
this.info = data;
this.keyword = data.post_keyword;
...
...
src/views/product/index.vue
View file @
662a9e1
<!--
* @Date: 2024-09-27 16:53:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 13:
44:08
* @LastEditTime: 2024-12-12 13:
55:31
* @FilePath: /hager/src/views/product/index.vue
* @Description: 文件描述
-->
...
...
@@ -168,11 +168,7 @@ export default {
},
goToDetail (v) { // 跳转产品详情
this.$router.push({
path: '/product/detail',
query: {
id: v.id,
category_id: this.$route.query.id
}
path: `/product/detail/${v.id}/${this.$route.params.id}/${Date.now()}`
});
},
async getAllMain () { // 查询所有产品列表数据
...
...
src/views/search.vue
View file @
662a9e1
<!--
* @Date: 2024-10-20 16:57:48
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
2:48:21
* @LastEditTime: 2024-12-12 1
3:52:16
* @FilePath: /hager/src/views/search.vue
* @Description: 文件描述
-->
...
...
@@ -243,12 +243,7 @@ export default {
},
goToDetail (v) { // 跳转产品详情
this.$router.push({
path: '/product/detail',
query: {
id: v.id,
category_id: v.category_id,
timestamp: Date.now()
}
path: `/product/detail/${v.id}/${v.category_id}/${Date.now()}`,
});
},
goToCase (id) {
...
...
@@ -261,10 +256,7 @@ export default {
},
goToSolution (v) { // 跳转产品详情
this.$router.push({
path: '/product/detail',
query: {
id: v.id
}
path: `/product/detail/${v.id}`,
});
},
goToSuccess (v) { // 跳转成功案例
...
...
src/views/solution/detail.vue
View file @
662a9e1
<!--
* @Date: 2024-09-29 15:49:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-1
1 17:21:35
* @LastEditTime: 2024-12-1
2 13:53:39
* @FilePath: /hager/src/views/solution/detail.vue
* @Description: 文件描述
-->
...
...
@@ -250,10 +250,7 @@ export default {
},
goToProduct (v) {
this.$router.push({
path: '/product/detail',
query: {
id: v.id
}
path: `/product/detail/${v.id}}`,
});
},
goToCase (v) {
...
...
Please
register
or
login
to post a comment