index.vue 3.0 KB

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