瀏覽代碼

合并冲突

jwyu 2 年之前
父節點
當前提交
9578cff897
共有 4 個文件被更改,包括 32 次插入1 次删除
  1. 1 1
      src/api/http.js
  2. 5 0
      src/views/report/ChapterDetail.vue
  3. 5 0
      src/views/report/Detail.vue
  4. 21 0
      src/views/report/components/reportCancel.vue

+ 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

@@ -18,6 +18,7 @@ import collectIcon from '@/assets/collect2.png'
 import collectSIcon from '@/assets/collect2-s.png'
 import {addTokenToIframe} from '@/utils/common.js'
 import { onClickOutside } from '@vueuse/core'
+import reportCancel from './components/reportCancel.vue'
 moment.locale('zh-cn')
 
 const route=useRoute()
@@ -59,6 +60,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)
@@ -145,6 +147,8 @@ const getReportDetail=async ()=>{
         }
         wx.miniProgram.postMessage({ data: postData })
         
+    }else if(res.code===4002){
+        isReportPublishCancel.value=true
     }
 }
 getReportDetail()
@@ -656,6 +660,7 @@ const closeShowAttentionPop=()=>{
             </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>