jwyu 3 жил өмнө
parent
commit
ae13ff819e

+ 97 - 5
pages-report/chapterDetail.vue

@@ -1,13 +1,14 @@
 <template>
   <view class="chapter-detail-page" v-if="info">
     <view class="main-box">
-      <view class="title">【第{{info.report_chapter_item.stage}}期 | {{info.report_chapter_item.type_name}}】{{info.report_chapter_item.title}}</view>
+      <view class="title">【第{{info.report_chapter_item.stage}}期 | {{info.report_chapter_item.classify_name_first}}  | {{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="./static/audio-pause.png" mode="aspectFill" />
+        <image style="opacity:0.3" src="./static/audio-pause.png" mode="aspectFill" v-if="!info.auth_ok"/>
+        <image src="./static/audio-pause.png" mode="aspectFill" v-else/>
         <view>
           <view>{{info.report_chapter_item.video_name}}</view>
           <view style="color: #999999">{{info.report_chapter_item.video_play_seconds|formatVoiceTime}}</view>
@@ -18,7 +19,20 @@
         <text style="color: #e3b377; margin-left: 20rpx" @click="showDisclaimers = true">免责声明</text>
       </view>
       <view class="rich-content">
-        <mp-html :content="info.report_chapter_item.content" />
+        <mp-html :content="info.report_chapter_item.content" v-if="info.auth_ok" />
+        <mp-html :content="info.report_chapter_item.content_sub" v-else />
+      </view>
+      <!-- 无权限 -->
+      <view class="no-auth-wrap" v-if="!info.auth_ok">
+        <view class="apply-box" v-if="info.permission_check.type=='apply'">
+          <view>您暂无权限查看报告,若想查看请申请开通</view>
+          <view class="btn" @click="handleGoApply">立即申请</view>
+        </view>
+        <view class="apply-box" v-else>
+          <view>您暂无权限查看报告 </view>
+          <view>若想查看请联系对口销售:{{info.permission_check.name}}</view>
+          <view class="btn" @click="handleContact">立即联系</view>
+        </view>
       </view>
       <!-- 指标数据模块 -->
       <view class="ticker-wrap" v-if="tickerInfo">
@@ -36,7 +50,7 @@
       </view>
     </view>
     <!-- 章节详情底部快速切换 -->
-    <view class="chapter-list-wrap">
+    <view class="chapter-list-wrap" v-if="formPage!='home'">
       <view class="top-text">更多</view>
       <van-row gutter="10">
         <van-col span="6" v-for="item in info.report_chapter_menu_list" :key="item.report_chapter_id">
@@ -65,6 +79,18 @@
         <view style="margin-bottom: 10rpx">4、在任何情况下,本公司不对客户/接受人/接受机构因使用报告中内容所引致的一切损失负责任,客户/接受人/接受机构需自行承担全部风险。</view>
       </view>
     </van-popup>
+
+    <!-- 申请提示弹窗 -->
+    <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
+        <view class="global-pup">
+            <view class="content">
+                <rich-text :nodes="pupData.content"></rich-text>
+            </view>
+            <view class="flex bot">
+                <view @click="pupData.show=false">知道了</view>
+            </view>
+        </view>
+    </van-popup>
   </view>
 </template>
 
@@ -78,15 +104,22 @@ export default {
       showDisclaimers: false, //显示免责声明
       html: "<h1>Hello World!</h1>",
       chapterId:0,
+      formPage:'',//如果是从首页(home)来的则隐藏底部切换
       info:null,
 
       tickerInfo:null,
       tickerHead:[],
 
+      pupData:{
+				show:false,
+				content:'',//弹窗html字符串
+			}
+
     };
   },
   onLoad(options) {
     this.chapterId=options.chapterId
+    this.formPage=options.formPage||''
     this.getDetail()
   },
   methods: {
@@ -166,7 +199,43 @@ export default {
       this.info=null
       this.getDetail()
       this.handleBackTop()
-    }
+    },
+
+    // 联系销售
+    handleContact(){
+      uni.makePhoneCall({
+        phoneNumber: this.info.permission_check.mobile
+      });
+    },
+
+    //点击申请
+    async handleGoApply(){
+      if(this.info.permission_check.type=='apply'){
+        if(this.info.permission_check.customer_info.has_apply){// 已经申请过
+          this.pupData.show=true
+					this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
+        }else{
+          if(!this.info.permission_check.customer_info.status||this.info.permission_check.customer_info.status!='流失'){
+            uni.redirectTo({
+              url:"/pages-applyPermission/applyPermission?source=4&from_page=报告详情"
+            })
+          }else{//主动调一次申请权限接口 
+            const res=await apiApplyPermission({
+              company_name:this.info.permission_check.customer_info.company_name,
+              real_name:this.info.permission_check.customer_info.name,
+              source:4,
+              from_page:'报告详情'
+            })
+            if(res.code===200){
+              this.pupData.show=true
+					    this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
+            }
+          }
+        }
+                
+      }
+    },
+
   },
 };
 </script>
