跳转详情
parent
40c4bb38ce
commit
1fe539d5e5
|
|
@ -15,11 +15,11 @@
|
||||||
</div>
|
</div>
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li :class="{ active: route.meta.group === 'home' }" @click="jump('/')">首页</li>
|
<li :class="{ active: route.meta.group === 'home' }" @click="jump('/')">首页</li>
|
||||||
<li>AI助理</li>
|
<li :class="{ active: route.meta.group === 'chat' }" @click="jump('/chat')">AI助理</li>
|
||||||
<li :class="{ active: route.meta.group === 'business' }" @click="jump('/business')">AI商情</li>
|
<li :class="{ active: route.meta.group === 'business' }" @click="jump('/business')">AI商情</li>
|
||||||
<li>AI传播</li>
|
<li>AI传播</li>
|
||||||
<li>AI献策</li>
|
<li>AI献策</li>
|
||||||
<li :class="{ active: route.meta.group === 'vip' }">会员服务</li>
|
<li :class="{ active: route.meta.group === 'vip' }" @click="jump('/vip')">会员服务</li>
|
||||||
<li :class="{ active: route.meta.group === 'ucenter' }" @click="jump('/ucenter/userinfo')">个人中心</li>
|
<li :class="{ active: route.meta.group === 'ucenter' }" @click="jump('/ucenter/userinfo')">个人中心</li>
|
||||||
<li @click="onLogout">退出登录</li>
|
<li @click="onLogout">退出登录</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ const dataList = ref([]);
|
||||||
const placeholder = ref('');
|
const placeholder = ref('');
|
||||||
const hasMore = ref(false);
|
const hasMore = ref(false);
|
||||||
|
|
||||||
|
console.log(props);
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|
@ -81,10 +83,15 @@ const loadMore = ()=>{
|
||||||
|
|
||||||
const goDetail = (id) => {
|
const goDetail = (id) => {
|
||||||
let path = {
|
let path = {
|
||||||
|
government: `/business/legal/policy/detail/${id}`, // 宏观正经-内容详情页
|
||||||
business: `/business/insight/detail/${props.cid}/${id}`, // 行业洞察详情页
|
business: `/business/insight/detail/${props.cid}/${id}`, // 行业洞察详情页
|
||||||
policy: `/business/legal/policy/detail/${id}`, // 法律法规-政策解读详情页
|
policy: `/business/legal/policy/detail/${id}`, // 法律法规-政策解读详情页
|
||||||
};
|
};
|
||||||
router.push(path[props.type]);
|
if(path[props.type]){
|
||||||
|
router.push(path[props.type]);
|
||||||
|
}else{
|
||||||
|
console.log('无此类型详情页路由跳转配置:'+props.type);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onBeforeMount, onMounted } from 'vue';
|
import { ref, onBeforeMount, onMounted, onUpdated } from 'vue';
|
||||||
import http from '@/io/http';
|
import http from '@/io/http';
|
||||||
import { showToast } from 'vant';
|
import { showToast } from 'vant';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import ArticleDetail from '@/components/ArticleDetail/index.vue';
|
import ArticleDetail from '@/components/ArticleDetail/index.vue';
|
||||||
|
|
||||||
const breadNav = [
|
const breadNav = ref([
|
||||||
{ path: '/', name: '首页' },
|
{ path: '/', name: '首页' },
|
||||||
{ path: '/business', name: 'AI商情' },
|
{ path: '/business', name: 'AI商情' },
|
||||||
{ path: '/business/insight', name: '行业洞察' },
|
{ path: '/business/insight', name: '行业洞察' },
|
||||||
];
|
]);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const id = ref(route.params.id);
|
const id = ref(route.params.id);
|
||||||
|
|
@ -22,18 +22,17 @@ onBeforeMount(()=>{
|
||||||
getDetail();
|
getDetail();
|
||||||
});
|
});
|
||||||
|
|
||||||
// const getCategories = () => {
|
|
||||||
// let params = { type_key: 'business' };
|
|
||||||
// http('/api/keywords', params, 'get').then(res => {
|
|
||||||
// category.value = res.data.filter(v => v.id == cid.value)[0];
|
|
||||||
// }).catch(err => {
|
|
||||||
// showToast(err.message);
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
const getDetail = () => {
|
const getDetail = () => {
|
||||||
http(`/api/article/${id.value}`, {}, 'get').then(res => {
|
http(`/api/article/${id.value}`, {}, 'get', {isLoading: false}).then(res => {
|
||||||
console.log(res.data);
|
let tempNav = [...breadNav.value];
|
||||||
|
let cid = res.data.category_id;
|
||||||
|
res.data.category_path.forEach(v=>{
|
||||||
|
if(v.id == cid){
|
||||||
|
tempNav.push({path: `/business/insight/category/${cid}`, name: v.name});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
breadNav.value = tempNav;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// showToast(err.message);
|
// showToast(err.message);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue