Browse Source

feat: 拟在建详情页空状态添加

cuiyalong 11 months ago
parent
commit
61d99e2a81
1 changed files with 58 additions and 1 deletions
  1. 58 1
      apps/jy-pc/src/views/proposed-detail/Detail.vue

+ 58 - 1
apps/jy-pc/src/views/proposed-detail/Detail.vue

@@ -1,6 +1,17 @@
 <template>
 <template>
   <Layout v-loading="loading" class="demand-detail">
   <Layout v-loading="loading" class="demand-detail">
-    <div class="proposed-detail">
+    <div class="empty-content" v-if="emptyContent">
+      <empty>
+        <div class="empty-text-content">
+          <p>{{ emptyReasonText }}</p>
+          <div class="empty-content-actions">
+            <p class="empty-content-actions-text">5s后自动跳转到剑鱼官网首页</p>
+            <button class="empty-content-actions-button" @click="goToJyHome">前往剑鱼官网首页</button>
+          </div>
+        </div>
+      </empty>
+    </div>
+    <div class="proposed-detail" v-else>
       <div class="head">
       <div class="head">
         <div class="action-right-container" v-if="loginIn">
         <div class="action-right-container" v-if="loginIn">
           <WorkspaceButtonGroup></WorkspaceButtonGroup>
           <WorkspaceButtonGroup></WorkspaceButtonGroup>
@@ -107,6 +118,7 @@ import InformationSummary from './components/InformationSummary.vue'
 import projectDebriefing from './components/projectDebriefing.vue'
 import projectDebriefing from './components/projectDebriefing.vue'
 import ProjectPerson from './components/ProjectPerson.vue'
 import ProjectPerson from './components/ProjectPerson.vue'
 import Credentials from './components/Credentials.vue'
 import Credentials from './components/Credentials.vue'
+import Empty from '@/components/empty/Empty.vue'
 import WorkspaceButtonGroup from '@/components/dialog/WorkspaceButtonGroup.vue'
 import WorkspaceButtonGroup from '@/components/dialog/WorkspaceButtonGroup.vue'
 import { getLoginStatus } from '@/api/modules/front'
 import { getLoginStatus } from '@/api/modules/front'
 import { getCommonAdList } from '@/api/modules/ad'
 import { getCommonAdList } from '@/api/modules/ad'
@@ -116,6 +128,7 @@ export default {
   name: 'proposed-detail',
   name: 'proposed-detail',
   components: {
   components: {
     Layout,
     Layout,
+    Empty,
     InformationSummary,
     InformationSummary,
     ProjectPerson,
     ProjectPerson,
     projectDebriefing,
     projectDebriefing,
@@ -124,6 +137,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      emptyContent: false,
+      emptyReasonText: '该页面信息不存在',
       isVisible: false,
       isVisible: false,
       loading: false,
       loading: false,
       loginIn: false,
       loginIn: false,
@@ -161,6 +176,14 @@ export default {
       }
       }
       this.tab = index
       this.tab = index
     },
     },
+    goToJyHome() {
+      window.top.location.href = '/'
+    },
+    startEmptyAutoGoHome() {
+      setTimeout(() => {
+        this.goToJyHome()
+      }, 5000)
+    },
     initdata() {
     initdata() {
       this.pid = this.$route.query.pid
       this.pid = this.$route.query.pid
       details({ pid: this.pid }).then((res) => {
       details({ pid: this.pid }).then((res) => {
@@ -191,6 +214,13 @@ export default {
                 .setAttribute('content', '拟在建详情')
                 .setAttribute('content', '拟在建详情')
             }
             }
           } catch (e) {}
           } catch (e) {}
+        } else {
+          const msg = res.error_msg || ''
+          if (msg.includes('不存在')) {
+            this.emptyReasonText = '由于相关部门要求,该信息已下架,敬请原谅'
+          }
+          this.emptyContent = true
+          this.startEmptyAutoGoHome()
         }
         }
       })
       })
     },
     },
@@ -249,6 +279,31 @@ export default {
 .mt-8 {
 .mt-8 {
   margin-top: 8px;
   margin-top: 8px;
 }
 }
+.empty-content {
+  width: 100%;
+  background-color: #fff;
+  p {
+    font-size: 16px;
+  }
+}
+.empty-text-content {
+  text-align: center;
+}
+.empty-content-actions {
+  margin-top: 6px;
+}
+.empty-content-actions-text {
+  margin-bottom: 6px;
+}
+.empty-content-actions-button {
+  width: 180px;
+  height: 40px;
+  font-size: 16px;
+  background-color: $main;
+  color: #fff;
+  border-radius: 4px;
+}
+
 .proposed-detail {
 .proposed-detail {
   padding-bottom: 20px;
   padding-bottom: 20px;
   .head {
   .head {
@@ -413,6 +468,8 @@ export default {
 }
 }
 .demand-detail {
 .demand-detail {
   width: 100%;
   width: 100%;
+  margin: 0 auto;
+  padding: 32px 0;
   ::v-deep {
   ::v-deep {
     .content-main {
     .content-main {
       display: flex;
       display: flex;