jwyu 3 years ago
parent
commit
f4c7563eb4

+ 8 - 0
api/report.js

@@ -90,4 +90,12 @@ export const apiSpecialColumnDetail=params=>{
  */
 export const apiSpecialColumnReportList=params=>{
     return httpGet('/classify/detail/reports',params)
+}
+
+/**
+ * 章节详情中指标数据
+ * @param report_chapter_id
+ */
+export const apiChapterTickerValue=params=>{
+    return httpGet('/report/chapter/ticker',params)
 }

+ 1 - 1
mixin/index.js

@@ -42,7 +42,7 @@ module.exports = {
      */
     formatVoiceTime(e){
       let minus=parseInt(e/60)
-      let sec=e%60
+      let sec=parseInt(e%60)
       return `${minus>9?minus:'0'+minus}分${sec>9?sec:'0'+sec}秒`
     },
 

+ 150 - 9
pages-report/chapterDetail.vue

@@ -1,26 +1,39 @@
 <template>
   <view class="chapter-detail-page" v-if="info">
     <view class="main-box">
-      <view class="title">【第1期 | 原油周报】{{info.report_chapter_item.title}}</view>
+      <view class="title">【第{{info.report_chapter_item.stage}}期 | {{info.report_chapter_item.type_name}}】{{info.report_chapter_item.title}}</view>
       <view class="flex time">
         <text>FICC团队</text>
         <text>{{formatTime(info.report_chapter_item.publish_time)}}</text>
       </view>
       <view class="flex audio-wrap">
-        <image src="" mode="aspectFill" />
+        <image src="./static/audio-pause.png" mode="aspectFill" />
         <view>
-          <view>关注中美贸易政策变化</view>
-          <view style="color: #999999">1分31秒</view>
+          <view>{{info.report_chapter_item.video_name}}</view>
+          <view style="color: #999999">{{info.report_chapter_item.video_play_seconds|formatVoiceTime}}</view>
         </view>
       </view>
       <view class="tips">
         <text>注:请务必阅读</text>
         <text style="color: #e3b377; margin-left: 20rpx" @click="showDisclaimers = true">免责声明</text>
       </view>
-
       <view class="rich-content">
         <mp-html :content="info.report_chapter_item.content" />
       </view>
+      <!-- 指标数据模块 -->
+      <view class="ticker-wrap" v-if="tickerInfo">
+        <view class="top-title">{{tickerInfo.ticker_title.report_chapter_type_name}}数据表</view>
+        <view class="table-box">
+          <view class="table-row table-head">
+            <view class="table-item" v-for="item in tickerHead" :key="item.key">{{item.label}}</view>
+          </view>
+          <view class="table-row table-body" v-for="(tr,index) in tickerInfo.list" :key="tr.base_column_name">
+            <view :class="['table-item',index%2==0?'grey':'',tr[td.key]<0?'minus':'']" v-for="td in tickerHead" :key="td.key">{{tr[td.key]}}</view>
+          </view>
+        </view>
+        <view v-if="tickerInfo.ticker_title.report_chapter_type_id ===26" style="text-align:center;font-weight:bold">注:与新加坡TSR20相关数据均取展示日期前一交易日数据</view>
+        <view></view>
+      </view>
     </view>
     <!-- 章节详情底部快速切换 -->
     <view class="chapter-list-wrap">
@@ -58,7 +71,7 @@
 <script>
 const moment=require('@/utils/moment-with-locales.min')
 moment.locale('zh-cn');
-import {apiChapterDetail} from '@/api/report'
+import {apiChapterDetail,apiChapterTickerValue} from '@/api/report'
 export default {
   data() {
     return {
@@ -66,6 +79,10 @@ export default {
       html: "<h1>Hello World!</h1>",
       chapterId:0,
       info:null,
+
+      tickerInfo:null,
+      tickerHead:[],
+
     };
   },
   onLoad(options) {
@@ -77,6 +94,62 @@ export default {
       const res=await apiChapterDetail({report_chapter_id:Number(this.chapterId)})
       if(res.code===200){
         this.info=res.data
+        uni.setNavigationBarTitle({ title: res.data.report_chapter_item.classify_name_first })
+        if(res.data.report_chapter_item.classify_name_first==='晨报'){
+          this.getTickerValue()
+        }
+      }
+    },
+
+    //获取晨报中指标数据
+    async getTickerValue(){
+      const res=await apiChapterTickerValue({report_chapter_id:Number(this.chapterId)})
+      if(res.code===200){
+        if(!res.data.list) return
+        this.tickerInfo=res.data
+        if(res.data.ticker_title.report_chapter_type_id===17){
+          this.tickerHead=[
+            {
+              label:res.data.ticker_title.ticker_title,
+              key:'base_column_name'
+            },
+            {
+              label:'公布日期',
+              key:'date'
+            },
+            {
+              label:'最新值',
+              key:'ticker_value'
+            },
+            {
+              label:'上期值',
+              key:'last_value'
+            }
+          ]
+        }else{
+          this.tickerHead=[
+            {
+              label:res.data.ticker_title.ticker_title,
+              key:'base_column_name'
+            },
+            {
+              label:res.data.list[0].date,
+              key:'ticker_value'
+            },
+            {
+              label:'当日涨跌',
+              key:'dd_value'
+            },
+            {
+              label:'一周涨跌',
+              key:'ww_value'
+            },
+            {
+              label:'一月涨跌',
+              key:'mm_value'
+            }
+          ]
+        }
       }
     },
 
@@ -106,7 +179,7 @@ page{
 
 <style lang="scss" scoped>
 .chapter-detail-page {
-  .main-box{
+    .main-box{
         padding: 34rpx;
     }
     .title{
@@ -130,7 +203,6 @@ page{
             width: 110rpx;
             height: 110rpx;
             display: block;
-            background-color: rgb(233, 230, 230);
             margin-right: 16rpx;
         }
     }
@@ -168,7 +240,7 @@ page{
         right: 34rpx;
         bottom: 100rpx;
     }
-  .chapter-list-wrap {
+    .chapter-list-wrap {
     background-color: #f5f6fa;
     padding: 34rpx;
     min-height: 300px;
@@ -228,6 +300,75 @@ page{
         border-right: 46rpx solid transparent;
       } 
     }
+    }
+
+  .ticker-wrap{
+    margin-top: 30rpx;
+    .top-title{
+      text-align: center;
+      font-size: 36rpx;
+      font-weight: bold;
+      vertical-align: middle;
+      &::before,&::after{
+        content: '';
+        display: inline-block;
+        width: 100rpx;
+        height: 4rpx;
+        background-color:rgb(204, 204, 204);
+        vertical-align: middle;
+        margin: 0 20rpx;
+      }
+
+    }
+    .table-box{
+      margin: 20rpx 0;
+      &::-webkit-scrollbar{
+        width: 0;
+      }
+      overflow: auto hidden;
+      .table-row{
+        display: flex;
+        width: 100%;
+      }
+      .table-item{
+        padding: 10rpx;
+        min-width: 200rpx;
+        max-width: 280rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+      }
+      .table-head{
+        color: #fff;
+        background-color: rgb(58, 76, 115);
+        .table-item{
+          &:first-child{
+            position: sticky;
+            left: 0;
+            z-index: 5;
+            border-right-color: rgb(58, 76, 115);
+          }
+          background-color: rgb(58, 76, 115);
+        }
+      }
+      .table-body{
+        .table-item{
+          background-color: #fff;
+          &:first-child{
+            position: sticky;
+            left: 0;
+            z-index: 5;
+          }
+        }
+        .grey{
+          background-color: #ddd;
+        }
+        .minus{
+          color: #006600;
+        }
+      }
+    }
   }
+
 }
 </style>

+ 1 - 1
pages-report/reportDetail.vue

@@ -18,7 +18,7 @@
             </view>
             <view class="list-box">
                 <view class="flex item" v-for="item in chapterList" :key="item.report_chapter_id" @click="goChapterDetail(item)">
-                    <image class="img" :src="item.banner_url" mode="aspectFill" />
+                    <image class="img" :src="item.report_chapter_type_thumb" mode="aspectFill" />
                     <view class="con">
                         <view class="title">
                             {{item.report_chapter_type_name}} 

+ 8 - 1
pages-report/specialColumn/detail.vue

@@ -68,7 +68,7 @@ export default {
         },1500)
     },
     onReachBottom() {
-        if(!this.finished&&this.tabActive=='专栏介绍'){
+        if(!this.finished&&this.tabActive=='报告目录'){
             this.page++
             this.getList()
         }
@@ -108,6 +108,13 @@ export default {
 }
 </script>
 
+<style lang="scss">
+page{
+    padding-bottom: 0;
+}
+
+</style>
+
 <style lang="scss" scoped>
 .special-column-info-page{
     .top-bg{

BIN
pages-report/static/audio-pause.png


BIN
pages-report/static/audio-play.png