瀏覽代碼

cygx8.3:接口调试

cxmo 2 年之前
父節點
當前提交
76e3776730
共有 1 個文件被更改,包括 64 次插入64 次删除
  1. 64 64
      reportPages/IndustryReport/IndustryReport.vue

+ 64 - 64
reportPages/IndustryReport/IndustryReport.vue

@@ -22,7 +22,7 @@
       </view>
       <view class="collect-ul">
         <!-- 其他tab -->
-        <block v-show="tabAct_id!==1">
+        <block v-show="tabAct_id!==99999">
           <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
             <view class="item-left">
               <text class="title text_twoLine"
@@ -33,22 +33,23 @@
             </view>
             <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
           </view>
-          <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
+          <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1&&tabAct_id!==99999" />
         </block>
         <!-- 时间线 -->
-        <block v-if="tabAct_id===1">
+        <block v-if="tabAct_id===99999">
           <view class="time-line">
-            <view class="line-item" v-for="(item,index) in timeLine" :key="index">
+            <view class="line-item" v-for="(item,index) in timeLine" :key="index" @click="goDetailFromTimeLine(item, index)">
               <view class="time">{{item.date}}</view>
-              <view class="content" v-if="item.content">
+              <view class="content" v-if="item.Content.length">
                 <rich-text class="rich-text"  :data-index="index" :class="{'expand':item.isExpand}"
-                  :nodes="item.content">
+                  :nodes="item.Content">
                 </rich-text> 
                 <view class="expan-btn" :class="{'pos':!item.isExpand}" @click="handleExpand(item,index)" v-if="item.isShowBtn">{{item.isExpand?'收起':'展开'}}</view>
               </view>
-              <view class="title" v-else>{{item.title}}</view>
+              <view class="title" v-else>{{item.Title}}</view>
             </view>
             <view v-show="loadTimeLine" class="loadTimeLine"></view>
+            <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
           </view>
         </block>
       </view>
@@ -94,39 +95,8 @@ export default {
       mockTimeLine:[
         {
           date:'不重要',
-          content:'<p>hello,world</p><p>hello,world</p><p>hello,world</p>'
+          Content:'<p>hello,world</p><p>hello,world</p><p>hello,world</p>'
         },//第一项是为了获取当前手机下,三行是多少相对高度
-        {
-          date:'2022.10.20',
-          isMeeting:true,
-          content:'<p>hello,world</p><p>hello,world</p><p>hello,world</p><p>hello,world</p>',
-          isExpand:true, //默认全部是展开的,获取富文本高度后,选择显示和不显示
-          isShowBtn:true,//默认展开/收起按钮也是显示的
-        },
-        {
-          date:'2022.10.19',
-          isMeeting:false,
-          title:'药调研016-IVD及高直耗材集采情况及影响研讨关于啥的凑字数'
-        },
-        {
-          date:'2022.10.18',
-          isMeeting:true,
-          content:'<p>hello,world啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的凑字数啥的</p>',
-          isExpand:true,
-          isShowBtn:true
-        },
-        {
-          date:'2022.10.17',
-          isMeeting:false,
-          title:'药调研016-IVD及高直耗材集采情况及影响研讨关于啥的凑字数'
-        },
-         {
-          date:'2022.10.16',
-          isMeeting:true,
-          content:'<p>hello,world</p>',
-          isExpand:true,
-          isShowBtn:true
-        },
       ],
       loadTimeLine:false
     };
@@ -149,9 +119,6 @@ export default {
         if (this.tabAct_id) {
           (this.page_no = 1), (this.collectList = []);
           this.getCollectList();
-          this.tabAct_id===1&&setTimeout(()=>{
-            this.getConentsHeight()
-          },300)
         }
       },
       immediate: true,
