瀏覽代碼

03/14 11:09

111
261568008@qq.com 5 年之前
父節點
當前提交
180cdc8a75
共有 1 個文件被更改,包括 113 次插入61 次删除
  1. 113 61
      src/views/audition/ManageEvaluation.vue

+ 113 - 61
src/views/audition/ManageEvaluation.vue

@@ -23,7 +23,7 @@
               <span class="actived">月报</span>
               <span>课次评价</span>
             </div>
-          </div> -->
+          </div>-->
           <div class="dropItem">
             <p class="dropTitle">评价进度</p>
             <div class="radioGroup">
@@ -34,14 +34,20 @@
           <div class="dropItem">
             <p class="dropTitle">提交作业</p>
             <div class="radioGroup">
-                <span :class="search.hasHandHomework==1?'actived':''" @click="search.hasHandHomework=1">是</span>
-              <span :class="search.hasHandHomework==0?'actived':''" @click="search.hasHandHomework=0">否</span>
+              <span
+                :class="search.hasHandHomework==1?'actived':''"
+                @click="search.hasHandHomework=1"
+              >是</span>
+              <span
+                :class="search.hasHandHomework==0?'actived':''"
+                @click="search.hasHandHomework=0"
+              >否</span>
             </div>
           </div>
           <div class="dropItem">
             <p class="dropTitle">完成双向沟通</p>
             <div class="radioGroup">
-                 <span :class="search.hasLiaison==1?'actived':''" @click="search.hasLiaison=1">是</span>
+              <span :class="search.hasLiaison==1?'actived':''" @click="search.hasLiaison=1">是</span>
               <span :class="search.hasLiaison==0?'actived':''" @click="search.hasLiaison=0">否</span>
             </div>
           </div>
@@ -52,23 +58,38 @@
         </van-dropdown-item>
       </van-dropdown-menu>
     </div>
-
-    <van-cell-group>
-      <van-cell
-        v-for="(item,index) in courseList"
-        :key="index"
-        class="cellGroup"
-        title="3月25日"
-        title-class="sectionTitle"
-        value-class="sectionValue"
-      >
-        <template solt="default">
-          <p class="content van-ellipsis">{{ item.courseName }}</p>
-          <van-button type="primary" round size="small"  v-if="item.reviewId==0" @click="submitReview(item)">提交评价</van-button>
-            <van-button type="primary" round size="small" v-if="item.reviewId>0" @click="submitReview(item)">修改评价</van-button>
-        </template>
-      </van-cell>
-    </van-cell-group>
+    <!--  -->
+    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+      <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList">
+        <van-cell
+          v-for="(item,index) in courseList"
+          :key="index"
+          class="cellGroup"
+          title="3月25日"
+          title-class="sectionTitle"
+          value-class="sectionValue"
+        >
+          <template solt="default">
+            <p class="content van-ellipsis">{{ item.courseName }}</p>
+            <van-button
+              type="primary"
+              round
+              size="small"
+              v-if="item.reviewId==0"
+              @click="submitReview(item)"
+            >提交评价</van-button>
+            <van-button
+              type="primary"
+              round
+              size="small"
+              v-if="item.reviewId>0"
+              @click="submitReview(item)"
+            >修改评价</van-button>
+          </template>
+        </van-cell>
+      </van-list>
+    </van-pull-refresh>
+    <!--  -->
     <!-- <m-empty class="empty" v-else key="data" /> -->
 
     <!-- 日期开始弹窗 -->
@@ -80,7 +101,7 @@
         :max-date="dateSection.maxDate"
         :formatter="formatter"
         @confirm="confirmStartTime()"
-        @cancel='cancelTime()'
+        @cancel="cancelTime()"
       />
     </van-popup>
     <!-- 日期结束弹窗 -->
@@ -92,7 +113,7 @@
         :max-date="dateSection.maxDate"
         :formatter="formatter"
         @confirm="confirmEndTime()"
-          @cancel='cancelTime()'
+        @cancel="cancelTime()"
       />
     </van-popup>
 
@@ -101,7 +122,7 @@
 </template>
 <script>
 import MEmpty from "@/components/MEmpty";
