Explorar el Código

继续教育支持多个年度

y595705120 hace 2 años
padre
commit
352b28a2fc

+ 17 - 1
src/containers/center/market/index.css

@@ -11,4 +11,20 @@
 .notice{
     color: red;
     margin: 0 -8px;
-}
+}
+
+.nav-btn-years{
+  border: 1px ;
+  font-size: 16px;
+  font-weight: 600;
+  margin: 4px;
+  padding: 4px 40px 4px 40px;
+  border: 1px solid #EBEEF5;
+  text-align: center;
+
+}
+
+.nav-btn-years:hover{
+  background: none;
+  color: #5a9fd9;
+}

+ 40 - 9
src/containers/center/market/index.vue

@@ -24,8 +24,17 @@
         </p>
       </div>
 
-      <ul class="m-course-list clear mt10 classlist" v-if="total>0">
-        <li v-for="(item,index) in list" :key="item.course_id" class="pt-sola mt20 pb10">
+      <ul class="pt-line mt20" v-if="ndList.length>1">
+        <li style="float: left;font-size: 16px;margin: 4px;padding: 4px;" >
+            <span>课程年度:</span>
+        </li>
+        <li v-for="item in ndList" style="float: left;">
+          <span :class="{active:item==nd }" class="nav-btn-years" @click="nd=item">{{item}} </span>
+        </li>
+      </ul>
+
+      <ul class="m-course-list clear mt10 classlist">
+        <li v-for="(item,index) in list.slice(page*size-size, page*size)" :key="item.course_id" class="pt-sola mt20 pb10">
           <div>
             <span v-if="item.isFinish==1" class="p-ico2 ico-passed"></span>
             <div class="img">
@@ -66,8 +75,12 @@
         </li>
       </ul>
 
-      <el-pagination class="m-pages" @current-change="handleCurrentChange" :current-page="page" :page-size="size"
-        layout="total, prev, pager, next" :total="total">
+      <el-pagination class="m-pages"
+        @current-change="(page)=>{this.page=page}"
+        :current-page="page"
+        :page-size="size"
+        layout="total, prev, pager, next"
+        :total="list.length">
       </el-pagination>
 
     </div>
@@ -241,7 +254,7 @@
     data() {
       return {
         page: 1,
-        size: 9,
+        size: 6,
         total: 0,
         stage: 0,
         isCompanyPay: 0,
@@ -277,6 +290,9 @@
         media: {},
         commitmentDialog: false,
         exampleImg: exampleImg,
+        nd: new Date().getFullYear()+'',
+        ndList:[],
+        allList:[],
         rules: {
           rzCode: [{
             required: true,
@@ -336,8 +352,12 @@
     watch: {
       type(val) {
         this.page = 1
+        this.nd = new Date().getFullYear()+''
         this.getData()
       },
+      nd(val){
+        this.filterData()
+      },
       isCommitment(val) {
         console.log(val)
       }
@@ -372,17 +392,28 @@
       getData() {
         if (!this.type) return;
         let param = {
-          size: this.size,
+          size: 100,
           type: this.type,
-          from: (this.page - 1) * this.size
+          from: 0
         }
         httpServer("course.getcoursemarket", param).then((res) => {
           if (res.code == 200) {
-            this.list = res.data.list;
-            this.total = res.data.total;
+            this.allList = res.data.list;
+            this.ndList = [];
+            for( let i in this.allList ){
+              let nd = this.allList[i].nd;
+              if(this.ndList.indexOf( nd ) == -1 ) this.ndList.push( nd );
+            }
+            this.filterData()
           }
         });
       },
+      filterData(){
+        let nd = this.nd;
+        this.list = this.allList.filter( res=>{
+          return res.nd == nd;
+        })
+      },
       cancelBuyCourse(){
         this.$refs["elForm"].resetFields();
         this.buyCourseDialog=false

+ 4 - 3
src/containers/center/play/components/media.vue

@@ -20,8 +20,8 @@
           <span>{{media.duration|useTime}}</span>
         </el-col>
         <el-col :span="8" class="media-center">
-          <el-button class="bicon" v-if="onPlay" type="primary" @click="doPause" icon="el-icon-video-play" circle></el-button>
-          <el-button class="bicon" v-else  type="warning" @click="doPlay" icon="el-icon-video-pause" circle></el-button>
+          <el-button class="bicon" v-if="!onPlay" type="primary" @click="doPlay" icon="el-icon-video-play" circle></el-button>
+          <el-button class="bicon" v-else  type="warning" @click="doPause" icon="el-icon-video-pause" circle></el-button>
         </el-col>
         <el-col :span="8" class="media-select">
           <el-button class="bicon"  type="danger" icon="el-icon-close" @click="onClose" style="float: right;" >
@@ -175,12 +175,13 @@
         this.onPlay = false
       },
       doPlay(){
+        this.onPlay = true
+        console.log("doPlay")
         if( !this.$refs.videoPlayer || !this.$refs.videoPlayer.player ) return;
         if( !this.dialog ) return this.doPause();
         let myPlayer = this.$refs.videoPlayer.player;
         myPlayer && myPlayer.play()
         this.tickNum = 0
-        this.onPlay = true
       },
       onPlayerStart() {
         this.onPlay = true