teacher_course_pattern.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="courseWrapper">
  3. <view v-for="(item, index) in requirement" :key="index">
  4. <view class="requires" @click="requireDetail(item.courseId)">
  5. <uni-row class="demo-uni-row">
  6. <uni-col offset="1">
  7. <view class="requires-col1">课程号:{{item.courseId}}</view>
  8. </uni-col>
  9. </uni-row>
  10. <uni-row class="demo-uni-row">
  11. <uni-col offset="1" :span="16">
  12. <view class="requires-col2">科目:{{item.subject}}</view>
  13. </uni-col>
  14. </uni-row>
  15. <view class="requires-col3">
  16. <uni-row class="demo-uni-row">
  17. <uni-col :span="4" offset="1">
  18. <view style="color: red;">{{item.verifyStatus}}</view>
  19. </uni-col>
  20. <uni-col :span="4" >
  21. <view style="color: red;">{{item.deal}}</view>
  22. </uni-col>
  23. <uni-col :span="4" >
  24. <view style="color: red;">{{item.locked}}</view>
  25. </uni-col>
  26. <uni-col :span="4" >
  27. <view :class="item.display == '已上架' ? 'setdisplaycolorgreen' : 'setdisplaycolorred'" >
  28. <view>{{item.display}}</view>
  29. </view>
  30. </uni-col>
  31. </uni-row>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. requirement: []
  42. }
  43. },
  44. onShow() {
  45. this.getPublishCounts()
  46. },
  47. methods: {
  48. // 查询个人上架了多少课程
  49. async getPublishCounts() {
  50. const { data: result } = await uni.$http.get('/education/teacher-courses/showPersonCourse')
  51. this.publishCount = result.data.publishCounts
  52. let courses = []
  53. courses = result.data.list
  54. for (let i = 0; i < courses.length; i++) {
  55. if (courses[i].display === '上架') {
  56. courses[i].display = '已上架'
  57. } else {
  58. courses[i].display = '已下架'
  59. }
  60. }
  61. this.requirement = courses
  62. },
  63. requireDetail(id) {
  64. uni.redirectTo({
  65. url: '/subpkg/teacher/course/teacher_course_my_detail?courseId='
  66. + encodeURIComponent(id)
  67. + '&code=' + encodeURIComponent(0)
  68. })
  69. },
  70. }
  71. }
  72. </script>
  73. <!-- 设置页面背景 -->
  74. <style lang="scss">
  75. page{
  76. height: 100%;
  77. padding: 20rpx;
  78. // background-color: #FFF;
  79. }
  80. </style>
  81. <style scoped lang="scss">
  82. .courseWrapper{
  83. width: 96%;
  84. height: 100%;
  85. }
  86. .requires {
  87. background-color: #FFF;
  88. border: 0px solid #41719C;
  89. border-radius: 30rpx;
  90. margin: 10rpx 0 20rpx;
  91. position: relative;
  92. font-size: 30rpx;
  93. .requires-col1 {
  94. margin-top: 15rpx;
  95. }
  96. .requires-col2 {
  97. margin: 15rpx 0;
  98. }
  99. .requires-col3 {
  100. padding-bottom: 15rpx;
  101. }
  102. .setdisplaycolorgreen{
  103. display: flex;
  104. background-color: #35b882;
  105. color: #fff;
  106. border-radius: 40rpx;
  107. justify-content: center;
  108. }
  109. .setdisplaycolorred{
  110. display: flex;
  111. background-color: #ff5500;
  112. color: #fff;
  113. border-radius: 40rpx;
  114. justify-content: center;
  115. }
  116. }
  117. </style>