jwyu 2 жил өмнө
parent
commit
f79f82e24d

+ 7 - 0
api/report.js

@@ -107,4 +107,11 @@ export const apiChapterTickerValue=params=>{
  */
 export const apiReportPPtImgs=params=>{
     return httpGet('/report/ppt_img',params)
+}
+
+/**
+ * 大宗商品中用户已绑定的品种权限(不包含宏观权限)
+ */
+export const apiGoodsPermissionList=()=>{
+    return httpGet('/company/permission/commodities',{})
 }

+ 1 - 1
mixin/index.js

@@ -50,7 +50,7 @@ module.exports = {
      * 报告时间格式化
      */
     formatReportTime(e){
-      return moment(e).format('YYYY.MM.DD')
+      return moment(e).format('YYYY-MM-DD')
     }
 
   },

+ 11 - 3
pages-report/classify.vue

@@ -2,7 +2,7 @@
   <view class="classify-page">
     <swiper class="swiper" autoplay interval>
       <swiper-item>
-        <image @click="goFiccService" :src="globalImgUrls.ficcServiceImg" mode="aspectFill"/>
+        <image @click="goFiccService" :src="globalImgUrls.ficcServiceImg+'?t='+new Date().getDay()" mode="aspectFill"/>
       </swiper-item>
     </swiper>
     <view class="list">
@@ -45,7 +45,7 @@ export default {
     },
 
     goDetail(item){
-      //redirect_type : 跳转页面类型:1,专栏列表,2报告列表,3专栏详情
+      //redirect_type : 跳转页面类型:1,专栏列表,2报告列表,3专栏详情,4品种类型列表
       if(item.redirect_type==1){
         uni.navigateTo({ url: `/pages-report/specialColumn/list?classifyId=${item.classify_id_first}&classifyName=${item.classify_name_first}` })
       }
@@ -55,6 +55,9 @@ export default {
       if(item.redirect_type==3){
         uni.navigateTo({url:'/pages-report/specialColumn/detail?columnId='+item.classify_id_second})
       }
+      if(item.redirect_type==4){
+        uni.navigateTo({url:`/pages-report/varietyAuth/list?classifyId=${item.classify_id_first}&classifyName=${item.classify_name_first}`})
+      }
     },
 
     goFiccService(){
@@ -63,7 +66,12 @@ export default {
   }
 };
 </script>
-
+<style>
+page{
+    padding-bottom: constant(safe-area-inset-bottom);
+    padding-bottom: env(safe-area-inset-bottom);
+}
+</style>
 <style lang="scss" scoped>
 .classify-page {
   padding: 34rpx;

+ 51 - 52
pages-report/reportList.vue

@@ -24,11 +24,13 @@
         <image class="img" :src="item.report_img_url" mode="aspectFill" lazy-load />
         <view class="con">
           <view class="title" v-html="item.title"></view>
-          <view class="info" v-html="item.classify_name_second"></view>
-          <view class="time">{{item.stage}}期 | {{item.publish_time|formatReportTime}}</view>
-          <view :class="['audio-box',!item.auth_ok&&'grey-audio-box']" @click.stop="handleClickAudio(item)" v-if="item.auth_ok">
-            <image :src="curAudioReportId==item.report_id&&!curAudioPaused?'./static/audio-s.png':'./static/audio.png'" mode="aspectFill"/>
-            <text>{{curAudioReportId==item.report_id&&!curAudioPaused?'暂停':'播放'}}</text>
+          <view class="info">
+            <view v-html="item.classify_name_second" style="display:inline-block"></view>
+            <text v-if="item.classify_name_second" style="display:inline-block;margin:0 10rpx">&nbsp;·&nbsp;</text>
+            <text>{{item.stage}}期 | {{item.publish_time|formatReportTime}}</text>
+          </view>
+          <view class="audio-box" v-if="item.auth_ok" @click.stop="handleClickAudio(item)">
+            <image :src="curAudioReportId==item.report_id&&!curAudioPaused?'./static/a-play.png':'./static/a-pause.png'" mode="aspectFill"/>
           </view>
         </view>
       </view>
@@ -36,7 +38,7 @@
 
     <!-- 筛选 -->
     <van-popup :show="showFilter" position="bottom" :safe-area-inset-bottom="false" round @close="showFilter=false">
-        <view class="filter-wrap">
+        <view class="filter-wrap" @touchmove.stop>
             <view class="flex top">
                 <text style="color:#000">筛选</text>
                 <text style="color:#E3B377" @click="showFilter=false">取消</text>
@@ -93,10 +95,12 @@ export default {
         img_1:'',
         title_1:'',
         abstract_1:'',
+        abstract_1_style:'',
         time_1:'',
         img_2:'',
         title_2:'',
         abstract_2:'',
+        abstract_2_style:'',
         time_2:'',
       }
       if(this.list[0]){
@@ -104,12 +108,14 @@ export default {
         obj.title_1=this.list[0].title 
         obj.abstract_1=this.list[0].classify_name_second
         obj.time_1=`${this.list[0].stage}期 | ${moment(this.list[0].publish_time).format('YYYY.MM.DD')}`
+        obj.abstract_1_style=this.list[0].classify_name_second?'':'display:none'
       }
       if(this.list[1]){
         obj.img_2=this.list[1].report_img_url
         obj.title_2=this.list[1].title 
         obj.abstract_2=this.list[1].classify_name_second
         obj.time_2=`${this.list[1].stage}期 | ${moment(this.list[1].publish_time).format('YYYY.MM.DD')}`
+        obj.abstract_2_style=this.list[1].classify_name_second?'':'display:none'
       }
       return obj
     },
@@ -274,7 +280,8 @@ export default {
 
 <style>
 page{
-  padding-bottom: 0;
+  padding-bottom: constant(safe-area-inset-bottom);
+  padding-bottom: env(safe-area-inset-bottom);
 }
 </style>
 <style lang="scss" scoped>
@@ -298,58 +305,50 @@ page{
 }
 .report-list-wrap {
   padding: 0 34rpx;
-  .item {
-    padding-bottom: 30rpx;
+  .item{
     margin-bottom: 30rpx;
-    border-bottom: 1px solid #EDEDED;
-    .img {
-      width: 120rpx;
-      height: 180rpx;
+    position: relative;
+    .img{
+      width: 90rpx;
+      height: 120rpx;
       background-color: #f5f5f5;
+      border-radius: 8rpx;
+      overflow: hidden;
+      margin-right: 19rpx;
       flex-shrink: 0;
-      margin-right: 20rpx;
-      border-radius: 16rpx;
     }
-    .con {
+    .con{
+      padding-right: 100rpx;
       flex: 1;
-      position: relative;
-      overflow: hidden;
-      .title {
-        font-size: 32rpx;
-        font-weight: bold;
-        margin-bottom: 8rpx;
-      }
-      
-      .time {
-        position: absolute;
-        color: #666666;
-        bottom: 0;
-        left: 0;
-        font-size: 28rpx;
-      }
-      .audio-box {
-        position: absolute;
-        bottom: 0;
-        right: 0;
-        width: 99rpx;
-        height: 39rpx;
-        background: #E3B377;
-        border-radius: 20rpx;
-        color: #fff;
-        font-size: 24rpx;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        image{
-          width: 30rpx;
-          height: 30rpx;
-          margin-right: 4rpx;
-        }
-      }
-      .grey-audio-box {
-        background: linear-gradient(114deg, #b0b0b0 0%, #e5e2e2 100%);
+    }
+    .title{
+      font-size: 28rpx;
+      font-weight: bold;
+      margin-bottom: 10rpx;
+      min-height: 70rpx;
+    }
+    .info{
+      font-size: 24rpx;
+      color: #9C9791;
+    }
+    .audio-box{
+      position: absolute;
+      top: 50%;
+      transform: translateY(-50%);
+      width: 22px;
+      height: 20px;
+      background: linear-gradient(180deg, #F3A52F 0%, #E3B377 100%);
+      border-radius: 6px;
+      right: 20rpx;
+      text-align: center;
+      image{
+        width: 12px;
+        height: 12px;
+        position: relative;
+        top: 1px;
       }
     }
+
   }
 }
 .filter-wrap{

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


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


+ 243 - 0
pages-report/varietyAuth/list.vue

@@ -0,0 +1,243 @@
+<template>
+    <view class="varietyauth-report-list">
+        <van-sticky style="background: #fff">
+            <view class="top-variety-box">
+                <view class="first-nav">
+                    <text 
+                        :class="['first-nav-item',item.id===firstVarietyId?'active':'']" 
+                        v-for="item in varietyList" 
+                        :key="item.id"
+                        @click="handleSelectFirstVariety(item)"
+                    >{{item.classify_name}}</text>
+                </view>
+                <view class="sub-nav">
+                    <text 
+                    :class="['sub-nav-item',item.chart_permission_id===secVarietyId?'active':'']" 
+                    v-for="item in secVarietyList" 
+                    :key="item.chart_permission_id"
+                    @click="handleSelectSecVariety(item)"
+                >{{item.chart_permission_name}}</text>
+                </view>
+            </view>
+        </van-sticky>
+        <view class="report-empty-box" v-if="finished&&list.length==0">
+            <image :src="globalImgUrls.chartEmpty" mode="widthFix" />
+            <view>暂无报告</view>
+        </view>
+        <view class="report-list-wrap" v-else>
+            <view class="flex item" v-for="item in list" :key="item.report_id" @click="goReportDetail(item)">
+                <image class="img" :src="item.report_img_url" mode="aspectFill" lazy-load />
+                <view class="con">
+                    <view class="van-multi-ellipsis--l2 title">{{item.title}}</view>
+                    <view class="info">{{item.classify_name_second}} · {{item.stage}}期 | {{item.publish_time|formatReportTime}}</view>
+                </view>
+                <view class="audio-box">
+                    <image src="../static/a-pause.png" mode="aspectFill"/>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import {apiGetSceneToParams} from '@/api/common'
+import {apiGoodsPermissionList} from '@/api/report'
+const moment=require('@/utils/moment-with-locales.min')
+export default {
+    data() {
+        return {
+            classifyId:0,
+            classifyName:'',
+            varietyList:[],
+            firstVarietyId:0,//选择的一级品种id
+            secVarietyList:[],//二级品种
+            secVarietyId:0,//选择的二级品种id
+
+            list:[],
+            finished:false,
+            page:1,
+            pageSize:20
+        }
+    },
+    onLoad(opt){
+        this.init(opt)
+    },
+    onPullDownRefresh() {
+        this.page=1
+        this.list=[]
+        this.finished=false
+        this.getPermissionList()
+        setTimeout(() => {
+            uni.stopPullDownRefresh()
+        }, 1500);
+    },
+    onReachBottom() {
+        if(this.finished) return
+        this.page++
+        this.getList()
+    },
+    onShareAppMessage() {
+        return {
+            title:`FICC【${this.classifyName}】`
+        }
+    },
+    methods: {
+        async init(opt){
+            let classifyId=opt.classifyId||0
+            let classifyName=opt.classifyName
+            if(opt.scene){
+                const res=await apiGetSceneToParams({scene_key:opt.scene})
+                if(res.code===200){
+                    const obj=JSON.parse(res.data)
+                    classifyId=obj.classifyId
+                    classifyName=obj.classifyName
+                }
+            }
+            this.classifyId=classifyId
+            this.classifyName=decodeURIComponent(classifyName)
+            uni.setNavigationBarTitle({ title: this.classifyName })
+            this.getPermissionList()
+        },
+
+        //获取用户已绑定品种
+        async getPermissionList(){
+            const res=await apiGoodsPermissionList()
+            if(res.code===200){
+                this.varietyList=res.data.permission_list
+                this.handleSelectFirstVariety(this.varietyList[0])
+            }
+        },
+
+        //选择一级品种
+        handleSelectFirstVariety(item){
+            this.firstVarietyId=item.id
+            this.secVarietyList=item.list
+            this.handleSelectSecVariety(item.list[0])
+        },
+        //选择二级品种
+        handleSelectSecVariety(item){
+            this.secVarietyId=item.chart_permission_id
+            this.page=1
+            this.finished=false
+            this.list=[]
+            this.getList()
+        },
+
+        async getList(){
+
+        }
+    },
+}
+</script>
+
+<style>
+page{
+    padding-bottom: constant(safe-area-inset-bottom);
+    padding-bottom: env(safe-area-inset-bottom);
+}
+</style>
+
+<style lang="scss" scoped>
+.top-variety-box{
+    padding: 40rpx 34rpx 0 34rpx;
+    box-shadow: 0px 4rpx 4rpx rgba(198, 198, 198, 0.25);
+    .first-nav-item{
+        display: inline-block;
+        min-width: 140rpx;
+        line-height: 70rpx;
+        margin-right: 30rpx;
+        font-size: 32rpx;
+        color: #666;
+        text-align: center;
+        background: #F5F5F5;
+        border-radius: 4px;
+        box-sizing: border-box;
+        padding: 0 20rpx;
+        margin-bottom: 16rpx;
+        &.active{
+            color: #E3B377;
+            background: #FDF8F2;
+        }
+    }
+    .sub-nav{
+        overflow-x: auto;
+        white-space: nowrap;
+        padding: 16rpx 0;
+        &::-webkit-scrollbar{
+            width: 0;
+            height: 0;
+            display: none;
+        }
+        .sub-nav-item{
+            display: inline-block;
+            position: relative;
+            margin-right: 50rpx;
+            font-size: 28rpx;
+            color: #666;
+            position: relative;
+            &.active{
+                color: #E3B377;
+                &::after{
+                    content: '';
+                    display: block;
+                    width: 54rpx;
+                    height: 4rpx;
+                    background-color: #E3B377;
+                    position: absolute;
+                    bottom: -16rpx;
+                    left: 50%;
+                    transform: translateX(-50%);
+                }
+            }
+        }
+    }
+}
+.report-list-wrap{
+    padding: 34rpx;
+    .item{
+        margin-bottom: 30rpx;
+        position: relative;
+        .img{
+            width: 90rpx;
+            height: 120rpx;
+            background-color: #f5f5f5;
+            border-radius: 8rpx;
+            overflow: hidden;
+            margin-right: 19rpx;
+            flex-shrink: 0;
+        }
+        .con{
+            padding-right: 100rpx;
+            flex: 1;
+        }
+        .title{
+            font-size: 28rpx;
+            font-weight: bold;
+            margin-bottom: 10rpx;
+            min-height: 70rpx;
+        }
+        .info{
+            font-size: 24rpx;
+            color: #9C9791;
+        }
+        .audio-box{
+            position: absolute;
+            top: 50%;
+            transform: translateY(-50%);
+            width: 22px;
+            height: 20px;
+            background: linear-gradient(180deg, #F3A52F 0%, #E3B377 100%);
+            border-radius: 6px;
+            right: 20rpx;
+            text-align: center;
+            image{
+                width: 12px;
+                height: 12px;
+                position: relative;
+                top: 1px;
+            }
+        }
+
+    }
+}
+</style>

+ 7 - 0
pages.json

@@ -245,6 +245,13 @@
 					"style":{
 						"navigationStyle": "custom"
 					}
+				},
+				//按用户有权限品种分的报告列表页
+				{
+					"path": "varietyAuth/list",
+					"style":{
+						"enablePullDownRefresh": true
+					}
 				}
 			]
 		},