hookehuyr

解决方案详情路由调整

1 <!-- 1 <!--
2 * @Date: 2024-09-26 13:42:22 2 * @Date: 2024-09-26 13:42:22
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-12-04 11:40:52 4 + * @LastEditTime: 2024-12-12 14:13:11
5 * @FilePath: /hager/src/components/common/hagerFooter.vue 5 * @FilePath: /hager/src/components/common/hagerFooter.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -198,11 +198,7 @@ export default { ...@@ -198,11 +198,7 @@ export default {
198 }, 198 },
199 goToSolution (item) { 199 goToSolution (item) {
200 this.$router.push({ 200 this.$router.push({
201 - path: '/solution/detail', 201 + path: `/solution/detail/${item.id}/${Date.now()}`,
202 - query: {
203 - id: item.id,
204 - timestamp: Date.now()
205 - }
206 }); 202 });
207 }, 203 },
208 goToCorp (item) { 204 goToCorp (item) {
......
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:51:12 4 + * @LastEditTime: 2024-12-12 14:03:26
5 * @FilePath: /hager/src/route.js 5 * @FilePath: /hager/src/route.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -25,7 +25,7 @@ export default [{ ...@@ -25,7 +25,7 @@ export default [{
25 children: [] 25 children: []
26 }, { 26 }, {
27 path: '/product/detail/:id', 27 path: '/product/detail/:id',
28 - name: '详情页', 28 + name: '详情页1',
29 component: () => import('@/views/product/detail'), 29 component: () => import('@/views/product/detail'),
30 meta: { 30 meta: {
31 title: '海格电气', 31 title: '海格电气',
...@@ -34,7 +34,7 @@ export default [{ ...@@ -34,7 +34,7 @@ export default [{
34 children: [] 34 children: []
35 }, { 35 }, {
36 path: '/product/detail/:id/:timestamp', 36 path: '/product/detail/:id/:timestamp',
37 - name: '详情页', 37 + name: '详情页2',
38 component: () => import('@/views/product/detail'), 38 component: () => import('@/views/product/detail'),
39 meta: { 39 meta: {
40 title: '海格电气', 40 title: '海格电气',
...@@ -43,7 +43,7 @@ export default [{ ...@@ -43,7 +43,7 @@ export default [{
43 children: [] 43 children: []
44 }, { 44 }, {
45 path: '/product/detail/:id/:category_id/:timestamp', 45 path: '/product/detail/:id/:category_id/:timestamp',
46 - name: '详情页', 46 + name: '详情页3',
47 component: () => import('@/views/product/detail'), 47 component: () => import('@/views/product/detail'),
48 meta: { 48 meta: {
49 title: '海格电气', 49 title: '海格电气',
...@@ -60,8 +60,17 @@ export default [{ ...@@ -60,8 +60,17 @@ export default [{
60 }, 60 },
61 children: [] 61 children: []
62 }, { 62 }, {
63 - path: '/solution/detail', 63 + path: '/solution/detail/:id/:timestamp',
64 - name: '解决方案详情', 64 + name: '解决方案详情1',
65 + component: () => import('@/views/solution/detail'),
66 + meta: {
67 + title: '解决方案 | Hager China',
68 + tag: 'solution'
69 + },
70 + children: []
71 +}, {
72 + path: '/solution/detail/:id/:current_index/:timestamp',
73 + name: '解决方案详情2',
65 component: () => import('@/views/solution/detail'), 74 component: () => import('@/views/solution/detail'),
66 meta: { 75 meta: {
67 title: '解决方案 | Hager China', 76 title: '解决方案 | Hager China',
......
1 <!-- 1 <!--
2 * @Date: 2024-08-27 10:06:30 2 * @Date: 2024-08-27 10:06:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-12-12 12:48:04 4 + * @LastEditTime: 2024-12-12 14:14:08
5 * @FilePath: /hager/src/views/index.vue 5 * @FilePath: /hager/src/views/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -323,11 +323,7 @@ export default { ...@@ -323,11 +323,7 @@ export default {
323 }, 323 },
324 goToSolution (v) { 324 goToSolution (v) {
325 this.$router.push({ 325 this.$router.push({
326 - path: '/solution/detail', 326 + path: `/solution/detail/${v.id}/${Date.now()}`,
327 - query: {
328 - id: v.id,
329 - timestamp: Date.now()
330 - }
331 }); 327 });
332 }, 328 },
333 goToProduct (v) { 329 goToProduct (v) {
......
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 13:52:16 4 + * @LastEditTime: 2024-12-12 14:14:55
5 * @FilePath: /hager/src/views/search.vue 5 * @FilePath: /hager/src/views/search.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -248,10 +248,7 @@ export default { ...@@ -248,10 +248,7 @@ export default {
248 }, 248 },
249 goToCase (id) { 249 goToCase (id) {
250 this.$router.push({ 250 this.$router.push({
251 - path: '/solution/detail', 251 + path: `/solution/detail/${id}/${Date.now()}`,
252 - query: {
253 - id: id
254 - }
255 }); 252 });
256 }, 253 },
257 goToSolution (v) { // 跳转产品详情 254 goToSolution (v) { // 跳转产品详情
......
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
157 }, 157 },
158 computed: { 158 computed: {
159 casePath () { 159 casePath () {
160 - return `/solution/detail?id=${this.success_info.category_id}&current_index=${this.$route.query.current_index}`; 160 + return `/solution/detail/${this.success_info.category_id}/${this.$route.query.current_index}/${Date.now()}`;
161 } 161 }
162 }, 162 },
163 watch: { 163 watch: {
......
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-12 13:53:39 4 + * @LastEditTime: 2024-12-12 14:21:31
5 * @FilePath: /hager/src/views/solution/detail.vue 5 * @FilePath: /hager/src/views/solution/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -216,7 +216,7 @@ export default { ...@@ -216,7 +216,7 @@ export default {
216 this.initialize(); 216 this.initialize();
217 }, 217 },
218 watch: { 218 watch: {
219 - '$route.query.id' (old, val) { 219 + '$route.params.id' (old, val) {
220 if (old !== val) { 220 if (old !== val) {
221 this.initialize(); 221 this.initialize();
222 } 222 }
...@@ -224,12 +224,12 @@ export default { ...@@ -224,12 +224,12 @@ export default {
224 }, 224 },
225 methods: { 225 methods: {
226 async initialize () { 226 async initialize () {
227 - const { code, data } = await getSolutionCaseAPI({ cid: this.$route.query.id }); 227 + const { code, data } = await getSolutionCaseAPI({ cid: this.$route.params.id });
228 if (code) { 228 if (code) {
229 this.case_info = data; 229 this.case_info = data;
230 this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner08.png'; 230 this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner08.png';
231 this.case_list = data.list; 231 this.case_list = data.list;
232 - this.current_index = this.$route.query.current_index ? +this.$route.query.current_index : 0; 232 + this.current_index = this.$route.params.current_index ? +this.$route.params.current_index : 0;
233 this.current_id = this.case_list[this.current_index]['id']; 233 this.current_id = this.case_list[this.current_index]['id'];
234 this.success_data_list = this.case_list[this.current_index].list ?? []; 234 this.success_data_list = this.case_list[this.current_index].list ?? [];
235 this.category_description = this.case_list[this.current_index].category_description ?? ''; 235 this.category_description = this.case_list[this.current_index].category_description ?? '';
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
250 }, 250 },
251 goToProduct (v) { 251 goToProduct (v) {
252 this.$router.push({ 252 this.$router.push({
253 - path: `/product/detail/${v.id}}`, 253 + path: `/product/detail/${v.id}`,
254 }); 254 });
255 }, 255 },
256 goToCase (v) { 256 goToCase (v) {
...@@ -313,11 +313,7 @@ export default { ...@@ -313,11 +313,7 @@ export default {
313 }) 313 })
314 // 记录点击的分类ID,用于返回定位到该分类 314 // 记录点击的分类ID,用于返回定位到该分类
315 this.$router.push({ 315 this.$router.push({
316 - path: '/solution/detail', 316 + path: `/solution/detail/${this.$route.params.id}/${this.current_index}/${Date.now()}`,
317 - query: {
318 - ...this.$route.query, // 先展开原来的参数
319 - current_index: this.current_index
320 - }
321 }); 317 });
322 } 318 }
323 } 319 }
......
...@@ -161,10 +161,7 @@ export default { ...@@ -161,10 +161,7 @@ export default {
161 }, 161 },
162 goToSolution (v) { 162 goToSolution (v) {
163 this.$router.push({ 163 this.$router.push({
164 - path: '/solution/detail', 164 + path: `/solution/detail/${v.id}/${Date.now()}`,
165 - query: {
166 - id: v.id
167 - }
168 }); 165 });
169 }, 166 },
170 prevSolutionBtn () { 167 prevSolutionBtn () {
......