qiyunfeng-create
2 天以前 5f00696dfb25bc90034448ceb634ed1ef256681a
src/views/personalCenter/myCollection.vue
@@ -68,10 +68,9 @@
<script setup lang="ts">
import { reactive, ref, onMounted, inject, watch } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { useBreadcrumbStore, useUserStore } from '@/store'
import { useUserStore } from "@/store";
import { useRouter } from "vue-router";
const crumbStore = useBreadcrumbStore()
const userStore = useUserStore()
const userStore = useUserStore();
const router = useRouter();
const MG: any = inject("MG");
const config: any = inject("config");
@@ -161,51 +160,10 @@
};
// 跳转书本详情
const goBookDetails = (id: number, name: string) => {
  let crumbs = [
    {
      name,
      isCrumbs: true,
      type:
        currentCollect.value == "book"
          ? "bookService"
          : currentCollect.value == "textBooks"
          ? "digitalTextbooks"
          : "digitalCourses",
      path:
        currentCollect.value == "book"
          ? "/bookService/details"
          : "/digitalCoursesDetails",
    },
  ];
  // 在全局数据中设置面包屑
  crumbStore.setCrumbs({
    type:
      currentCollect.value == "book"
        ? "bookService"
        : currentCollect.value == "textBooks"
        ? "digitalTextbooks"
        : "digitalCourses",
    data: crumbs,
    callback: (key: any) => {
      router.push({
        name:
          currentCollect.value == "book"
            ? "bookDetails"
            : currentCollect.value == "textBooks"
            ? "digitalTextbooksDetails"
            : "digitalCoursesDetails",
        query: {
          crumbsKey: key,
          bookId: id,
          bookName: name,
          type:
            currentCollect.value == "book"
              ? "bookService"
              : currentCollect.value == "textBooks"
              ? "digitalTextbooks"
              : "digitalCourses",
        },
      });
  router.push({
    path: "/bookdetail",
    query: {
      bookId: id,
    },
  });
};