ソースを参照

fix:修复pdf详情及试用期客户能看到报告的问题

chenlei 1 ヶ月 前
コミット
db0752c131

BIN
src/assets/imgs/backtop.png


BIN
src/assets/imgs/logo.png


+ 0 - 3
src/assets/svg/icon01.svg

@@ -1,3 +0,0 @@
-<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M26.5439 24.9503H16.6326V17.9426C16.6326 15.0837 16.8853 12.8408 17.3909 11.2138C17.8965 9.58682 18.4222 8.50069 19.7978 7.19909C21.1734 5.89749 22.1279 5.5069 24.147 5L25.5577 7.97425C24.147 8.50267 23.2876 8.73835 21.9622 10.0864C20.6367 11.4345 20.5389 12.7384 20.5389 13.8591H26.5439V24.9503ZM12.9114 24.9503H3V17.9426C3 15.0837 3.25278 12.8408 3.75834 11.2138C4.26391 9.58682 4.78965 8.50069 6.16526 7.19909C7.54087 5.89749 8.49532 5.5069 10.5145 5L11.9251 7.97425C10.5145 8.50267 9.65508 8.73835 8.3296 10.0864C7.00412 11.4345 6.90635 12.7384 6.90635 13.8591H12.9114V24.9503Z" fill="#666666"/>
-</svg>

+ 7 - 31
src/views/report/Detail.vue

@@ -34,7 +34,7 @@ async function getUserInfo() {
   if (res.Ret === 200) {
     userInfo = res.Data
     isLogin.value = userInfo.LoginStatus === 0
-    TrialExpired.value = userInfo.TrialExpired
+    TrialExpired.value = userInfo.User.TrialExpired
   }
 }
 
@@ -86,7 +86,7 @@ async function getReportInfo() {
     }else{
       htmlStr=reportInfo.value.Content
     }
-    if (userInfo.Status === 2 && userInfo.HasPermission === '私有权限') {
+    if (userInfo.User.Status === 2) {
       htmlStr=modifyReportContentIframeData(htmlStr)
       htmlStr=formatIframeData(htmlStr)
     }else{
@@ -220,23 +220,6 @@ function handleGoLogin(){
     url:`/pages/login/index?redirectUrl=${redirectUrl}`
   })
 }
-
-const isTips = ref(false)
-const tipsMsg = ref('')
-// 申请认证
-function handleApplyCertification() {
-  apiUser.userApplyPermission().then(res=>{
-    if(res.Ret===200){
-      isTips.value = true
-      tipsMsg.value = res.Msg
-    } else {
-      Message.error(res.Msg)
-    }
-  })
-}
-function handleTips () {
-  isTips.value = false
-}
 </script>
 
 <template>
