Forráskód Böngészése

风险测评状态控制

jwyu 2 hónapja
szülő
commit
c6bcdb1bf3

BIN
src/assets/imgs/lock-img.png


+ 0 - 4
src/router/index.js

@@ -11,10 +11,6 @@ importAllRoutes(import.meta.glob("./modules/*.js", { eager: true }));
 
 const routes = [
   ...appAllRoutes,
-  {
-    path:'/',
-    redirect: '/report/detail'
-  },
   // 绑定公众号
   {
     path:'/bindWXofficial',

+ 16 - 3
src/views/report/Detail.vue

@@ -25,6 +25,7 @@ const reportContent = ref('')
 const isFollowed = ref(false)
 const authorInfo=ref(null)
 const isLogin=ref(false)
+const riskLevelStatus=ref('')//expired过期的 unTest未测评 unMatch风险等级不匹配
 const headImgStyle = ref([])
 const endImgStyle = ref([])
 const layoutBaseInfo = ref({
@@ -59,6 +60,7 @@ async function getReportInfo() {
     authorInfo.value=authorInfo
     reportInfo.value = detail
     isLogin.value=res.data.login
+    riskLevelStatus.value=res.data.riskLevelStatus
     headImgStyle.value = reportInfo.value.headResource.style ? JSON.parse(reportInfo.value.headResource.style) : []
     endImgStyle.value = reportInfo.value.endResource.style ? JSON.parse(reportInfo.value.endResource.style) : []
     layoutBaseInfo.value['研报标题'] = reportInfo.value.title
@@ -313,7 +315,7 @@ function handleGoLogin() {
     </div>
   </div>
   <!-- 无权限\未登录  -->
-  <div class="no-auth-wrap">
+  <div class="no-auth-wrap" v-if="!isLogin||['expired','unTest','unMatch'].includes(riskLevelStatus)">
     <div class="opcity-box"></div>
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
@@ -327,6 +329,18 @@ function handleGoLogin() {
           >去登陆</t-button
         >
       </template>
+      <template v-else>
+        <div class="text" v-if="riskLevelStatus==='expired'">您的风险测评已过期,请完成风险测评</div>
+        <div class="text" v-if="riskLevelStatus==='unTest'">您尚未进行风险测评,请完成风险测评</div>
+        <div class="text" v-if="riskLevelStatus==='unMatch'">您的风险等级无法查看此内容<br>请查看其他内容</div>
+        <t-button
+          theme="primary"
+          block
+          style="width: 300px; margin: 30px auto"
+          v-if="['expired','unTest'].includes(riskLevelStatus)"
+          >风险测评</t-button
+        >
+      </template>
     </div>
   </div>
   <!-- 免责声明 -->
@@ -526,8 +540,7 @@ function handleGoLogin() {
   .icon {
     display: block;
     margin: 0 auto;
-    width: 200px;
-    height: 200px;
+    width: 100%;
   }
 }
 </style>

+ 19 - 4
src/views/report/PDF.vue

@@ -23,6 +23,8 @@ const defaultImg = new URL(`@/assets/imgs/default-author.png`, import.meta.url).
 const reportId = route.query.reportid
 const reportInfo = ref(null)
 const isFollowed = ref(false)
+const isLogin=ref(false)
+const riskLevelStatus=ref('')//expired过期的 unTest未测评 unMatch风险等级不匹配
 async function getReportInfo() {
   //获取研报详情
   if (!reportId) return
@@ -31,6 +33,8 @@ async function getReportInfo() {
   })
   if (res.Ret === 200 && res.ErrCode === 0) {
     reportInfo.value = res.data
+    isLogin.value=res.data.login
+    riskLevelStatus.value=res.data.riskLevelStatus
 
     getAuthorFollowState()
 
@@ -166,11 +170,11 @@ function handleGoLogin() {
     </div>
   </div>
   <!-- 无权限\未登录  -->
-  <div class="no-auth-wrap">
+  <div class="no-auth-wrap" v-if="!isLogin||['expired','unTest','unMatch'].includes(riskLevelStatus)">
     <div class="opcity-box"></div>
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
-      <template v-if="!reportInfo?.login">
+      <template v-if="!isLogin">
         <div class="text">您尚未登录,请登录后查看</div>
         <t-button
           theme="primary"
@@ -180,6 +184,18 @@ function handleGoLogin() {
           >去登陆</t-button
         >
       </template>
+      <template v-else>
+        <div class="text" v-if="riskLevelStatus==='expired'">您的风险测评已过期,请完成风险测评</div>
+        <div class="text" v-if="riskLevelStatus==='unTest'">您尚未进行风险测评,请完成风险测评</div>
+        <div class="text" v-if="riskLevelStatus==='unMatch'">您的风险等级无法查看此内容<br>请查看其他内容</div>
+        <t-button
+          theme="primary"
+          block
+          style="width: 300px; margin: 30px auto"
+          v-if="['expired','unTest'].includes(riskLevelStatus)"
+          >风险测评</t-button
+        >
+      </template>
     </div>
   </div>
   <!-- 免责声明 -->
@@ -311,8 +327,7 @@ function handleGoLogin() {
   .icon {
     display: block;
     margin: 0 auto;
-    width: 200px;
-    height: 200px;
+    width: 100%;
   }
 }
 </style>