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:45:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
084c7daebaf7762cd862a7f34fc288570e80dff7
084c7dae
1 parent
24929d0d
产品二级页面路由相关页面调整
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
38 deletions
src/components/accordion/AccordionItem.vue
src/components/common/hagerFooter.vue
src/components/common/hagerHeader.vue
src/components/hagerMenu.vue
src/route.js
src/views/index.vue
src/views/product/detail.vue
src/views/product/index.vue
src/components/accordion/AccordionItem.vue
View file @
084c7da
...
...
@@ -41,11 +41,7 @@ export default {
toggle(v) {
if (v?.list) {
this.$router.push({
path: '/product/index',
query: {
id: v.id,
timestamp: Date.now()
}
path: `/product/index/${v.id}/${Date.now()}`,
});
} else {
if (this.hasChildren) {
...
...
src/components/common/hagerFooter.vue
View file @
084c7da
...
...
@@ -193,11 +193,7 @@ export default {
},
goToProduct (item) {
this.$router.push({
path: '/product/index',
query: {
id: item.id,
timestamp: Date.now()
}
path: `/product/index/${item.id}/${Date.now()}`,
});
},
goToSolution (item) {
...
...
src/components/common/hagerHeader.vue
View file @
084c7da
<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-1
1 17:11:01
* @LastEditTime: 2024-12-1
2 13:39:46
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
...
...
@@ -375,11 +375,7 @@ export default {
},
goToC (item) { // 跳转产品二级
this.$router.push({
path: '/product/index',
query: {
id: item.id,
timestamp: Date.now()
}
path: `/product/index/${item.id}/${Date.now()}`,
});
this.closeMenu();
...
...
src/components/hagerMenu.vue
View file @
084c7da
<!--
* @Date: 2024-10-10 10:37:16
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-1
0 16:12:02
* @LastEditTime: 2024-12-1
2 13:39:03
* @FilePath: /hager/src/components/hagerMenu.vue
* @Description: 文件描述
-->
...
...
@@ -143,10 +143,7 @@ export default {
goToSub(id) {
this.$emit("close");
this.$router.push({
path: "/product/index",
query: {
id: id,
},
path: `/product/index/${id}`,
});
},
goToThird(id) {
...
...
src/route.js
View file @
084c7da
/*
* @Date: 2024-08-26 10:42:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 1
2:47:30
* @LastEditTime: 2024-12-12 1
3:38:22
* @FilePath: /hager/src/route.js
* @Description: 文件描述
*/
...
...
@@ -15,7 +15,7 @@ export default [{
},
children
:
[]
},
{
path
:
'/product/index'
,
path
:
'/product/index
/:id?/:timestamp?
'
,
name
:
'二级目录'
,
component
:
()
=>
import
(
'@/views/product/index'
),
meta
:
{
...
...
src/views/index.vue
View file @
084c7da
...
...
@@ -332,12 +332,7 @@ export default {
},
goToProduct (v) {
this.$router.push({
path: '/product/index',
query: {
// id: v.first_child_id,
id: v.id,
timestamp: Date.now()
}
path: `/product/index/${v.id}/${Date.now()}`,
});
},
handleScreenWidth(width) {
...
...
src/views/product/detail.vue
View file @
084c7da
...
...
@@ -186,10 +186,10 @@ export default {
return sum;
},
productPath () {
return `/product/index
?id=${this.info.parent_id}×tamp=
${Date.now()}`;
return `/product/index
/${this.info.parent_id}/
${Date.now()}`;
},
categoryPath () {
return `/product/index
?id=${this.info.category_id}×tamp=
${Date.now()}`;
return `/product/index
/${this.info.category_id}/
${Date.now()}`;
},
},
async mounted () {
...
...
src/views/product/index.vue
View file @
084c7da
<!--
* @Date: 2024-09-27 16:53:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-1
1-19 16:06:14
* @LastEditTime: 2024-1
2-12 13:44:08
* @FilePath: /hager/src/views/product/index.vue
* @Description: 文件描述
-->
...
...
@@ -122,18 +122,18 @@ export default {
},
computed: {
allPath () {
return `/product/index
?timestamp=
${Date.now()}`;
return `/product/index
/all/
${Date.now()}`;
},
productPath () {
return `/product/index
?id=${this.cate_id}×tamp=
${Date.now()}`;
return `/product/index
/${this.cate_id}/
${Date.now()}`;
},
is_all_cate () {
return this.$route.
query.id === undefined
;
return this.$route.
params.id === 'all'
;
}
},
watch: {
// 监听路由参数变化时,更新输入框的值
'$route.
query
.id' (val, old) {
'$route.
params
.id' (val, old) {
if (val) {
if (old !== val) {
this.is_search = false;
...
...
@@ -144,7 +144,7 @@ export default {
this.getAllMain();
}
},
'$route.
query
.timestamp' (val, old) {
'$route.
params
.timestamp' (val, old) {
this.is_search = false;
if (!this.is_all_cate) {
this.getMain();
...
...
@@ -194,7 +194,7 @@ export default {
}
},
async getMain () {
const { code, data } = await getProductCateAPI({cid: this.$route.
query
.id });
const { code, data } = await getProductCateAPI({cid: this.$route.
params
.id });
if (code) {
let info = data[0];
this.parent_name = info.parent_name;
...
...
Please
register
or
login
to post a comment