123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <template>
- <view class="">
- <view class="zxkjyr" style="padding: 0 42rpx;padding-top: 12rpx;">
-
- <view :class="['zxkjyra',Inv==0?'zxkjyrff':'']" @click="Inv=0">
- <text>直播课程</text>
- <view class="zxkjxh"></view>
- </view>
-
- <view :class="['zxkjyra',Inv==1?'zxkjyrff':'']" @click="Inv=1">
- <text>录制课程</text>
- <view class="zxkjxh"></view>
- </view>
-
- <view :class="['zxkjyra',Inv==2?'zxkjyrff':'']" @click="Inv=2">
- <text>下架课程</text>
- <view class="zxkjxh"></view>
- </view>
-
- </view>
-
- <view class=" ">
- <view style="margin-top: 30rpx;">
- <view class="fsxto sclixmy" v-for="(item,index) in list" :key="index">
- <view class="fzctob">
- <view class="sckjert" style="overflow: hidden;">
- <image :src="item.img" mode="aspectFill" style="width: 100%; height: 100%;"></image>
- </view>
- <view class="fsxto" style="width: 100%;margin-left: 24rpx;">
- <view class="cphrry"><text>{{item.title}}</text></view>
- <!-- -->
- <view class="cptxtyra" style="margin-bottom: 10rpx;"><text>{{item.type_title}}</text></view>
- <view class="fzctob kcwwerrt">
- <text>{{lecturer_name}}</text>
- </view>
- </view>
- </view>
- <view style="border-top: 2rpx dashed #e8e8e8;width: 107%;margin-left: -24rpx;margin-top: 22rpx;"></view>
- <view class="flztoa" style="margin-top: 26rpx;">
- <view class="fzctob">
- <text class="wdjga">¥</text>
- <text class="wdjgb">{{item.price}}</text>
- <!-- <text class="wdjgc">.00</text> -->
- <!-- <text class="scjga">原价¥{{item.line_price}}</text> -->
- </view>
- <!-- <navigator class="kcdrry" url="../lecturer/wdkc-zhixj" hover-class="none">
- <image src="/static/lecturer/wdkca1.png" style="width: 136rpx;min-width: 136rpx;height: 50rpx;" mode=""></image>
- </navigator> -->
- <!-- #ifdef APP-PLUS -->
- <view class="toLive" @click="toLive(item)" v-if="Inv==0">
- 去直播
- </view>
- <!-- #endif -->
-
- <view class="kcdrry" @click="unshelfCourse(item.id)">
- <image v-if="Inv!=2" src="/static/lecturer/wdkca1.png" style="width: 136rpx;min-width: 136rpx;height: 50rpx;" mode=""></image>
- <image v-if="Inv==2" src="/static/lecturer/wdkca2.png" style="width: 136rpx;min-width: 136rpx;height: 50rpx;" mode=""></image>
- </view>
-
- </view>
- </view>
-
- </view>
-
- </view>
- </view>
- </template>
- <style>
- page {
- background: #FAFAFA;
- }
- </style>
- <script>
- export default {
- data() {
- return {
-
- Inv: 0,
- list:[],
- course:[],
- fail_live:[],
- live:[],
- lecturer_name:''
- }
- },
- onLoad() {
- this.getList()
- },
- watch:{
- Inv(val){
- if(val==0){
- this.list = this.live
- } else if(val==1){
- this.list = this.course
- } else if(val==2){
- this.list = this.fail_live
- }
- }
- },
- methods: {
- // 课程列表
- getList(){
- this.$post({
- data:{
- do:'MyCourseList',
- data:{
- user_id:uni.getStorageSync('id')
- }
- }
- }).then(res=>{
- console.log(res,'rrrrrrrrrrrrr')
- this.course = res.data.course
- this.fail_live = res.data.fail_live
- this.live = res.data.live
- this.lecturer_name = res.data.lecturer_name
- if(this.Inv==0){
- this.list = this.live
- } else if(this.Inv==1){
- this.list = this.course
- } else if(this.Inv==2){
- this.list = this.fail_live
- }
- })
- },
- // 去直播
- toLive(item){
- uni.navigateTo({
- url:'/pages/lecturer/Live?chapter_id='+item.chapter_id
- })
- },
- // 上下架课程
- unshelfCourse(id){
- uni.showModal({
- title:'提示',
- content:this.Inv==2?'确定要上架该课程吗?':'确定要下架该课程吗?',
- success: (res) => {
- if(res.confirm){
- console.log({
- do:'TakeDown',
- data:{
- user_id:uni.getStorageSync('id'),
- id,
- state:this.Inv==2?1:0
- }
- })
- this.$post({
- data:{
- do:'TakeDown',
- data:{
- user_id:uni.getStorageSync('id'),
- id,
- state:this.Inv==2?1:0
- }
- }
- }).then(res=>{
- uni.showToast({
- title:this.Inv==2?'上架成功':'下架成功',
- icon:'none',
- mask:true
- })
- setTimeout(()=>{
- this.getList()
- },1500)
- console.log(res)
- })
- }
- }
- })
- }
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .toLive{
- height: 45rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #405375;
- padding: 10rpx 20rpx;
- border: 1rpx solid #405375;
- border-radius: 25rpx;
- }
-
-
- </style>
|