hookehuyr

🐞 fix: 底部解决方案跳转在解决方案页面不处理问题

<!--
* @Date: 2024-09-29 15:49:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-09 13:46:50
* @LastEditTime: 2024-12-09 16:36:59
* @FilePath: /hager/src/views/solution/detail.vue
* @Description: 文件描述
-->
......@@ -212,29 +212,39 @@ export default {
category_description: '',
}
},
async mounted () {
const { code, data } = await getSolutionCaseAPI({ cid: this.$route.query.id });
if (code) {
this.case_info = data;
this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner08.png';
this.case_list = data.list;
this.current_index = this.$route.query.current_index ? +this.$route.query.current_index : 0;
this.current_id = this.case_list[this.current_index]['id'];
this.success_data_list = this.case_list[this.current_index].list ?? [];
this.category_description = this.case_list[this.current_index].category_description ?? '';
this.case_img = this.case_list[this.current_index].file?.img ? this.case_list[this.current_index].file?.img : ['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'];
this.product_list = this.case_list[this.current_index].product ?? [];
mounted () {
this.initialize();
},
watch: {
'$route.query.id' (old, val) {
if (old !== val) {
this.initialize();
}
}
this.$nextTick(() => {
this.$refs.myProductSwiper.$swiper?.on('breakpoint', (swiper) => {
// breakpoint时 显示的条数
this.productSlidesPerView = swiper.slidesPerView
});
clampText('.clamp-text', 3); // 限制显示三行文本
});
},
methods: {
async initialize () {
const { code, data } = await getSolutionCaseAPI({ cid: this.$route.query.id });
if (code) {
this.case_info = data;
this.case_banner = data.file?.banner ? data.file?.banner[0] : 'https://cdn.ipadbiz.cn/hager/banner/banner08.png';
this.case_list = data.list;
this.current_index = this.$route.query.current_index ? +this.$route.query.current_index : 0;
this.current_id = this.case_list[this.current_index]['id'];
this.success_data_list = this.case_list[this.current_index].list ?? [];
this.category_description = this.case_list[this.current_index].category_description ?? '';
this.case_img = this.case_list[this.current_index].file?.img ? this.case_list[this.current_index].file?.img : ['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'];
this.product_list = this.case_list[this.current_index].product ?? [];
}
this.$nextTick(() => {
this.$refs.myProductSwiper.$swiper?.on('breakpoint', (swiper) => {
// breakpoint时 显示的条数
this.productSlidesPerView = swiper.slidesPerView
});
clampText('.clamp-text', 3); // 限制显示三行文本
});
},
onClickImg (item) {
window.open(item, '_blank');
},
......