-import { getPracticeGroup} from '@/api/teacher'
+import { getPracticeGroup } from "@/api/teacher";
 export default {
   name: "teacherList",
   components: { MEmpty },
@@ -123,15 +144,19 @@ export default {
       },
       search: {
         status: false,
-        hasReview:null,
-        hasHandHomework:null,
-        hasLiaison:null,
+        hasReview: null,
+        hasHandHomework: null,
+        hasLiaison: null
       },
-        courseList:[]
+      courseList: [],
+      loading: false,
+      finished: false,
+      refreshing: false,
+      page:1
     };
   },
-  created(){
-         let params = this.$route.query;
+  created() {
+    let params = this.$route.query;
     if (params.Authorization) {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
       localStorage.setItem("userInfo", decodeURI(params.Authorization));
@@ -166,19 +191,21 @@ export default {
       this.dateSection.showStartDate = this.timeFormat(
         this.dateSection.currentDate
       );
-      this.getList()
+      this.onRefresh();
+      this.getList();
       this.dateSection.status = false;
     },
     confirmEndTime() {
       this.dateEndSection.showEndDate = this.timeFormat(
         this.dateEndSection.currentDate
       );
-       this.getList()
+      this.onRefresh();
+      this.getList();
       this.dateEndSection.status = false;
     },
-    cancelTime(){
-         this.dateEndSection.status = false;
-         this.dateSection.status = false;
+    cancelTime() {
+      this.dateEndSection.status = false;
+      this.dateSection.status = false;
     },
     timeFormat(time) {
       // 时间格式化 2019-09-08
@@ -187,33 +214,57 @@ export default {
       let day = time.getDate();
       return year + "/" + month + "/" + day;
     },
-    resetSerach(){
-        this.search = {
-              status: false,
-        hasReview:null,
-        hasHandHomework:null,
-        hasLiaison:null,
-        }
+    resetSerach() {
+      this.search = {
+        status: false,
+        hasReview: null,
+        hasHandHomework: null,
+        hasLiaison: null
+      };
     },
-    submitInfo(){
-        // 提交请求
-        this.getList();
-        this.search.status = false;
-        this.$refs.item.toggle();
+    submitInfo() {
+      // 提交请求
+      this.onRefresh();
+      this.getList();
+      this.search.status = false;
+      this.$refs.item.toggle();
     },
-    getList(){
-        
-        this.search.startTime = this.dateSection.showStartDate.replace(/\//g,'-')+' 00:00:00'
-         this.search.endTime = this.dateEndSection.showEndDate.replace(/\//g,'-')+' 23:59:59',
-         this.search.rows = 100;
-        getPracticeGroup(this.search).then(res=>{
-            if(res.data.code == 200){
-                this.courseList = res.data.data.rows;
-            }
-        })
+    getList() {
+      this.search.startTime =
+        this.dateSection.showStartDate.replace(/\//g, "-") + " 00:00:00";
+      (this.search.endTime =
+        this.dateEndSection.showEndDate.replace(/\//g, "-") + " 23:59:59"),
+         this.search.page=this.page;
+      if (this.refreshing) {
+        this.courseList = [];
+        this.refreshing = false;
+      }
+      getPracticeGroup(this.search).then(res => {
+        if (res.data.code == 200) {
+          this.page++
+          this.courseList = this.courseList.concat(res.data.data.rows) 
+          this.loading = false;
+          if(res.data.data.rows.length == 0){
+             this.finished = true;
+          }
+         
+        }
+      });
+    },
+    onRefresh() {
+      // 清空列表数据
+      this.finished = false;
+      this.page = 1;
+      // 重新加载数据
+      // 将 loading 设置为 true,表示处于加载状态
+      this.loading = true;
+      this.getList();
     },
-    submitReview(item){
-        this.$router.push({path:'/courseEvaluation',query:{id:item.id,reviewId:item.reviewId}})
+    submitReview(item) {
+      this.$router.push({
+        path: "/courseEvaluation",
+        query: { id: item.id, reviewId: item.reviewId }
+      });
     }
   }
 };
@@ -250,9 +301,10 @@ export default {
       }
     }
   }
-/deep/.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after{
+  /deep/.van-hairline--top-bottom::after,
+  .van-hairline-unset--top-bottom::after {
     border-width: 0 0;
-}
+  }
   /deep/.van-dropdown-menu__title {
     font-size: 0.17rem;
     color: #1a1a1a;