Commit adecf50f authored by 何毅恒's avatar 何毅恒

同上

parent ec36f4f8
......@@ -85,6 +85,7 @@ import {
onMounted,
getCurrentInstance,
ComponentInternalInstance,
nextTick,
} from "vue";
import { useRouter } from "vue-router";
import { post } from "@/api/index";
......@@ -99,6 +100,7 @@ onMounted(() => {
getBanner();
getInformationCategory();
});
const router = useRouter();
const imgUrl = globalProperties.$img;
......@@ -118,27 +120,20 @@ const getInformationCategory = async () => {
let res = await post("information/getInformationCategory");
if (res.code == 0) {
categoryList.value = res.data;
getSecondInformationCategory(res.data[0].id, 0);
}
};
// 获取二级分类
let firstJump = true;
const getSecondInformationCategory = async (parent_id, key) => {
let res = await post("information/getInformationCategory", { parent_id });
if (res.code == 0) {
categoryList.value[key].secondCategoryList = res.data;
if (firstJump) {
jump(parent_id, res.data[0].id, res.data[0].cat_name);
firstJump = false;
}
}
};
const toIndex = (): void => {
window.location.href = "https://gelifood.com/";
window.location.href = "https://www.gelifood.com/";
};
const jump = (category_id_1, category_id_2, cat_name): void => {
// console.log(111111, category_id_1, category_id_2, cat_name);
router.push(
"/pc/pcArticleList?category_id_1=" +
category_id_1 +
......
......@@ -38,10 +38,10 @@ const getInformationDetail = async (id) => {
let res = await post("Information/informationDetail", { id });
if (res.code == 0) {
informationDetail.value = res.data;
// informationDetail.value.content = informationDetail.value.content.replace(
// /\<img/gi,
// '<img style="width:100%"'
// );
informationDetail.value.content = informationDetail.value.content.replace(
/\<img/gi,
'<img style="max-width:100%"'
);
}
};
</script>
......
<template>
<div id="pcArticleList">
<h6 class="rightTitle">{{ cat_name_2 }}</h6>
<h6 class="rightTitle">{{ cat_name_2 || "帮助中心" }}</h6>
<ul class="rightList">
<li
class="rightItem"
......
......@@ -15,6 +15,7 @@ const routes: Array<RouteRecordRaw> = [
component: () =>
import(/* webpackChunkName: "pcIndex" */ "@/pages/pc/index.vue"),
meta:{keepAlive: false},
redirect:{name: 'pcArticleList'},
children:[
{
path: '/pc/pcArticleList',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment