kcdd.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="">
  3. <view class="zxkjyr" style="padding: 0 42rpx;padding-top: 12rpx;">
  4. <view :class="['zxkjyra',Inv==0?'zxkjyrff':'']" @click="Inv=0">
  5. <text>直播课程</text>
  6. <view class="zxkjxh"></view>
  7. </view>
  8. <view :class="['zxkjyra',Inv==1?'zxkjyrff':'']" @click="Inv=1">
  9. <text>录制课程</text>
  10. <view class="zxkjxh"></view>
  11. </view>
  12. <view :class="['zxkjyra',Inv==2?'zxkjyrff':'']" @click="Inv=2">
  13. <text>失效课程</text>
  14. <view class="zxkjxh"></view>
  15. </view>
  16. </view>
  17. <view class=" ">
  18. <view style="margin-top: 30rpx;">
  19. <view class="fsxto sclixmy" v-for="(item,index) in list" :key="index">
  20. <view class="fzctob">
  21. <view class="sckjert" style="overflow: hidden;">
  22. <image :src="item.img" mode="aspectFill" style="width: 100%; height: 100%;"></image>
  23. </view>
  24. <view class="fsxto" style="width: 100%;margin-left: 24rpx;">
  25. <view class="cphrry"><text>{{item.title}}</text></view>
  26. <view class="cptxtyra" style="margin-bottom: 10rpx;"><text>{{item.lecturer_name}}</text></view>
  27. <view class="fzctob kcwwerrt">
  28. <text>{{item.type_title}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <view style="border-top: 2rpx dashed #e8e8e8;width: 107%;margin-left: -24rpx;margin-top: 22rpx;"></view>
  33. <view class="flztoa" style="margin-top: 26rpx;">
  34. <view class="fzctob">
  35. <text class="wdjga">¥</text>
  36. <text class="wdjgb">{{item.price}}</text>
  37. <!-- <text class="wdjgc">.00</text> -->
  38. <!-- <text class="scjga">原价¥{{item.line_price}}</text> -->
  39. </view>
  40. <!-- url="../lecturer/kcdd-xq" -->
  41. <view class="kcdrry" hover-class="none" @click="toDetail(item.course_id)">
  42. <image v-if="Inv!=2" src="/static/lecturer/kca1.png" style="width: 136rpx;min-width: 136rpx;height: 50rpx;" mode=""></image>
  43. <image v-if="Inv==2" src="/static/lecturer/kca2.png" style="width: 136rpx;min-width: 136rpx;height: 50rpx;" mode=""></image>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <style>
  52. page {
  53. background: #FAFAFA;
  54. }
  55. </style>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. Inv: 0,
  61. list:[],
  62. course:[],
  63. fail_live:[],
  64. live:[],
  65. lecturer_name:''
  66. }
  67. },
  68. watch:{
  69. Inv(val){
  70. if(val==0){
  71. this.list = this.live
  72. } else if(val==1){
  73. this.list = this.course
  74. } else if(val==2){
  75. this.list = this.fail_live
  76. }
  77. }
  78. },
  79. onLoad() {
  80. this.getList()
  81. },
  82. methods: {
  83. // 获取列表
  84. getList(){
  85. this.$post({
  86. data:{
  87. do:'MyOrderList',
  88. data:{
  89. user_id:uni.getStorageSync('id'),
  90. }
  91. }
  92. }).then(res=>{
  93. console.log(res,'pppppppppppp')
  94. this.course = res.data.course
  95. this.fail_live = res.data.fail_live
  96. this.live = res.data.live
  97. this.lecturer_name = res.data.lecturer_name
  98. if(this.Inv==0){
  99. this.list = this.live
  100. } else if(this.Inv==1){
  101. this.list = this.course
  102. } else if(this.Inv==2){
  103. this.list = this.fail_live
  104. }
  105. })
  106. },
  107. // 观看课程
  108. toDetail(id){
  109. if(this.Inv!=2){
  110. uni.navigateTo({
  111. url:'/pages/index/kcxq-x?id='+id
  112. })
  113. }
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. </style>