Showing
8 changed files
with
18 additions
and
38 deletions
| ... | @@ -41,11 +41,7 @@ export default { | ... | @@ -41,11 +41,7 @@ export default { |
| 41 | toggle(v) { | 41 | toggle(v) { |
| 42 | if (v?.list) { | 42 | if (v?.list) { |
| 43 | this.$router.push({ | 43 | this.$router.push({ |
| 44 | - path: '/product/index', | 44 | + path: `/product/index/${v.id}/${Date.now()}`, |
| 45 | - query: { | ||
| 46 | - id: v.id, | ||
| 47 | - timestamp: Date.now() | ||
| 48 | - } | ||
| 49 | }); | 45 | }); |
| 50 | } else { | 46 | } else { |
| 51 | if (this.hasChildren) { | 47 | if (this.hasChildren) { | ... | ... |
| ... | @@ -193,11 +193,7 @@ export default { | ... | @@ -193,11 +193,7 @@ export default { |
| 193 | }, | 193 | }, |
| 194 | goToProduct (item) { | 194 | goToProduct (item) { |
| 195 | this.$router.push({ | 195 | this.$router.push({ |
| 196 | - path: '/product/index', | 196 | + path: `/product/index/${item.id}/${Date.now()}`, |
| 197 | - query: { | ||
| 198 | - id: item.id, | ||
| 199 | - timestamp: Date.now() | ||
| 200 | - } | ||
| 201 | }); | 197 | }); |
| 202 | }, | 198 | }, |
| 203 | goToSolution (item) { | 199 | goToSolution (item) { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-09-26 13:42:11 | 2 | * @Date: 2024-09-26 13:42:11 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-12-11 17:11:01 | 4 | + * @LastEditTime: 2024-12-12 13:39:46 |
| 5 | * @FilePath: /hager/src/components/common/hagerHeader.vue | 5 | * @FilePath: /hager/src/components/common/hagerHeader.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -375,11 +375,7 @@ export default { | ... | @@ -375,11 +375,7 @@ export default { |
| 375 | }, | 375 | }, |
| 376 | goToC (item) { // 跳转产品二级 | 376 | goToC (item) { // 跳转产品二级 |
| 377 | this.$router.push({ | 377 | this.$router.push({ |
| 378 | - path: '/product/index', | 378 | + path: `/product/index/${item.id}/${Date.now()}`, |
| 379 | - query: { | ||
| 380 | - id: item.id, | ||
| 381 | - timestamp: Date.now() | ||
| 382 | - } | ||
| 383 | }); | 379 | }); |
| 384 | 380 | ||
| 385 | this.closeMenu(); | 381 | this.closeMenu(); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-10 10:37:16 | 2 | * @Date: 2024-10-10 10:37:16 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-12-10 16:12:02 | 4 | + * @LastEditTime: 2024-12-12 13:39:03 |
| 5 | * @FilePath: /hager/src/components/hagerMenu.vue | 5 | * @FilePath: /hager/src/components/hagerMenu.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -143,10 +143,7 @@ export default { | ... | @@ -143,10 +143,7 @@ export default { |
| 143 | goToSub(id) { | 143 | goToSub(id) { |
| 144 | this.$emit("close"); | 144 | this.$emit("close"); |
| 145 | this.$router.push({ | 145 | this.$router.push({ |
| 146 | - path: "/product/index", | 146 | + path: `/product/index/${id}`, |
| 147 | - query: { | ||
| 148 | - id: id, | ||
| 149 | - }, | ||
| 150 | }); | 147 | }); |
| 151 | }, | 148 | }, |
| 152 | goToThird(id) { | 149 | goToThird(id) { | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2024-08-26 10:42:15 | 2 | * @Date: 2024-08-26 10:42:15 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-12-12 12:47:30 | 4 | + * @LastEditTime: 2024-12-12 13:38:22 |
| 5 | * @FilePath: /hager/src/route.js | 5 | * @FilePath: /hager/src/route.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -15,7 +15,7 @@ export default [{ | ... | @@ -15,7 +15,7 @@ export default [{ |
| 15 | }, | 15 | }, |
| 16 | children: [] | 16 | children: [] |
| 17 | }, { | 17 | }, { |
| 18 | - path: '/product/index', | 18 | + path: '/product/index/:id?/:timestamp?', |
| 19 | name: '二级目录', | 19 | name: '二级目录', |
| 20 | component: () => import('@/views/product/index'), | 20 | component: () => import('@/views/product/index'), |
| 21 | meta: { | 21 | meta: { | ... | ... |
| ... | @@ -332,12 +332,7 @@ export default { | ... | @@ -332,12 +332,7 @@ export default { |
| 332 | }, | 332 | }, |
| 333 | goToProduct (v) { | 333 | goToProduct (v) { |
| 334 | this.$router.push({ | 334 | this.$router.push({ |
| 335 | - path: '/product/index', | 335 | + path: `/product/index/${v.id}/${Date.now()}`, |
| 336 | - query: { | ||
| 337 | - // id: v.first_child_id, | ||
| 338 | - id: v.id, | ||
| 339 | - timestamp: Date.now() | ||
| 340 | - } | ||
| 341 | }); | 336 | }); |
| 342 | }, | 337 | }, |
| 343 | handleScreenWidth(width) { | 338 | handleScreenWidth(width) { | ... | ... |
| ... | @@ -186,10 +186,10 @@ export default { | ... | @@ -186,10 +186,10 @@ export default { |
| 186 | return sum; | 186 | return sum; |
| 187 | }, | 187 | }, |
| 188 | productPath () { | 188 | productPath () { |
| 189 | - return `/product/index?id=${this.info.parent_id}×tamp=${Date.now()}`; | 189 | + return `/product/index/${this.info.parent_id}/${Date.now()}`; |
| 190 | }, | 190 | }, |
| 191 | categoryPath () { | 191 | categoryPath () { |
| 192 | - return `/product/index?id=${this.info.category_id}×tamp=${Date.now()}`; | 192 | + return `/product/index/${this.info.category_id}/${Date.now()}`; |
| 193 | }, | 193 | }, |
| 194 | }, | 194 | }, |
| 195 | async mounted () { | 195 | async mounted () { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-09-27 16:53:09 | 2 | * @Date: 2024-09-27 16:53:09 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-11-19 16:06:14 | 4 | + * @LastEditTime: 2024-12-12 13:44:08 |
| 5 | * @FilePath: /hager/src/views/product/index.vue | 5 | * @FilePath: /hager/src/views/product/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -122,18 +122,18 @@ export default { | ... | @@ -122,18 +122,18 @@ export default { |
| 122 | }, | 122 | }, |
| 123 | computed: { | 123 | computed: { |
| 124 | allPath () { | 124 | allPath () { |
| 125 | - return `/product/index?timestamp=${Date.now()}`; | 125 | + return `/product/index/all/${Date.now()}`; |
| 126 | }, | 126 | }, |
| 127 | productPath () { | 127 | productPath () { |
| 128 | - return `/product/index?id=${this.cate_id}×tamp=${Date.now()}`; | 128 | + return `/product/index/${this.cate_id}/${Date.now()}`; |
| 129 | }, | 129 | }, |
| 130 | is_all_cate () { | 130 | is_all_cate () { |
| 131 | - return this.$route.query.id === undefined; | 131 | + return this.$route.params.id === 'all'; |
| 132 | } | 132 | } |
| 133 | }, | 133 | }, |
| 134 | watch: { | 134 | watch: { |
| 135 | // 监听路由参数变化时,更新输入框的值 | 135 | // 监听路由参数变化时,更新输入框的值 |
| 136 | - '$route.query.id' (val, old) { | 136 | + '$route.params.id' (val, old) { |
| 137 | if (val) { | 137 | if (val) { |
| 138 | if (old !== val) { | 138 | if (old !== val) { |
| 139 | this.is_search = false; | 139 | this.is_search = false; |
| ... | @@ -144,7 +144,7 @@ export default { | ... | @@ -144,7 +144,7 @@ export default { |
| 144 | this.getAllMain(); | 144 | this.getAllMain(); |
| 145 | } | 145 | } |
| 146 | }, | 146 | }, |
| 147 | - '$route.query.timestamp' (val, old) { | 147 | + '$route.params.timestamp' (val, old) { |
| 148 | this.is_search = false; | 148 | this.is_search = false; |
| 149 | if (!this.is_all_cate) { | 149 | if (!this.is_all_cate) { |
| 150 | this.getMain(); | 150 | this.getMain(); |
| ... | @@ -194,7 +194,7 @@ export default { | ... | @@ -194,7 +194,7 @@ export default { |
| 194 | } | 194 | } |
| 195 | }, | 195 | }, |
| 196 | async getMain () { | 196 | async getMain () { |
| 197 | - const { code, data } = await getProductCateAPI({cid: this.$route.query.id }); | 197 | + const { code, data } = await getProductCateAPI({cid: this.$route.params.id }); |
| 198 | if (code) { | 198 | if (code) { |
| 199 | let info = data[0]; | 199 | let info = data[0]; |
| 200 | this.parent_name = info.parent_name; | 200 | this.parent_name = info.parent_name; | ... | ... |
-
Please register or login to post a comment