cxmo 8 mesi fa
parent
commit
25db65367b
3 ha cambiato i file con 108 aggiunte e 146 eliminazioni
  1. 9 5
      src/components/DisclaimersWrap.vue
  2. 1 1
      src/styles/vars.css
  3. 98 140
      src/views/report/Detail.vue

+ 9 - 5
src/components/DisclaimersWrap.vue

@@ -5,7 +5,7 @@ const show=defineModel('show',{type:Boolean,default:false})
 
 const text=ref('')
 function getSystemConfig(){
-  apiCommon.systemConfig().then(res=>{
+  /* apiCommon.systemConfig().then(res=>{
     if(res.Ret===200){
       const arr=res.Data||[]
       arr.forEach(item => {
@@ -14,7 +14,8 @@ function getSystemConfig(){
         }
       });
     }
-  })
+  }) */
+  text.value = `<p>123</p>`
 }
 getSystemConfig()
 
@@ -22,12 +23,15 @@ getSystemConfig()
 
 <template>
   <!-- 免责声明 -->
-  <t-dialog
+  <t-popup
     v-model:visible="show"
     title="免责声明"
+    placement="bottom"
     closeBtn
     closeOnOverlayClick
   >
-    <div v-html="text"></div>
-  </t-dialog>
+    <div class="text-wrap" style="padding:20px;overflow-y: hidden;height: 70vh;">
+        <div v-html="text" style="overflow-y: auto;height: 100%;"></div>
+    </div>
+  </t-popup>
 </template>

+ 1 - 1
src/styles/vars.css

@@ -1,5 +1,5 @@
 :root {
-  --primary-color: #053cc9;
+  --primary-color: #0078E8;
   --primary-color_sub: #dde6ff;
 
   --success-color: #4cd964;

+ 98 - 140
src/views/report/Detail.vue

@@ -34,7 +34,7 @@ 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 reportStatus = ref(4)//1已过期,2没有该品种权限,3没有权限,4有权限,5未绑定
 const reportCollected = ref(false)//报告是否收藏
 const isBind=ref(false)
 const headImgStyle=ref([])
@@ -44,7 +44,68 @@ const layoutBaseInfo=ref({
   '研报作者':'',
   '创建时间':''
 })
+
+// 报告内容分页
+const pageSize=20
+let page=0
+let endPageNum=0
+let contentTotals=[]
+const renderContentList=ref([])
+function splitReportContent(data){
+  const arr=data.split('</p>');
+  contentTotals=arr.map(_ => _+'</p>')
+  renderContentList.value=contentTotals.slice(0,pageSize)
+  endPageNum=parseInt(contentTotals.length / pageSize) + 1;
+}
+function handleLoadContent(){
+  renderContentList.value=renderContentList.value.concat(contentTotals.slice(page*pageSize,(page+1)*pageSize))
+}
+
+const mockReportInfo = {
+    Author:'咸鱼研究员',
+    AuthorId:1, 
+    PublishTime:'2023-02-02 12:12:30',
+    Abstract:'我是摘要',
+    IsFollowed:false,
+    Title:'普通研报海通小程序展示测试',
+    Content:`<p>123</p>`,
+    HasChapter:0,
+    HeadResource:{},
+    EndResource:{},
+}
+
+const mockSmartReportInfo = {
+    Author:'咸鱼研究员',
+    AuthorId:1, 
+    PublishTime:'2023-02-02 12:12:30',
+    Abstract:'我是摘要',
+    IsFollowed:false,
+    Title:'智能研报海通小程序展示测试',
+    HeadResource:{
+        ImgUrl:'https://hzstatic.hzinsights.com/static/images/202405/20240529/eRnhFYeYHjxy5wFUGQJDl14fcAJC.png',
+        Style:"[]"
+    },
+    EndResource:{
+        ImgUrl:'https://hzstatic.hzinsights.com/static/images/202405/20240529/A6DRtgPLnAH7Yj3ylPWwz4WccOor.png',
+        Style:"[]"
+    },
+    HasChapter:0,
+    Content:`<p>123</p>`
+}
 async function getReportInfo() {
+    //获取研报详情
+    //根据AuthorId获取研究员详情 及关注状态
+    reportInfo.value = mockSmartReportInfo
+    reportInfo.value.IsFollowed = false
+    headImgStyle.value=[]
+    endImgStyle.value=[]
+    layoutBaseInfo.value['研报标题']=reportInfo.value.Title
+    layoutBaseInfo.value['研报作者']=reportInfo.value.Author
+    layoutBaseInfo.value['创建时间']=reportInfo.value.PublishTime
+    reportContent.value = modifyReportContentIframeData(reportInfo.value.Content)
+    splitReportContent(reportContent.value)
+    return 
+
   if (!reportId) return
   const res = await apiReport.getReportDetail({
     ReportId: Number(reportId)
@@ -101,55 +162,6 @@ function formatIframeData() {
   splitReportContent(reportContent.value)
 }
 
-// 报告内容分页
-const pageSize=20
-let page=0
-let endPageNum=0
-let contentTotals=[]
-const renderContentList=ref([])
-function splitReportContent(data){
-  const arr=data.split('</p>');
-  contentTotals=arr.map(_ => _+'</p>')
-  renderContentList.value=contentTotals.slice(0,pageSize)
-  endPageNum=parseInt(contentTotals.length / pageSize) + 1;
-}
-function handleLoadContent(){
-  renderContentList.value=renderContentList.value.concat(contentTotals.slice(page*pageSize,(page+1)*pageSize))
-}
-
-// 拨打电话
-function handleCallPhone() {
-  let tel = userInfo.SellerPhone
-  if (!tel) {
-    systemConfig.forEach(item => {
-      if (item.ConfKey === 'ServicePhone') {
-        tel = item.ConfVal
-      }
-    });
-  }
-
-  var phoneLink = 'tel:' + tel;
-  var link = document.createElement('a');
-  link.setAttribute('href', phoneLink);
-  link.onclick = function () {
-    return true;
-  };
-  link.click();
-}
-
-// 点击收藏
-async function handleCollect() {
-  const res = reportCollected.value ? await apiReport.reportCollectCancel({ ReportId: Number(reportId) }) : await apiReport.reportCollect({ ReportId: Number(reportId) })
-  if (res.Ret === 200) {
-    Message.success(reportCollected.value ? '取消收藏成功' : '收藏成功')
-    reportCollected.value = !reportCollected.value
-    // 通知更新收藏列表
-    wx.miniProgram.postMessage({
-      data: 'refreshCollectList'
-    });
-  }
-}
-
 // 显示免责声明
 const isShowMZSM = ref(false)
 
@@ -202,13 +214,6 @@ onUnmounted(() => {
   window.removeEventListener('scroll', handlePageScroll)
 })
 
-function handleGoLogin(){
-  const redirectUrl=encodeURIComponent(`/pages-report/reportDetail/index?id=${route.query.reportid}`) 
-  wx.miniProgram.reLaunch({
-    url:`/pages/login/index?redirectUrl=${redirectUrl}`
-  })
-}
-
 </script>
 
 <template>
@@ -241,49 +246,49 @@ function handleGoLogin(){
     </div>
 
     <template v-if="!reportInfo.HeadResource.ImgUrl&&!reportInfo.EndResource.ImgUrl">
-    <div class="title-box">{{ reportInfo.Title }}</div>
-    <div class="author-box">{{ reportInfo.Author }}</div>
-    <div class="time-box">
-      <span>{{ reportInfo.PublishTime }}</span>
-      <span class="btn" @click="isShowMZSM = true">免责声明</span>
-    </div>
-    </template>
+        <div class="title-box">{{ reportInfo.Title }}</div>
+        <div class="author-box">{{ reportInfo.Author }}</div>
+        <div class="time-box">
+            <span>{{ reportInfo.PublishTime }}</span>
+            <span class="btn" @click="isShowMZSM = true">免责声明</span>
+        </div>
+   </template>
 
     <div class="des-box" v-if="reportInfo.Abstract">
-      <svg-icon name="icon01"></svg-icon>
-      <div>{{ reportInfo.Abstract }}</div>
+        <svg-icon name="icon01"></svg-icon>
+        <div>{{ reportInfo.Abstract }}</div>
     </div>
     <div
-      id="rich-content"
-      class="report-content-box rich-content"
-      v-html="reportContent"
-      v-if="reportStatus !== 4"
+        id="rich-content"
+        class="report-content-box rich-content"
+        v-html="reportContent"
+        v-if="reportStatus !== 4"
     />
     <template v-else>
-    <div
-      id="rich-content"
-      class="report-content-box rich-content"
-      v-if="reportInfo.HasChapter!==1"
-    >
-      <div v-for="item in renderContentList" :key="item" v-html="item"></div>
-    </div>
-    <!-- 章节报告 -->
-    <div
-      id="rich-content"
-      class="report-content-box rich-content"
-      v-if="reportInfo.HasChapter===1"
-    >
-      <div 
-        class="chapter-item-wrap" 
-        v-for="chapter,index in reportInfo.ChapterContent"
-        :key="index"
-      >
-        <div class="chapter-title">
-          <h3 class="chapter-title-text">{{chapter.Title}}</h3>
+        <div
+            id="rich-content"
+            class="report-content-box rich-content"
+            v-if="reportInfo.HasChapter!==1"
+        >
+            <div v-for="item in renderContentList" :key="item" v-html="item"></div>
+        </div>
+        <!-- 章节报告 -->
+        <div
+            id="rich-content"
+            class="report-content-box rich-content"
+            v-if="reportInfo.HasChapter===1"
+        >
+            <div 
+                class="chapter-item-wrap" 
+                v-for="chapter,index in reportInfo.ChapterContent"
+                :key="index"
+            >
+                <div class="chapter-title">
+                <h3 class="chapter-title-text">{{chapter.Title}}</h3>
+                </div>
+                <div v-html="chapter.Content"></div>
+            </div>
         </div>
-        <div v-html="chapter.Content"></div>
-      </div>
-    </div>
     </template>
     
 
@@ -310,13 +315,6 @@ function handleGoLogin(){
     </div>
     <!-- 右侧悬浮操作栏 -->
     <div class="right-fix-box">
-      <!-- 收藏 -->
-      <svg-icon
-        @click="handleCollect"
-        class="item collect-icon"
-        :name="reportCollected ? 'collected' : 'collect'"
-        v-if="reportStatus === 4"
-      />
       <!-- 返回顶部 -->
       <div class="item back-top-img">
         <svg-icon
@@ -328,46 +326,6 @@ function handleGoLogin(){
       </div>
     </div>
   </div>
-  <!-- 无权限  -->
-  <div class="no-auth-wrap" v-if="reportStatus !== 4">
-    <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>
-      <t-button
-        theme="primary"
-        block
-        style="width: 300px; margin: 30px auto"
-        @click="handleCallPhone"
-        >立即联系</t-button
-      >
-    </div>
-  </div>
-  <!-- 未绑定 -->
-  <div class="no-auth-wrap" v-if="reportStatus === 5&&!isBind">
-    <div class="opcity-box"></div>
-    <div class="content-box">
-      <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
-      <div class="text">
-        为了优化您的用户体验<br />请登录后查看更多信息!
-      </div>
-      <t-button
-        theme="primary"
-        block
-        style="width: 300px; margin: 30px auto"
-        @click="handleGoLogin"
-        >去登陆</t-button
-      >
-    </div>
-  </div>
   <!-- 免责声明 -->
   <disclaimers-wrap v-model:show="isShowMZSM" />
 </template>