hookehuyr

产品详情页路由调整

...@@ -51,11 +51,7 @@ export default { ...@@ -51,11 +51,7 @@ export default {
51 }, 51 },
52 goToDetail (v) { // 跳转产品详情 52 goToDetail (v) { // 跳转产品详情
53 this.$router.push({ 53 this.$router.push({
54 - path: '/product/detail', 54 + path: `/product/detail${v.id}/${Date.now()}`,
55 - query: {
56 - id: v.id,
57 - timestamp: Date.now()
58 - }
59 }); 55 });
60 } 56 }
61 } 57 }
......
...@@ -382,12 +382,7 @@ export default { ...@@ -382,12 +382,7 @@ export default {
382 }, 382 },
383 goToP (item) { // 跳转产品详情 383 goToP (item) { // 跳转产品详情
384 this.$router.push({ 384 this.$router.push({
385 - path: '/product/detail', 385 + path: `/product/detail/${item.id}/${item.category_id}/${Date.now()}`,
386 - query: {
387 - id: item.id,
388 - category_id: item.category_id,
389 - timestamp: Date.now()
390 - }
391 }); 386 });
392 this.closeMenu(); 387 this.closeMenu();
393 }, 388 },
......
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-12 13:39:03 4 + * @LastEditTime: 2024-12-12 13:50:39
5 * @FilePath: /hager/src/components/hagerMenu.vue 5 * @FilePath: /hager/src/components/hagerMenu.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -149,10 +149,7 @@ export default { ...@@ -149,10 +149,7 @@ export default {
149 goToThird(id) { 149 goToThird(id) {
150 this.$emit("close"); 150 this.$emit("close");
151 this.$router.push({ 151 this.$router.push({
152 - path: "/product/detail", 152 + path: `/product/detail/${id}`,
153 - query: {
154 - id: id,
155 - },
156 }); 153 });
157 }, 154 },
158 // 155 //
......
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 13:38:22 4 + * @LastEditTime: 2024-12-12 13:51:12
5 * @FilePath: /hager/src/route.js 5 * @FilePath: /hager/src/route.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -24,7 +24,25 @@ export default [{ ...@@ -24,7 +24,25 @@ export default [{
24 }, 24 },
25 children: [] 25 children: []
26 }, { 26 }, {
27 - path: '/product/detail', 27 + path: '/product/detail/:id',
28 + name: '详情页',
29 + component: () => import('@/views/product/detail'),
30 + meta: {
31 + title: '海格电气',
32 + tag: 'product'
33 + },
34 + children: []
35 +}, {
36 + path: '/product/detail/:id/:timestamp',
37 + name: '详情页',
38 + component: () => import('@/views/product/detail'),
39 + meta: {
40 + title: '海格电气',
41 + tag: 'product'
42 + },
43 + children: []
44 +}, {
45 + path: '/product/detail/:id/:category_id/:timestamp',
28 name: '详情页', 46 name: '详情页',
29 component: () => import('@/views/product/detail'), 47 component: () => import('@/views/product/detail'),
30 meta: { 48 meta: {
......
1 <!-- 1 <!--
2 * @Date: 2024-09-29 14:26:41 2 * @Date: 2024-09-29 14:26:41
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-06 15:34:53 4 + * @LastEditTime: 2024-12-12 13:54:06
5 * @FilePath: /hager/src/views/product/detail.vue 5 * @FilePath: /hager/src/views/product/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
204 }, 204 },
205 watch: { 205 watch: {
206 // 监听路由参数变化时,更新输入框的值 206 // 监听路由参数变化时,更新输入框的值
207 - async '$route.query.id' (val, old) { 207 + async '$route.params.id' (val, old) {
208 if (old !== val) { 208 if (old !== val) {
209 this.getInfo(); 209 this.getInfo();
210 } 210 }
...@@ -253,7 +253,7 @@ export default { ...@@ -253,7 +253,7 @@ export default {
253 checked_sum: 0, 253 checked_sum: 0,
254 }]; 254 }];
255 this.info_images = []; 255 this.info_images = [];
256 - const { code, data } = await getProductInfoAPI( { id: this.$route.query.id }); 256 + const { code, data } = await getProductInfoAPI( { id: this.$route.params.id });
257 if (code) { 257 if (code) {
258 this.info = data; 258 this.info = data;
259 this.keyword = data.post_keyword; 259 this.keyword = data.post_keyword;
......
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-12-12 13:44:08 4 + * @LastEditTime: 2024-12-12 13:55:31
5 * @FilePath: /hager/src/views/product/index.vue 5 * @FilePath: /hager/src/views/product/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -168,11 +168,7 @@ export default { ...@@ -168,11 +168,7 @@ export default {
168 }, 168 },
169 goToDetail (v) { // 跳转产品详情 169 goToDetail (v) { // 跳转产品详情
170 this.$router.push({ 170 this.$router.push({
171 - path: '/product/detail', 171 + path: `/product/detail/${v.id}/${this.$route.params.id}/${Date.now()}`
172 - query: {
173 - id: v.id,
174 - category_id: this.$route.query.id
175 - }
176 }); 172 });
177 }, 173 },
178 async getAllMain () { // 查询所有产品列表数据 174 async getAllMain () { // 查询所有产品列表数据
......
1 <!-- 1 <!--
2 * @Date: 2024-10-20 16:57:48 2 * @Date: 2024-10-20 16:57:48
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-12-12 12:48:21 4 + * @LastEditTime: 2024-12-12 13:52:16
5 * @FilePath: /hager/src/views/search.vue 5 * @FilePath: /hager/src/views/search.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -243,12 +243,7 @@ export default { ...@@ -243,12 +243,7 @@ export default {
243 }, 243 },
244 goToDetail (v) { // 跳转产品详情 244 goToDetail (v) { // 跳转产品详情
245 this.$router.push({ 245 this.$router.push({
246 - path: '/product/detail', 246 + path: `/product/detail/${v.id}/${v.category_id}/${Date.now()}`,
247 - query: {
248 - id: v.id,
249 - category_id: v.category_id,
250 - timestamp: Date.now()
251 - }
252 }); 247 });
253 }, 248 },
254 goToCase (id) { 249 goToCase (id) {
...@@ -261,10 +256,7 @@ export default { ...@@ -261,10 +256,7 @@ export default {
261 }, 256 },
262 goToSolution (v) { // 跳转产品详情 257 goToSolution (v) { // 跳转产品详情
263 this.$router.push({ 258 this.$router.push({
264 - path: '/product/detail', 259 + path: `/product/detail/${v.id}`,
265 - query: {
266 - id: v.id
267 - }
268 }); 260 });
269 }, 261 },
270 goToSuccess (v) { // 跳转成功案例 262 goToSuccess (v) { // 跳转成功案例
......
1 <!-- 1 <!--
2 * @Date: 2024-09-29 15:49:27 2 * @Date: 2024-09-29 15:49:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-12-11 17:21:35 4 + * @LastEditTime: 2024-12-12 13:53:39
5 * @FilePath: /hager/src/views/solution/detail.vue 5 * @FilePath: /hager/src/views/solution/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -250,10 +250,7 @@ export default { ...@@ -250,10 +250,7 @@ export default {
250 }, 250 },
251 goToProduct (v) { 251 goToProduct (v) {
252 this.$router.push({ 252 this.$router.push({
253 - path: '/product/detail', 253 + path: `/product/detail/${v.id}}`,
254 - query: {
255 - id: v.id
256 - }
257 }); 254 });
258 }, 255 },
259 goToCase (v) { 256 goToCase (v) {
......