|
@@ -6,29 +6,17 @@ import 'moment/dist/locale/zh-cn'
|
|
|
import AudioBox from './components/AudioBox.vue'
|
|
|
import {apiReportDetail,apiReportMoreRecmd,apiReportDetailBanner} from '@/api/report'
|
|
|
import {apiGetWechatQRCode} from '@/api/common'
|
|
|
-import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { useRoute , onBeforeRouteUpdate} from 'vue-router';
|
|
|
+import useHZRouter from '@/hooks/useHZRouter'
|
|
|
import { useStore } from 'vuex';
|
|
|
moment.locale('zh-cn')
|
|
|
|
|
|
const route=useRoute()
|
|
|
-const router=useRouter()
|
|
|
+const HZRouter=useHZRouter()
|
|
|
const store=useStore()
|
|
|
|
|
|
let reportId=ref(route.query.reportId||'')
|
|
|
|
|
|
-//点击侧边栏更多推荐
|
|
|
-const handleClickAsideRecmd=(item)=>{
|
|
|
- router.replace({
|
|
|
- query:{
|
|
|
- reportId:item.ReportId
|
|
|
- }
|
|
|
- })
|
|
|
- // 更新页面数据
|
|
|
- reportId.value=item.ReportId
|
|
|
- getReportDetail()
|
|
|
- getQRCodeImg()
|
|
|
-}
|
|
|
-
|
|
|
// 获取报告详情
|
|
|
let info=ref(null)
|
|
|
let audioData=ref(null)
|
|
@@ -102,6 +90,19 @@ const getAsideMoreRecmd=async (data)=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//点击侧边栏更多推荐
|
|
|
+const handleClickAsideRecmd=(item)=>{
|
|
|
+ HZRouter.replace({
|
|
|
+ query:{
|
|
|
+ reportId:item.ReportId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 更新页面数据
|
|
|
+ // reportId.value=item.ReportId
|
|
|
+ // getReportDetail()
|
|
|
+ // getQRCodeImg()
|
|
|
+}
|
|
|
+
|
|
|
//侧边栏报告合集
|
|
|
let banner=ref(null)
|
|
|
const getAsideBanner=async (data)=>{
|
|
@@ -117,7 +118,7 @@ const getAsideBanner=async (data)=>{
|
|
|
//点击侧边栏报告合集
|
|
|
const handleAsideBanner=(data)=>{
|
|
|
if(data.Type=='报告合集'){
|
|
|
- router.push({
|
|
|
+ HZRouter.push({
|
|
|
path:'/report/list',
|
|
|
query:{
|
|
|
classifyId:data.ClassifyIdFirst,
|
|
@@ -125,7 +126,7 @@ const handleAsideBanner=(data)=>{
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- router.push({
|
|
|
+ HZRouter.push({
|
|
|
path:'/report/specialcolumndetail',
|
|
|
query:{
|
|
|
columnId:data.ClassifyIdSecond
|
|
@@ -157,6 +158,14 @@ onMounted(()=>{
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+onBeforeRouteUpdate((to,from)=>{
|
|
|
+ console.log(to.query);
|
|
|
+ // 更新页面数据
|
|
|
+ reportId.value=to.query.reportId
|
|
|
+ getReportDetail()
|
|
|
+ getQRCodeImg()
|
|
|
+})
|
|
|
+
|
|
|
// 设置章节列表tag颜色
|
|
|
const getTagColor=(str)=>{
|
|
|
if( str.includes('多')||str.includes('强')||str.includes('反弹') ){
|
|
@@ -170,7 +179,7 @@ const getTagColor=(str)=>{
|
|
|
|
|
|
// 跳转章节详情
|
|
|
const goChapterDetail=(item)=>{
|
|
|
- router.push({
|
|
|
+ HZRouter.push({
|
|
|
path:'/report/chapterdetail',
|
|
|
query:{
|
|
|
chapterId:item.report_chapter_id,
|
|
@@ -194,7 +203,13 @@ const handleGoApply=async ()=>{
|
|
|
})
|
|
|
}else{
|
|
|
if(!info.value.permission_check.customer_info.status||info.value.permission_check.customer_info.status!='流失'){
|
|
|
- router.push('/apply/permission?source=4&fromPage=报告详情')
|
|
|
+ HZRouter.push({
|
|
|
+ path:'/apply/permission',
|
|
|
+ query:{
|
|
|
+ source:4,
|
|
|
+ fromPage:'报告详情'
|
|
|
+ }
|
|
|
+ })
|
|
|
}else{//主动调一次申请权限接口
|
|
|
const res=await apiApplyPermission({
|
|
|
company_name:info.value.permission_check.customer_info.company_name,
|