Pārlūkot izejas kodu

报告取消发布的提示页

jwyu 2 gadi atpakaļ
vecāks
revīzija
f86eeb8d2d

+ 1 - 1
src/api/http.js

@@ -50,7 +50,7 @@ _axios.interceptors.response.use(
         webLogin()
       }
     }
-    if(data.code!==200&&data.code!==403&&data.code!==4001&&data.code!==401){
+    if(![200,403,4001,401,4002].includes(data.code)){
       ElMessage.error(data.msg)
     }
     return data;

+ 5 - 0
src/views/report/ChapterDetail.vue

@@ -23,6 +23,7 @@ import collectIcon from '@/assets/collect2.png'
 import collectSIcon from '@/assets/collect2-s.png'
 import {useWaterMark} from '@/hooks/waterMark.js'
 import {addTokenToIframe} from '@/utils/common.js'
+import reportCancel from './components/reportCancel.vue'
 
 const route=useRoute()
 const router=useRouter()
@@ -107,6 +108,7 @@ const getTickerValue=async ()=>{
 // 获取章节报告详情
 let info=ref(null)
 let audioData=ref(null)
+let isReportPublishCancel=ref(false)//报告取消发布了
 const getChapterReportDetail=async ()=>{
     console.log(chapterId.value);
     info.value=null
@@ -195,6 +197,8 @@ const getChapterReportDetail=async ()=>{
         wx.miniProgram.postMessage({ data: postData })
 
         getQRCodeImg()
+    }else if(res.code===4002){
+        isReportPublishCancel.value=true
     }
 }
 getChapterReportDetail()
@@ -531,6 +535,7 @@ const posterParams=computed(()=>{
             </div>
         </div>
     </div>
+    <report-cancel v-if="isReportPublishCancel"/>
 
     <!-- 图片预览 -->
     <el-image-viewer

+ 5 - 0
src/views/report/Detail.vue

@@ -17,6 +17,7 @@ import CollectBox from '@/components/CollectBox.vue'
 import collectIcon from '@/assets/collect2.png'
 import collectSIcon from '@/assets/collect2-s.png'
 import {addTokenToIframe} from '@/utils/common.js'
+import reportCancel from './components/reportCancel.vue'
 moment.locale('zh-cn')
 
 const route=useRoute()
@@ -58,6 +59,7 @@ const getReportPPTImgs=async ()=>{
 // 获取报告详情
 let info=ref(null)
 let audioData=ref(null)
+let isReportPublishCancel=ref(false)//报告取消发布了
 const getReportDetail=async ()=>{
     const res=await apiReportDetail({
         report_id:Number(reportId.value)
@@ -169,6 +171,8 @@ const getReportDetail=async ()=>{
         }
         wx.miniProgram.postMessage({ data: postData })
         
+    }else if(res.code===4002){
+        isReportPublishCancel.value=true
     }
 }
 getReportDetail()
@@ -575,6 +579,7 @@ const formatTitle=(e)=>{
             </div>
         </div>
     </div>
+    <report-cancel v-if="isReportPublishCancel"/>
 
     <!-- 图片预览 -->
     <el-image-viewer

+ 21 - 0
src/views/report/components/reportCancel.vue

@@ -0,0 +1,21 @@
+<script setup>
+
+</script>
+
+<template>
+    <div class="report-publish-cancel-wrap">
+        <p>您查看的报告不存在,请试试其他报告吧</p>
+        <div class="global-main-btn btn" @click="$router.replace('/')">返回首页</div>
+    </div>
+</template>
+
+<style lang="scss" scoped>
+.report-publish-cancel-wrap{
+    text-align: center;
+    padding-top: 150px;
+    .btn{
+        width: 120px;
+        margin: 30px auto;
+    }
+}
+</style>