@@ -174,6 +141,7 @@ export default {
     toArticleCategoryList() {
       Reports.toArticleCategoryList({
         IndustrialManagementId: this.industrialManagementId,
+        ShowTimeLine:1
       }).then((res) => {
         if (res.Ret == 200) {
           uni.setNavigationBarTitle({
@@ -184,13 +152,6 @@ export default {
           if (res.Data.List) {
             this.tabAct_id = res.Data.List[0].CategoryId;
             this.tabBars = res.Data.List;
-            //just for test
-            this.tabBars.unshift({
-              CategoryId:1,
-              MatchTypeName:'时间线',
-              IsRed:false
-            })
-            this.tabAct_id = res.Data.List[0].CategoryId;
           }
         }
       });
@@ -198,13 +159,41 @@ export default {
     /* 获取列表 */
     getCollectList() {
       //just for test
-      if(this.tabAct_id===1) {
+      if(this.tabAct_id===99999) {
         this.loadTimeLine = true
-        this.timeLine = uni.$u.deepClone(this.mockTimeLine)
-        if (this.refresh) {
-          uni.stopPullDownRefresh();
-          this.refresh = false;
-        }
+        Reports.getArticleList({
+        PageSize: this.pageSize,
+        CurrentIndex: this.page_no,
+        CategoryId: 99999,
+        IndustrialManagementId: this.industrialManagementId,
+      }).then((res)=>{
+       if(res.Ret===200){
+         this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore"
+         this.totalPage = res.Data.Paging.Pages
+         let list = res.Data.List||[]
+         list = list.map(item=>{
+            let temp = item
+            temp.date = item.PublishTime.split(" ")[0]
+            temp.isExpand = true
+            temp.isShowBtn = true
+            return temp
+          })
+         if(this.page_no===1){
+          this.timeLine = list
+          this.haveData = this.timeLine.length ? true : false;
+          if (this.refresh) {
+            uni.stopPullDownRefresh();
+            this.refresh = false;
+          }
+         }else{
+           this.timeLine = this.timeLine.concat(list)
+         }
+       }
+        this.timeLine.unshift(this.mockTimeLine[0])
+        setTimeout(()=>{
+          this.getConentsHeight()
+        },300)
+      })
         return
       }
       Reports.getArticleList({
@@ -260,6 +249,7 @@ export default {
       const query = wx.createSelectorQuery()
       query.selectAll(".rich-text").boundingClientRect()
       query.exec(res=>{
+        //根据timeLine的第一项确定当前手机三行文字的高度
         const standardHeight = res[0][0].height 
         res[0].forEach(item=>{
           let temp = this.timeLine[item.dataset.index]
@@ -275,6 +265,23 @@ export default {
         this.timeLine.shift()
         this.loadTimeLine = false
       })
+    },
+    async goDetailFromTimeLine(item, index){
+      if(item.Content.length!==0) return;
+      await this.$store.dispatch("checkHandle");
+      if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+        // 已授权已绑定
+        if (item.IsHaveVideo) {
+          //跳转路演精华
+          uni.navigateTo({
+            url: "/reportPages/roadEssence/roadEssence?id=" + item.Id,
+          });
+        } else {
+          uni.navigateTo({
+            url: "/pageMy/reportDetail/reportDetail?id=" + item.Id,
+          });
+        }
+      }
     }
   },
   /* 触底 */
@@ -284,9 +291,6 @@ export default {
     this.page_no++;
     if (this.tabAct_id) {
       this.getCollectList();
-      this.tabAct_id===1&&setTimeout(()=>{
-            this.getConentsHeight()
-          },300)
     }
   }),
   /* 下拉刷新 */
@@ -295,9 +299,6 @@ export default {
       this.page_no = 1;
       this.refresh = true;
       this.getCollectList();
-      this.tabAct_id===1&&setTimeout(()=>{
-            this.getConentsHeight()
-          },300)
     }
   }),
   /**
@@ -435,8 +436,7 @@ export default {
     .time-line{
       margin-top:15rpx;
       padding:30rpx 40rpx 50rpx 40rpx;
-      height: calc(100vh - 190rpx);
-      overflow-y: scroll;
+      min-height: calc(100vh - 190rpx);
       background-color:#FFFFFF;
       position: relative;
       .loadTimeLine{
@@ -486,7 +486,7 @@ export default {
           z-index: 2;
         }
         .time{
-          width:205rpx;
+          width:245rpx;
           height: 55rpx;
           text-align: center;
           line-height: 45rpx;