@@ -232,6 +301,29 @@ page{
         font-size: 32rpx;
     }
 
+    .no-auth-wrap{
+      min-height: 200rpx;
+      background: linear-gradient(360deg, #FFFFFF 60%, rgba(255, 255, 255, 0) 88%);
+      position: relative;
+      top: -150rpx;
+      text-align: center;
+      font-size: 32rpx;
+      color: #E3B377;
+      .apply-box{
+        padding-top: 250rpx;
+      }
+      .btn{
+        width: 100%;
+        margin-left: auto;
+        margin-right: auto;
+        line-height: 80rpx;
+        background-color: #E6B77D;
+        border-radius: 4rpx;
+        color: #fff;
+        margin-top: 100rpx;
+      }
+    }
+
     .back-top-img{
         position: fixed;
         z-index: 99;

+ 6 - 0
pages-report/classify.vue

@@ -29,6 +29,12 @@ export default {
   onLoad(options) {
     this.getClassifyList()
   },
+  onPullDownRefresh() {
+    this.getClassifyList()
+    setTimeout(() => {
+      uni.stopPullDownRefresh()
+    }, 1500);
+  },
   methods: {
     async getClassifyList(){
       const res=await apiReportClassify()

+ 159 - 10
pages-report/reportDetail.vue

@@ -29,6 +29,19 @@
                     </view>
                 </view>
             </view>
+            <!-- 无权限 -->
+            <view class="no-auth-box" v-if="!info.auth_ok">
+                <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
+                <view class="apply-box" v-if="info.permission_check.type=='apply'">
+                    <view>您暂无权限查看报告,若想查看请申请开通</view>
+                    <view class="btn" @click="handleGoApply">立即申请</view>
+                </view>
+                <view class="apply-box" v-else>
+                    <view>您暂无权限查看报告 </view>
+                    <view>若想查看请联系对口销售:{{info.permission_check.name}}</view>
+                    <view class="btn" @click="handleContact">立即联系</view>
+                </view>
+            </view>
         </view>
 
         <!-- 报告详情 -->
@@ -39,7 +52,8 @@
                 <text>{{formatTime(info.report_info.publish_time)}}</text>
             </view>
             <view class="flex audio-wrap">
-                <image src="" mode="aspectFill"/>
+                <image style="opacity:0.3" src="./static/audio-pause.png" mode="aspectFill" v-if="!info.auth_ok"/>
+                <image src="./static/audio-pause.png" mode="aspectFill" v-else/>
                 <view>
                     <view>{{info.report_info.video_name}}</view>
                     <view style="color:#999999">{{info.report_info.video_play_seconds|formatVoiceTime}}</view>
@@ -51,12 +65,26 @@
             </view>
 
             <view class="rich-content">
-                <mp-html :content="info.report_info.content"/>
+                <mp-html :content="info.report_info.content" v-if="info.auth_ok" />
+                <mp-html :content="info.report_info.content_sub" v-else />
+            </view>
+
+            <!-- 无权限 -->
+            <view class="no-auth-wrap" v-if="!info.auth_ok">
+                <view class="apply-box" v-if="info.permission_check.type=='apply'">
+                    <view>您暂无权限查看报告,若想查看请申请开通</view>
+                    <view class="btn" @click="handleGoApply">立即申请</view>
+                </view>
+                <view class="apply-box" v-else>
+                    <view>您暂无权限查看报告 </view>
+                    <view>若想查看请联系对口销售:{{info.permission_check.name}}</view>
+                    <view class="btn" @click="handleContact">立即联系</view>
+                </view>
             </view>
 
             <!-- 返回顶部 -->
             <image v-if="" @click="handleBackTop" class="back-top-img" src="./static/back-top.png" mode="aspectFill"/>
-        </view> 
+        </view>
 
         <!-- 免责声明 -->
         <van-popup :show="showDisclaimers" @close="showDisclaimers=false" round closeable>
@@ -68,6 +96,18 @@
                 <view style="margin-bottom:10rpx">4、在任何情况下,本公司不对客户/接受人/接受机构因使用报告中内容所引致的一切损失负责任,客户/接受人/接受机构需自行承担全部风险。</view>
             </view>
         </van-popup>
+
+        <!-- 申请提示弹窗 -->
+        <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
+            <view class="global-pup">
+                <view class="content">
+                    <rich-text :nodes="pupData.content"></rich-text>
+                </view>
+                <view class="flex bot">
+                    <view @click="pupData.show=false">知道了</view>
+                </view>
+            </view>
+        </van-popup>
     </view>
 </template>
 
@@ -75,42 +115,74 @@
 const moment=require('@/utils/moment-with-locales.min')
 moment.locale('zh-cn');
 import {apiReportDetail} from '@/api/report'
+import {apiApplyPermission} from '@/api/user'
 export default {
     data () {
         return {
             showDisclaimers:false,//显示免责声明
-            html:'<h1>Hello World!</h1>',
             reportId:0,
             info:null,
-            chapterList:[]
+            chapterList:[],
+            pupData:{
+				show:false,
+				content:'',//弹窗html字符串
+			}
         }
     },
     onLoad(options) {
         this.reportId=options.reportId
         this.getDetail()
     },
+    onPullDownRefresh() {
+        this.getDetail()
+        setTimeout(() => {
+            uni.stopPullDownRefresh()
+        }, 1500);
+    },
     methods: {
+        //获取报告详情
         async getDetail(){
             const res=await apiReportDetail({report_id:Number(this.reportId)})
             if(res.code===200){
                 this.info=res.data
                 this.chapterList=res.data.report_chapter_list
                 uni.setNavigationBarTitle({ title: res.data.report_info.classify_name_first })
+                if(!res.data.auth_ok){
+                    // 获取详情如果为联系销售根据判断条件是否主动申请一次
+                    if(this.info.permission_check.type=='contact'&&!this.info.permission_check.customer_info.has_apply){
+                        if(this.info.permission_check.customer_info.status=='冻结'||(this.info.permission_check.customer_info.status=='试用'&&this.info.permission_check.customer_info.is_suspend==1)){
+                            apiApplyPermission({
+                                company_name:this.info.permission_check.customer_info.company_name,
+                                real_name:this.info.permission_check.customer_info.name,
+                                source:4,
+                                from_page:'报告详情'
+                            }).then(res=>{
+                                if(res.code===200){
+                                    console.log('主动申请成功');
+                                }
+                            }) 
+                        }
+                    }
+                }
             }
         },
-
+        
+        //返回顶部
         handleBackTop(){
             uni.pageScrollTo({ scrollTop: 0 })
         },
 
+        //跳转章节详情
         goChapterDetail(item){
             uni.navigateTo({ url: '/pages-report/chapterDetail?chapterId='+item.report_chapter_id })
         },
-
+        
+        // 格式化时间
         formatTime(time){
             return moment(time).format('YYYY-MM-DD HH:mm:ss')
         },
 
+        // 格式化章节列表时间
         formatChapterTime(time,type){
             if(type==='day'){
                 return moment(time).format('DD')
@@ -124,7 +196,43 @@ export default {
             if(type==='year-month-day'){
                 return moment(time).format('YYYY-MM-DD')
             }
-        }
+        },
+
+        // 联系销售
+        handleContact(){
+            uni.makePhoneCall({
+                phoneNumber: this.info.permission_check.mobile
+            });
+        },
+
+        //点击申请
+        async handleGoApply(){
+            if(this.info.permission_check.type=='apply'){
+                if(this.info.permission_check.customer_info.has_apply){// 已经申请过
+                    this.pupData.show=true
+					this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
+                }else{
+                    if(!this.info.permission_check.customer_info.status||this.info.permission_check.customer_info.status!='流失'){
+                        uni.redirectTo({
+                            url:"/pages-applyPermission/applyPermission?source=4&from_page=报告详情"
+                        })
+                    }else{//主动调一次申请权限接口 
+                        const res=await apiApplyPermission({
+                            company_name:this.info.permission_check.customer_info.company_name,
+                            real_name:this.info.permission_check.customer_info.name,
+                            source:4,
+                            from_page:'报告详情'
+                        })
+                        if(res.code===200){
+                            this.pupData.show=true
+					        this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
+                        }
+                    }
+                }
+                
+            }
+        },
+
     }
 }
 </script>
@@ -155,7 +263,6 @@ export default {
             width: 110rpx;
             height: 110rpx;
             display: block;
-            background-color: rgb(233, 230, 230);
             margin-right: 16rpx;
         }
     }
@@ -185,6 +292,29 @@ export default {
         font-size: 32rpx;
     }
 
+    .no-auth-wrap{
+      min-height: 200rpx;
+      background: linear-gradient(360deg, #FFFFFF 60%, rgba(255, 255, 255, 0) 88%);
+      position: relative;
+      top: -150rpx;
+      text-align: center;
+      font-size: 32rpx;
+      color: #E3B377;
+      .apply-box{
+        padding-top: 250rpx;
+      }
+      .btn{
+        width: 100%;
+        margin-left: auto;
+        margin-right: auto;
+        line-height: 80rpx;
+        background-color: #E6B77D;
+        border-radius: 4rpx;
+        color: #fff;
+        margin-top: 100rpx;
+      }
+    }
+
     .back-top-img{
         position: fixed;
         z-index: 99;
@@ -238,7 +368,7 @@ export default {
             margin-top: -50rpx;
             border-top-left-radius: 40rpx;
             border-top-right-radius: 40rpx;
-            min-height: 200rpx;
+            min-height: 100rpx;
             background-color: #fff;
             position: relative;
             z-index: 2;
@@ -282,6 +412,25 @@ export default {
                 }
             }
         }
+        .no-auth-box{
+            text-align: center;
+            font-size: 32rpx;
+            color: #E3B377;
+            img{
+                width: 100%;
+                margin-bottom: 50rpx;
+            }
+            .btn{
+                width: 90%;
+                margin-left: auto;
+                margin-right: auto;
+                line-height: 80rpx;
+                background-color: #E6B77D;
+                border-radius: 4rpx;
+                color: #fff;
+                margin-top: 100rpx;
+            }
+        }
     }
 }
 </style>

+ 3 - 3
pages-report/reportList.vue

@@ -17,10 +17,10 @@
       <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" />
         <view class="con">
-          <view class="title">【第{{item.stage}}期|FICC】{{item.title}}</view>
-          <view class="van-ellipsis tips">摘要:{{item.abstract}}</view>
+          <view class="title" v-html="item.title"></view>
+          <view class="van-ellipsis tips" v-html="item.abstract"></view>
           <view class="time">{{item.publish_time|formatReportTime}}</view>
-          <view class="audio-box">
+          <view :class="['audio-box',!item.auth_ok&&'grey-audio-box']">
             <image src="./static/audio.png" mode="aspectFill"/>
             <text>播放</text>
           </view>

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

@@ -26,14 +26,14 @@
                     <view class="title">【第{{item.stage}}期|FICC】{{item.classify_name_second}}</view>
                     <view class="van-ellipsis tips">摘要:{{item.abstract}}</view>
                     <view class="time">{{item.publish_time|formatReportTime}}</view>
-                    <view class="audio-box">
+                    <view :class="['audio-box',!info.auth_ok&&'grey-audio-box']">
                         <image src="../static/audio.png" mode="aspectFill"/>
                         <text>播放</text>
                     </view>
                 </view>
             </view>
         </view>
-        <view class="contact-box">联系我们</view>
+        <view class="contact-box" v-if="!info.auth_ok&&!info.permission_check.mobile" @click="handleContact">联系我们</view>
     </view>
 </template>
 
@@ -103,6 +103,12 @@ export default {
 
         goDetail(item){
             uni.navigateTo({ url: '/pages-report/reportDetail?reportId='+item.report_id })
+        },
+
+        handleContact(){
+            uni.makePhoneCall({
+                phoneNumber: ''
+            })
         }
     }
 }

+ 8 - 3
pages.json

@@ -4,7 +4,8 @@
 			"path": "pages/report/report",
 			"style": {
 				"navigationBarTitleText": "报告",
-				"navigationStyle": "custom"
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
@@ -144,7 +145,8 @@
 				{
 					"path":"classify",
 					"style":{
-						"navigationBarTitleText":"FICC研报分类"
+						"navigationBarTitleText":"FICC研报分类",
+						"enablePullDownRefresh": true
 					}
 				},
 				{
@@ -176,7 +178,10 @@
 				},
 				//报告详情
 				{
-					"path": "reportDetail"
+					"path": "reportDetail",
+					"style":{
+						"enablePullDownRefresh": true
+					}
 				},
 				// 章节详情
 				{

+ 62 - 18
pages/report/report.vue

@@ -30,10 +30,10 @@
     </view>
     </view>
     <view class="list-wrap">
-      <view class="list-item" v-for="item in list" :key="item">
+      <view class="list-item" v-for="item in list" :key="item.date">
         <view class="time">{{item.date}}</view>
         <view class="content-list">
-          <view class="content-item" v-for="citem in item.sub_list" :key="citem">
+          <view class="content-item" v-for="citem in item.sub_list" :key="citem.report_id">
             <view class="content-box" @click="goDetail(citem)">
               <view class="all-btn">全部</view>
               <view class="c-time">{{citem.publish_time|getListTime}}</view>
@@ -49,6 +49,20 @@
         </view>
       </view>
     </view>
+
+    <!-- 联系销售弹窗 -->
+    <van-popup :show="authData.show" @close="authData.show=false" :close-on-click-overlay="false">
+      <view class="global-pup">
+          <view class="content">
+            <view>您暂无该品种权限,若想查看请联系对口销售--{{authData.contactInfo.name}}:{{authData.contactInfo.mobile}}
+            </view>
+          </view>
+          <view class="flex bot">
+            <view @click="authData.show=false" style="color:#A9AFB8">取消</view>
+            <view @click="handleCallPhone(authData.contactInfo.mobile)">拨号</view>
+          </view>    
+      </view>
+    </van-popup>
   </view>
 </template>
 
@@ -62,15 +76,6 @@ export default {
       return moment(e).format('HH:mm:ss')
     }
   },
-  watch: {
-    selectTopSubId(){
-      this.list=[]
-      this.dateArr=[]
-      this.page=1
-      this.finished=false
-      this.getReportList()
-    }
-  },
   data () {
     return {
       navBarStyle:{
@@ -79,6 +84,11 @@ export default {
         paddingBottom:'4px'
       },
 
+      authData:{
+        show:false,
+        isBuy:false,//是否为已购客户
+        contactInfo:''
+      },//如果是已购客户 并且点击了没有开通的品种则弹窗联系销售
       topFirstList:[],
       selectTopFirstId:0,
       topSubList:[],
@@ -95,6 +105,12 @@ export default {
     this.initNavBar()
     this.getTopAuthList()
   },
+  onPullDownRefresh() {
+    this.getTopAuthList()
+    setTimeout(() => {
+      uni.stopPullDownRefresh()
+    }, 1500);
+  },
   onReachBottom() {
     if(this.finished) return
     this.page++
@@ -114,10 +130,10 @@ export default {
     async getTopAuthList(){
       const res=await apiReportIndexPageAuthList()
       if(res.code===200){
-        this.topFirstList=res.data
-        this.selectTopFirstId=this.topFirstList[0].classify_name
-        this.topSubList=this.topFirstList[0].list
-        this.selectTopSubId=this.topSubList[0].chart_permission_id
+        this.authData.isBuy=res.data.check_flag
+        this.authData.contactInfo=res.data.contact_info
+        this.topFirstList=res.data.permission_list
+        this.handleClickTopFirst(this.topFirstList[0],0)
       }
     },
 
@@ -129,12 +145,28 @@ export default {
       }
       this.selectTopFirstId=item.classify_name
       this.topSubList=this.topFirstList[index].list
-      this.selectTopSubId=this.topSubList[0].chart_permission_id
+      this.handleClickTopSub(this.topSubList[0])
+      this.handleShowAuthData(this.topSubList[0])
     },
 
-    //点击顶部耳机分类
+    //点击顶部二级分类
     handleClickTopSub(item){
       this.selectTopSubId=item.chart_permission_id
+      this.list=[]
+      this.dateArr=[]
+      this.page=1
+      this.finished=false
+      this.getReportList()
+      this.handleShowAuthData(item)
+    },
+
+    // 判断是否要为已购用户且点击的品种没有权限
+    handleShowAuthData(e){
+      if(this.authData.isBuy){
+        if(!e.auth_ok){
+          this.authData.show=true
+        }
+      }
     },
 
     //获取报告列表
@@ -188,7 +220,19 @@ export default {
 
     //跳转报告详情
     goDetail(item){
-      uni.navigateTo({url:'/pages-report/reportDetail?reportId='+item.report_id})
+      if(['晨报','周报'].includes(item.classify_name_first)){
+        uni.navigateTo({url: `/pages-report/chapterDetail?chapterId=${item.report_chapter_id}&formPage=home`})
+      }else{
+        uni.navigateTo({url:'/pages-report/reportDetail?reportId='+item.report_id})
+      }
+      
+    },
+
+    // 拨打电话
+    handleCallPhone(tel){
+      uni.makePhoneCall({
+        phoneNumber: tel
+      });
     }
   }
 }