hookehuyr

fix(Home): 处理法会流程和三师七证链接不存在的情况

当法会流程没有跳转链接时显示提示信息,三师七证没有链接时跳转到默认页面
......@@ -157,6 +157,8 @@ import { ref, computed, nextTick, onMounted, watch } from 'vue'
import VideoPlayer from '@/components/VideoPlayer.vue'
import { useTitle } from '@vueuse/core';
import { useRouter } from 'vue-router'
import { showToast } from 'vant'
// 导入接口
import { homePageAPI } from '@/api/index.js'
......@@ -284,12 +286,17 @@ const viewMore = (type, item) => {
switch (type) {
case '法会流程':
// 跳转页面
location.href = item.category_link;
if (item?.category_link) {
location.href = item?.category_link;
} else {
// 提示用户没有详情页
showToast('该法会流程没有跳转链接')
}
break
case '三师七证':
// 跳转到三师七证页面的逻辑
if (item.category_link) {
location.href = item.category_link;
if (item?.category_link) {
location.href = item?.category_link;
} else {
router.push(`/masters?pid=${item.id}`)
}
......