index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="m-right-block mh576">
  3. <div class="right-block-bd ng-scope" ui-view="myStudyContent" style="position: relative;">
  4. <div class="panel-tit clear">
  5. <p class="fl">课程</p>
  6. <div class="tc waphide">
  7. <strong class="tc" style="color: red;font-size: 1.2rem;">{{setting.noticeMsg}}</strong>
  8. </div>
  9. </div>
  10. <ul class="m-course-list clear mt10 classlist" v-if="total>0">
  11. <li v-for="(item,index) in list" :key="item.course_id" class="pt-sola mt20 pb10">
  12. <div>
  13. <span v-if="item.isFinish==1" class="p-ico2 ico-passed"></span>
  14. <div class="img">
  15. <img :src="item.tb">
  16. <div class="hover-block">
  17. <div class="mask-bg tc"></div>
  18. <el-button @click="gotoPlay(item.courseId)" class="ui-btn">进入学习</el-button>
  19. </div>
  20. </div>
  21. <div class="tit"><a>{{item.name}}</a></div>
  22. <div class="info">
  23. <p class="w1"><span class="p-ico c1"></span> {{item.type}}</p>
  24. <p class="w2"><span class="p-ico c2"></span>{{item.nd||'2020'}}</p>
  25. <p class="w1">
  26. <span class="p-ico c3"></span> 获得<strong style="color: orange;">{{item.getXs/10}}</strong>学时
  27. </p>
  28. <p class="w2" >
  29. <span class="p-ico c3"></span> 总共 <strong style="color: orange;">{{item.totalXs/10}}</strong>学时
  30. </p>
  31. </div>
  32. </div>
  33. </li>
  34. </ul>
  35. <el-pagination class="m-pages"
  36. @current-change="handleCurrentChange" :current-page="page" :page-size="size" layout="total, prev, pager, next"
  37. :total="total">
  38. </el-pagination>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { httpServer} from "@/components/httpServer/httpServer.js";
  44. import { getMediaOptions} from "@/utils/index.js";
  45. import setting from '@/setting';
  46. export default {
  47. name: "Index",
  48. data() {
  49. return {
  50. page: 1,
  51. size: 12,
  52. total: 1,
  53. list: [],
  54. menus:{},
  55. info:{},
  56. options:{},
  57. media:{},
  58. setting,
  59. playDialog: false,
  60. listLoading: false
  61. };
  62. },
  63. beforeMount(){
  64. this.getData()
  65. },
  66. methods: {
  67. handleCurrentChange: function(currentPage) {
  68. this.page = currentPage;
  69. this.getData()
  70. },
  71. gotoPlay( courseId ){
  72. this.$router.push({name:'play', params:{courseId}})
  73. },
  74. getData() {
  75. let {page, size } = this
  76. let param = { from:(page - 1) * size, size }
  77. httpServer('course.getUserCourseList', param).then(({
  78. data,
  79. code
  80. }) => {
  81. this.list = data.list || 0;
  82. this.total = data.total || 0;
  83. })
  84. },
  85. }
  86. }
  87. </script>
  88. <style>
  89. @import url("./index.css");
  90. @import url("../../../../assets/css/course.css");
  91. @import url("../../../../assets/css/m-screen.css");
  92. </style>