@@ -280,7 +263,7 @@ function handleTips () {
     <div class="des-box" v-if="reportInfo.Abstract">
       <!-- <svg-icon name="icon01"></svg-icon> -->
        <span class="des-title">摘要:</span>
-      <span>{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}{{ reportInfo.Abstract }}</span>
+      <span>{{reportInfo.Abstract}}</span>
     </div>
     <div
       id="rich-content"
@@ -314,12 +297,13 @@ function handleTips () {
     <div class="right-fix-box">
       <!-- 返回顶部 -->
       <div class="item back-top-img">
-        <svg-icon
-          name="backtop"
+        <img
+          src="@/assets/imgs/backtop.png"
+          alt=""
           v-show="showToTop"
           @click="handleBackTop"
           class="back-top-img"
-        />
+        >
       </div>
     </div>
   </div>
@@ -355,14 +339,6 @@ function handleTips () {
   </div>
   <!-- 免责声明 -->
   <disclaimers-wrap v-model:show="isShowMZSM" />
-  <t-dialog
-    :visible="isTips"
-    title="提示"
-    :content="tipsMsg"
-    confirm-btn="知道了"
-    @confirm="handleTips"
-  >
-  </t-dialog>
 </template>
 
 <style lang="scss" scoped>

+ 67 - 121
src/views/report/PDF.vue

@@ -10,22 +10,31 @@ const route = useRoute()
 
 // 获取系统配置
 let systemConfig = null
+const telephoneNum = ref('')
 function getSystemConfig() {
   apiCommon.systemConfig().then(res => {
     if (res.Ret === 200) {
       systemConfig = res.Data
-      console.log(res.Data);
+      systemConfig.forEach(item => {
+        if (item.ConfKey === 'ServicePhone') {
+          telephoneNum.value = item.ConfVal
+        }
+      });
     }
   })
 }
 getSystemConfig()
 
+const isLogin = ref(false)
+const TrialExpired = ref(false)
 // 获取用户信息
 let userInfo = ref(null)
 async function getUserInfo() {
   const res = await apiUser.userInfo()
   if (res.Ret === 200) {
     userInfo.value = res.Data
+    isLogin.value = userInfo.LoginStatus === 0
+    TrialExpired.value = userInfo.User.TrialExpired
   }
 }
 
@@ -33,9 +42,6 @@ async function getUserInfo() {
 
 const reportId = route.query.reportid
 const reportInfo = ref(null)
-const reportContent = ref('')
-const reportStatus = ref(0)//1已过期,2没有该品种权限,3没有权限,4有权限,5未绑定
-const reportCollected = ref(false)//报告是否收藏
 const isBind=ref(false)
 async function getReportInfo() {
   if (!reportId) return
@@ -44,8 +50,6 @@ async function getReportInfo() {
   })
   if (res.Ret === 200) {
     reportInfo.value = res.Data.Report
-    reportStatus.value = res.Data.Status
-    reportCollected.value = res.Data.IsCollect || false
     isBind.value=res.Data.IsSignIn
 
     // 设置分享文案
@@ -59,29 +63,16 @@ async function getReportInfo() {
 }
 getReportInfo()
 
-// 打电话按钮显示
-const callShow = ref(false)
-const phoneList = ref([])
-function handleCallShow() {
-  callShow.value = true
-  phoneList.value = userInfo.value.SellerDepartmentPhone || []
-  console.log(phoneList.value);
-  
-}
-function visiblechange(val) {
-  callShow.value = false
-}
 // 拨打电话
 function handleCallPhone(tel) {
-  visiblechange()
-  // let tel = userInfo.value.SellerPhone
-  // if (!tel) {
-  //   systemConfig.forEach(item => {
-  //     if (item.ConfKey === 'ServicePhone') {
-  //       tel = item.ConfVal
-  //     }
-  //   });
-  // }
+  let tel = userInfo.value.SellerPhone
+  if (!tel) {
+    systemConfig.forEach(item => {
+      if (item.ConfKey === 'ServicePhone') {
+        tel = item.ConfVal
+      }
+    });
+  }
 
   var phoneLink = 'tel:' + tel;
   var link = document.createElement('a');
@@ -92,19 +83,6 @@ function handleCallPhone(tel) {
   link.click();
 }
 
-// 点击收藏
-async function handleCollect() {
-  const res = reportCollected.value ? await apiReport.pdfReportCollectCancel({ ReportPdfId: Number(reportId) }) : await apiReport.pdfReportCollect({ ReportPdfId: Number(reportId) })
-  if (res.Ret === 200) {
-    Message.success(reportCollected.value ? '取消收藏成功' : '收藏成功')
-    reportCollected.value = !reportCollected.value
-    // 通知更新收藏列表
-    wx.miniProgram.postMessage({
-      data: 'refreshCollectList'
-    });
-  }
-}
-
 // 显示免责声明
 const isShowMZSM = ref(false)
 
@@ -135,27 +113,11 @@ function handleGoLogin(){
     url:`/pages/login/index?redirectUrl=${redirectUrl}`
   })
 }
-const isTips = ref(false)
-const tipsMsg = ref('')
-// 申请认证
-function handleApplyCertification() {
-  apiUser.userApplyPermission().then(res=>{
-    if(res.Ret===200){
-      isTips.value = true
-      tipsMsg.value = res.Msg
-    } else {
-      Message.error(res.Msg)
-    }
-  })
-}
-function handleTips () {
-  isTips.value = false
-}
 
 </script>
 
 <template>
-  <div :class="['report-detail-page',reportStatus !== 4||(reportStatus === 5&&!isBind)?'report-detail_hidden':'']" v-if="reportInfo">
+  <div :class="['report-detail-page', isLogin || TrialExpired ? 'report-detail_hidden' : '']" v-if="reportInfo">
     <div class="title-box">{{ reportInfo.Title }}</div>
     <div class="author-box">{{ reportInfo.Author }}</div>
     <div class="time-box">
@@ -163,100 +125,59 @@ function handleTips () {
       <span class="btn" @click="isShowMZSM = true">免责声明</span>
     </div>
     <div class="des-box" v-if="reportInfo.Abstract">
-      <svg-icon name="icon01"></svg-icon>
-      <div>{{ reportInfo.Abstract }}</div>
+      <!-- <svg-icon name="icon01"></svg-icon> -->
+      <span class="des-title">摘要:</span>
+      <span>{{ reportInfo.Abstract}}</span>
     </div>
     <div class="report-content-box rich-content">
       <preview-PDF :url="reportInfo.PdfUrl"/>
     </div>
     <!-- 右侧悬浮操作栏 -->
     <div class="right-fix-box">
-      <!-- 收藏 -->
-      <svg-icon
-        @click="handleCollect"
-        class="item collect-icon"
-        :name="reportCollected ? 'collected' : 'collect'"
-        v-if="reportStatus === 4 && userInfo?.Status === 2"
-      />
       <!-- 返回顶部 -->
       <div class="item back-top-img">
-        <svg-icon
-          name="backtop"
+        <img
+          src="@/assets/imgs/backtop.png"
+          alt=""
           v-show="showToTop"
           @click="handleBackTop"
           class="back-top-img"
-        />
+        >
       </div>
     </div>
   </div>
-  <!-- 无权限  -->
-  <div class="no-auth-wrap" v-if="reportInfo&&reportStatus !== 4">
+    <!-- 未绑定 -->
+    <div class="no-auth-wrap" v-if="isLogin">
     <div class="opcity-box"></div>
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
-      <div class="text" v-if="reportStatus === 3">
-        您暂无权限查看,<br />请申请认证!
-      </div>
-      <div class="text" v-if="reportStatus === 2">
-        您暂无该品种权限,<br />请联系销售人员开通!
-      </div>
-      <div class="text" v-if="reportStatus === 1">
-        您的权限已过期,<br />请联系销售人员开通!
+      <div class="text">
+        为了优化您的用户体验<br />请登录后查看更多信息!
       </div>
       <t-button
-        v-if="reportStatus !== 3"
-        theme="primary"
-        block
-        style="width: 300px; margin: 30px auto"
-        @click="handleCallShow"
-        >立即联系</t-button
-      >
-      <t-button
-        v-else
         theme="primary"
         block
         style="width: 300px; margin: 30px auto"
-        @click="handleApplyCertification"
-        >申请认证</t-button
+        @click="handleGoLogin"
+        >去登陆</t-button
       >
     </div>
   </div>
-  <!-- 未绑定 -->
-  <div class="no-auth-wrap" v-if="reportInfo&&reportStatus === 5&&!isBind">
+  <!-- 无权限  -->
+  <div class="no-auth-wrap" v-else-if="TrialExpired">
     <div class="opcity-box"></div>
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
       <div class="text">
-        为了优化您的用户体验<br />请登录后查看更多信息!
+        您的报告查看权限已到期,如有需要<br />请联系客户经理开通权限
+      </div>
+      <div class="num" @click="handleCallPhone()">
+        {{telephoneNum}}
       </div>
-      <t-button
-        theme="primary"
-        block
-        style="width: 300px; margin: 30px auto"
-        @click="handleGoLogin"
-        >去登陆</t-button
-      >
     </div>
   </div>
   <!-- 免责声明 -->
   <disclaimers-wrap v-model:show="isShowMZSM" />
-  <t-dialog
-    :visible="isTips"
-    title="提示"
-    :content="tipsMsg"
-    confirm-btn="知道了"
-    @confirm="handleTips"
-  >
-  </t-dialog>
-  <t-popup
-    :visible="callShow"
-    placement="bottom"
-    @visiblechange="visiblechange"
-  > 
-    <div class="call-box">
-      <div class="phone-item" v-for="(item, index) in phoneList" :key="index" @click="handleCallPhone(item)">{{ item }}</div>
-    </div>
-  </t-popup>
 </template>
 
 <style lang="scss" scoped>
@@ -278,14 +199,28 @@ function handleTips () {
     }
   }
   .des-box {
-    background-color: #f8f8f8;
+    background-color: #FEF9F4;
     padding: 20px;
     margin: 20px 0;
-    display: flex;
-    gap: 0 10px;
     color: var(--text-color-sub);
     font-size: var(--font-size-small);
     line-height: 36px;
+    position: relative;
+    &::before {
+      position: absolute;
+      top: 0;
+      left: 0;
+      content: '';
+      display: block;
+      height: 100%;
+      width: 1px;
+      background-color: #BC6031;
+    }
+    .des-title {
+      font-size: 30px;
+      font-weight: 600;
+      color: #666666;
+    }
   }
   .right-fix-box {
     position: fixed;
@@ -322,10 +257,21 @@ function handleTips () {
     );
   }
   .content-box {
+    --td-button-primary-border-color: #D49633;
+    --td-button-primary-active-bg-color:#BB5B29;
+    --td-button-primary-active-border-color:#BB5B29;
     background-color: #fff;
     padding-bottom: 200px;
     text-align: center;
-    color: var(--primary-color);
+    color: #D49633;
+    .text {
+      font-size: 28px;
+      margin-top: 20px;
+    }
+    .num {
+      margin-top: 20px;
+      font-size: 32px;
+    }
   }
 
   .icon {