Explorar o código

增加老师端我的课程页面-直播课列表

Pq %!s(int64=3) %!d(string=hai) anos
pai
achega
5d6b4d39b7

+ 1 - 0
BaseLibrary/src/main/res/values/colors.xml

@@ -49,4 +49,5 @@
     <color name="color_30ffd7a6">#30FFD7A6</color>
     <color name="color_ededed">#EDEDED</color>
     <color name="colorPrimaryStudent">#01C1B5</color>
+    <color name="color_ff802c">#FF802C</color>
 </resources>

+ 68 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/LiveCourseListAdapter.java

@@ -0,0 +1,68 @@
+package com.cooleshow.teacher.adapter;
+
+import android.text.TextUtils;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.module.BaseLoadMoreModule;
+import com.chad.library.adapter.base.module.LoadMoreModule;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.base.utils.GlideUtils;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+import com.cooleshow.teacher.constants.CourseFilterConstants;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class LiveCourseListAdapter extends BaseQuickAdapter<LiveCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+
+    public LiveCourseListAdapter(int layoutResId) {
+        super(layoutResId);
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder holder, LiveCourseListBean.RowsBean data) {
+        //时间
+        holder.setText(R.id.tv_time, data.startTime);
+        //title
+        holder.setText(R.id.tv_title, data.courseGroupName);
+        //subjectName
+        holder.setText(R.id.tv_course_name, data.subjectName);
+        //购买人数
+        holder.setText(R.id.tv_buy_num, data.studentCount);
+        ImageView iv_avatar = holder.getView(R.id.iv_bg);
+        //头像
+        GlideUtils.INSTANCE.loadImage(getContext(), data.backgroundPic, iv_avatar, R.drawable.icon_teacher_default_head);
+
+        TextView tvCourseStatusBt = holder.getView(R.id.tv_course_status);
+
+        if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_NOT_START, data.status)) {
+            //未开始
+            holder.setText(R.id.tv_course_status, "未开始");
+            tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff802c));
+        }
+
+        if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_ING, data.status)) {
+            //进行中
+            holder.setText(R.id.tv_course_status, "进行中");
+            tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
+        }
+
+        if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_COMPLETE, data.status)) {
+            //已结束
+            holder.setText(R.id.tv_course_status, "已结束");
+            tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_999999));
+        }
+    }
+
+    @NonNull
+    @Override
+    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
+        return new BaseLoadMoreModule(baseQuickAdapter);
+    }
+}

+ 8 - 3
teacher/src/main/java/com/cooleshow/teacher/adapter/SparringCourseListAdapter.java

@@ -37,10 +37,12 @@ public class SparringCourseListAdapter extends BaseQuickAdapter<SparringCourseLi
         GlideUtils.INSTANCE.loadImage(getContext(), data.avatar, iv_avatar, R.drawable.icon_teacher_default_head);
 
         TextView tvCourseStatusBt = holder.getView(R.id.tv_course_status_bt);
+        TextView tv_course_status = holder.getView(R.id.tv_course_status);
 
         if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_NOT_START, data.status)) {
             //未开始
-            holder.setText(R.id.tv_course_status, "未开始");
+            tv_course_status.setText("未开始");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff802c));
             tvCourseStatusBt.setText("调课");
             tvCourseStatusBt.setBackgroundResource(R.drawable.shape_course_status_normal);
             tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
@@ -48,7 +50,8 @@ public class SparringCourseListAdapter extends BaseQuickAdapter<SparringCourseLi
 
         if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_ING, data.status)) {
             //进行中
-            holder.setText(R.id.tv_course_status, "进行中");
+            tv_course_status.setText("进行中");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
             tvCourseStatusBt.setText("进入教室");
             tvCourseStatusBt.setBackgroundResource(R.drawable.shape_course_status_ing);
             tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.white));
@@ -56,7 +59,9 @@ public class SparringCourseListAdapter extends BaseQuickAdapter<SparringCourseLi
 
         if (TextUtils.equals(CourseFilterConstants.COURSE_STATUS_COMPLETE, data.status)) {
             //已结束
-            holder.setText(R.id.tv_course_status, "已结束");
+            tv_course_status.setText("已结束");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_999999));
+
             tvCourseStatusBt.setText("评价");
             tvCourseStatusBt.setBackgroundResource(R.drawable.shape_course_status_normal);
             tvCourseStatusBt.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));

+ 12 - 1
teacher/src/main/java/com/cooleshow/teacher/api/APIService.java

@@ -2,6 +2,7 @@ package com.cooleshow.teacher.api;
 
 import com.cooleshow.base.data.net.BaseResponse;
 import com.cooleshow.teacher.bean.CourseTableDataBean;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
 import com.cooleshow.teacher.bean.SparringCourseListBean;
 
 import java.util.List;
@@ -38,7 +39,7 @@ public interface APIService {
     Observable<BaseResponse<CourseTableDataBean>> getCourseSchedulesWithDate(@Body RequestBody body);
 
     /**
-     * 根据日期获取老师当日排
+     * 查询陪练
      *
      * @param
      * @return
@@ -46,6 +47,16 @@ public interface APIService {
     @POST(TEACHER_GROUP + "courseSchedule/queryTeacherPracticeCourse")
     Observable<BaseResponse<SparringCourseListBean>> getSparringCourses(@Body RequestBody body);
 
+
+    /**
+     * 查询陪练课
+     *
+     * @param
+     * @return
+     */
+    @POST(TEACHER_GROUP + "courseSchedule/queryTeacherLiveCourse")
+    Observable<BaseResponse<LiveCourseListBean>> getLiveCourses(@Body RequestBody body);
+
     /**
      * 查询个人信息
      *

+ 80 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/LiveCourseListBean.java

@@ -0,0 +1,80 @@
+package com.cooleshow.teacher.bean;
+
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class LiveCourseListBean {
+
+    /**
+     * footer : [{"backgroundPic":"","courseGroupId":0,"courseGroupName":"","endTime":"","startTime":"","status":"","studentCount":0,"subjectName":""}]
+     * limit : 0
+     * nextPage : 0
+     * offset : 0
+     * pageNo : 0
+     * prePage : 0
+     * rows : [{"backgroundPic":"","courseGroupId":0,"courseGroupName":"","endTime":"","startTime":"","status":"","studentCount":0,"subjectName":""}]
+     * statInfo : {}
+     * total : 0
+     * totalPage : 0
+     */
+
+    public int limit;
+    public int nextPage;
+    public int offset;
+    public int pageNo;
+    public int prePage;
+    public StatInfoBean statInfo;
+    public int total;
+    public int totalPage;
+    public List<FooterBean> footer;
+    public List<RowsBean> rows;
+
+    public static class StatInfoBean {
+    }
+
+    public static class FooterBean {
+        /**
+         * backgroundPic :
+         * courseGroupId : 0
+         * courseGroupName :
+         * endTime :
+         * startTime :
+         * status :
+         * studentCount : 0
+         * subjectName :
+         */
+
+        public String backgroundPic;
+        public int courseGroupId;
+        public String courseGroupName;
+        public String endTime;
+        public String startTime;
+        public String status;
+        public int studentCount;
+        public String subjectName;
+    }
+
+    public static class RowsBean {
+        /**
+         * backgroundPic :
+         * courseGroupId : 0
+         * courseGroupName :
+         * endTime :
+         * startTime :
+         * status :
+         * studentCount : 0
+         * subjectName :
+         */
+
+        public String backgroundPic;
+        public int courseGroupId;
+        public String courseGroupName;
+        public String endTime;
+        public String startTime;
+        public String status;
+        public String studentCount;
+        public String subjectName;
+    }
+}

+ 20 - 0
teacher/src/main/java/com/cooleshow/teacher/contract/LiveCourseContract.java

@@ -0,0 +1,20 @@
+package com.cooleshow.teacher.contract;
+
+import com.cooleshow.base.presenter.view.BaseView;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+
+/**
+ * Author by pq, Date on 2022/4/20.
+ */
+public interface LiveCourseContract {
+
+    interface LiveCourseView extends BaseView {
+        void onGetLiveCourseSuccess(int page, LiveCourseListBean liveCourseListBean);
+        void onGetCourseError(int page);
+    }
+
+    interface Presenter {
+        void queryLiveCourse(String month, String status, int subjectId,int page);
+    }
+}

+ 55 - 0
teacher/src/main/java/com/cooleshow/teacher/presenter/course/LiveCoursePresenter.java

@@ -0,0 +1,55 @@
+package com.cooleshow.teacher.presenter.course;
+
+import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
+import com.cooleshow.base.utils.RequestBodyUtil;
+import com.cooleshow.teacher.api.APIService;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+import com.cooleshow.teacher.contract.LiveCourseContract;
+import com.cooleshow.teacher.contract.SparringCourseContract;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * 陪练课presenter
+ * Author by pq, Date on 2022/4/20.
+ */
+public class LiveCoursePresenter extends BasePresenter<LiveCourseContract.LiveCourseView> implements LiveCourseContract.Presenter {
+
+    @Override
+    public void queryLiveCourse(String month, String status, int subjectId, int page) {
+        if (getView() != null) {
+            getView().showLoading();
+        }
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.putOpt("classDate", month);
+            jsonObject.putOpt("status", status);
+            if (subjectId != 0) {
+                jsonObject.putOpt("subjectId", subjectId);
+            }
+            jsonObject.putOpt("page", page);
+            jsonObject.putOpt("rows", 10);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        addSubscribe(create(APIService.class).getLiveCourses(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString())), new BaseObserver<LiveCourseListBean>(getView()) {
+            @Override
+            protected void onSuccess(LiveCourseListBean data) {
+                if (getView() != null) {
+                    getView().onGetLiveCourseSuccess(page, data);
+                }
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().onGetCourseError(page);
+                }
+            }
+        });
+    }
+}

+ 36 - 21
teacher/src/main/java/com/cooleshow/teacher/ui/course/LiveCourseFragment.java

@@ -1,17 +1,23 @@
 package com.cooleshow.teacher.ui.course;
 
 import android.view.View;
+import android.widget.TextView;
 
 import com.chad.library.adapter.base.listener.OnLoadMoreListener;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.TimeUtils;
 import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.adapter.LiveCourseListAdapter;
 import com.cooleshow.teacher.adapter.SparringCourseListAdapter;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
 import com.cooleshow.teacher.bean.SparringCourseListBean;
 import com.cooleshow.teacher.constants.CourseFilterConstants;
+import com.cooleshow.teacher.contract.LiveCourseContract;
 import com.cooleshow.teacher.contract.SparringCourseContract;
+import com.cooleshow.teacher.databinding.FragmentLiveCourseLayoutBinding;
 import com.cooleshow.teacher.databinding.FragmentSparringCourseLayoutBinding;
+import com.cooleshow.teacher.presenter.course.LiveCoursePresenter;
 import com.cooleshow.teacher.presenter.course.SparringCoursePresenter;
 import com.scwang.smart.refresh.layout.api.RefreshLayout;
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
@@ -22,26 +28,29 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 /**
  * Author by pq, Date on 2022/4/25.
  */
-public class LiveCourseFragment extends BaseMVPFragment<FragmentSparringCourseLayoutBinding, SparringCoursePresenter> implements SparringCourseContract.SparringCourseView {
+public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayoutBinding, LiveCoursePresenter> implements LiveCourseContract.LiveCourseView {
     private String currentCourseFilterStatus = CourseFilterConstants.COURSE_FILTER_ALL;
     private String currentFilterDate;
     private int currentSubjectId;
     private int currentPage;
-    private SparringCourseListAdapter mAdapter;
+    private LiveCourseListAdapter mAdapter;
+    private View mEmptyView;
+    private TextView mTvEmptyTip;
 
     @Override
-    protected FragmentSparringCourseLayoutBinding getLayoutView() {
-        return FragmentSparringCourseLayoutBinding.inflate(getLayoutInflater());
+    protected FragmentLiveCourseLayoutBinding getLayoutView() {
+        return FragmentLiveCourseLayoutBinding.inflate(getLayoutInflater());
     }
 
     @Override
-    protected SparringCoursePresenter createPresenter() {
-        return new SparringCoursePresenter();
+    protected LiveCoursePresenter createPresenter() {
+        return new LiveCoursePresenter();
     }
 
     @Override
     protected void initView(View rootView) {
         buildDefaultFilter();
+        mViewBinding.tvTime.setText(currentFilterDate);
     }
 
     private void buildDefaultFilter() {
@@ -61,7 +70,7 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentSparringCourseLa
             }
         });
 
-        mAdapter = new SparringCourseListAdapter(R.layout.item_sparring_course_list_layout);
+        mAdapter = new LiveCourseListAdapter(R.layout.item_live_course_list_layout);
         mAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
             @Override
             public void onLoadMore() {
@@ -72,31 +81,32 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentSparringCourseLa
         });
         mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
         mViewBinding.recyclerView.setAdapter(mAdapter);
+        queryCourse();
     }
 
     private void queryCourse() {
         //根据默认筛选条件查询
-        LogUtils.i("pq","currentFilterDate:"+currentFilterDate);
-        LogUtils.i("pq","currentCourseFilterStatus:"+currentCourseFilterStatus);
-        LogUtils.i("pq","currentSubjectId:"+currentSubjectId);
-        LogUtils.i("pq","currentPage:"+currentPage);
-        presenter.querySparringCourse(currentFilterDate, currentCourseFilterStatus, currentSubjectId, currentPage);
+        LogUtils.i("pq", "currentFilterDate:" + currentFilterDate);
+        LogUtils.i("pq", "currentCourseFilterStatus:" + currentCourseFilterStatus);
+        LogUtils.i("pq", "currentSubjectId:" + currentSubjectId);
+        LogUtils.i("pq", "currentPage:" + currentPage);
+        presenter.queryLiveCourse(currentFilterDate, currentCourseFilterStatus, currentSubjectId, currentPage);
     }
 
     @Override
-    public void onGetSparringCourseSuccess(int page, SparringCourseListBean sparringCourseBean) {
+    public void onGetLiveCourseSuccess(int page, LiveCourseListBean liveCourseListBean) {
         if (isDetached()) {
             return;
         }
-        if (sparringCourseBean != null) {
-            if (page != 1) {
+        if (liveCourseListBean != null) {
+            if (page == 1) {
                 //第一页
                 mViewBinding.refreshLayout.finishRefresh();
                 if (mAdapter != null) {
-                    if (sparringCourseBean.rows != null && sparringCourseBean.rows.size() > 0) {
+                    if (liveCourseListBean.rows != null && liveCourseListBean.rows.size() > 0) {
                         mAdapter.getData().clear();
                         mAdapter.notifyDataSetChanged();
-                        mAdapter.setNewInstance(sparringCourseBean.rows);
+                        mAdapter.setNewInstance(liveCourseListBean.rows);
                     } else {
                         showEmptyView();
                     }
@@ -104,9 +114,9 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentSparringCourseLa
             } else {
                 //加载更多
                 if (mAdapter != null) {
-                    mAdapter.getLoadMoreModule().loadMoreComplete();
-                    if (sparringCourseBean.rows != null && sparringCourseBean.rows.size() > 0) {
-                        mAdapter.addData(sparringCourseBean.rows);
+                    if (liveCourseListBean.rows != null && liveCourseListBean.rows.size() > 0) {
+                        mAdapter.getLoadMoreModule().loadMoreComplete();
+                        mAdapter.addData(liveCourseListBean.rows);
                     } else {
                         mAdapter.getLoadMoreModule().loadMoreEnd();
                     }
@@ -121,6 +131,11 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentSparringCourseLa
     }
 
     private void showEmptyView() {
-
+        if (mEmptyView == null) {
+            mEmptyView = getLayoutInflater().inflate(com.cooleshow.base.R.layout.empty_layout, mAdapter.getEmptyLayout(), false);
+            mTvEmptyTip = mEmptyView.findViewById(com.cooleshow.base.R.id.tv_empty_tip);
+        }
+        mTvEmptyTip.setText("暂无数据");
+        mAdapter.setEmptyView(mEmptyView);
     }
 }

+ 0 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/SparringCourseFragment.java

@@ -110,7 +110,6 @@ public class SparringCourseFragment extends BaseMVPFragment<FragmentSparringCour
                 //加载更多
                 if (mAdapter != null) {
                     if (sparringCourseBean.rows != null && sparringCourseBean.rows.size() > 0) {
-                        mViewBinding.refreshLayout.finishLoadMore();
                         mAdapter.getLoadMoreModule().loadMoreComplete();
                         mAdapter.addData(sparringCourseBean.rows);
                     } else {

+ 82 - 0
teacher/src/main/res/layout/fragment_live_course_layout.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/tv_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="25dp"
+        android:drawableRight="@drawable/icon_arrow_down"
+        android:drawablePadding="4dp"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:paddingTop="18dp"
+        android:paddingBottom="12dp"
+        android:textColor="@color/color_666666"
+        android:textSize="@dimen/sp_13"
+        app:layout_constraintHorizontal_chainStyle="spread_inside"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@+id/tv_course_status"
+        app:layout_constraintTop_toTopOf="parent"
+        tools:text="2021年9月" />
+
+    <TextView
+        android:id="@+id/tv_course_status"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:drawableRight="@drawable/icon_arrow_down"
+        android:drawablePadding="4dp"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_666666"
+        android:textSize="@dimen/sp_13"
+        android:text="课程状态"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintLeft_toRightOf="@+id/tv_time"
+        app:layout_constraintRight_toLeftOf="@+id/tv_agency"
+        app:layout_constraintTop_toTopOf="@+id/tv_time"
+        tools:text="课程状态" />
+
+    <TextView
+        android:id="@+id/tv_agency"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:layout_marginEnd="25dp"
+        android:drawableRight="@drawable/icon_arrow_down"
+        android:drawablePadding="4dp"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_666666"
+        android:textSize="@dimen/sp_13"
+        android:text="声部"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintLeft_toRightOf="@+id/tv_course_status"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/tv_time"
+        tools:text="课程状态" />
+
+    <com.scwang.smart.refresh.layout.SmartRefreshLayout
+        android:id="@+id/refreshLayout"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_time">
+
+        <com.scwang.smart.refresh.header.ClassicsHeader
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:overScrollMode="never"
+            android:scrollbars="none" />
+    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 148 - 0
teacher/src/main/res/layout/item_live_course_list_layout.xml

@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="14dp"
+    android:layout_marginTop="12dp"
+    android:layout_marginEnd="14dp"
+    android:background="@drawable/bg_white_10dp"
+    android:paddingStart="11dp"
+    android:paddingEnd="11dp"
+    android:paddingBottom="11dp">
+
+
+    <com.cooleshow.base.widgets.QMUIRadiusImageView
+        android:id="@+id/iv_bg"
+        android:layout_width="105dp"
+        android:layout_height="71dp"
+        android:layout_marginTop="16dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:qmui_corner_radius="5dp" />
+
+    <TextView
+        android:id="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="10dp"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_16"
+        android:textStyle="bold"
+        app:layout_constraintLeft_toRightOf="@+id/iv_bg"
+        app:layout_constraintTop_toTopOf="@+id/iv_bg"
+        app:layout_constraintVertical_chainStyle="packed"
+        tools:text="张豆张豆豆豆" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:src="@drawable/icon_chat_small"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_title"
+        app:layout_constraintLeft_toRightOf="@+id/tv_title"
+        app:layout_constraintTop_toTopOf="@+id/tv_title" />
+
+    <TextView
+        android:id="@+id/tv_course_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
+        android:layout_marginBottom="5dp"
+        android:background="@drawable/shape_couse_type_text_bg"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:paddingStart="4dp"
+        android:paddingTop="2dp"
+        android:paddingEnd="4dp"
+        android:paddingBottom="2dp"
+        android:textColor="@color/color_ff8c00"
+        android:textSize="@dimen/sp_11"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        tools:text="单簧管" />
+
+    <View
+        android:id="@+id/view_line2"
+        android:layout_width="1dp"
+        android:layout_height="11dp"
+        android:layout_marginStart="8dp"
+        android:background="@color/color_d3d3d3"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_course_name"
+        app:layout_constraintLeft_toRightOf="@+id/tv_course_name"
+        app:layout_constraintTop_toTopOf="@+id/tv_course_name" />
+
+    <TextView
+        android:id="@+id/tv_buy_num"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:textColor="@color/color_ff802c"
+        android:textSize="@dimen/sp_11"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/view_line2"
+        app:layout_constraintLeft_toRightOf="@+id/view_line2"
+        app:layout_constraintTop_toTopOf="@+id/view_line2"
+        tools:text="6人已购买" />
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_marginTop="15dp"
+        android:background="@color/color_f2f2f2"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/iv_bg" />
+
+    <ImageView
+        android:id="@+id/iv_clock_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="11dp"
+        android:src="@drawable/icon_clock"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line" />
+
+    <TextView
+        android:id="@+id/tv_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="6dp"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_666666"
+        android:textSize="@dimen/sp_13"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_clock_icon"
+        app:layout_constraintLeft_toRightOf="@+id/iv_clock_icon"
+        app:layout_constraintTop_toTopOf="@+id/iv_clock_icon"
+        tools:text="2021/09/17 14:00~14:25" />
+
+
+    <TextView
+        android:id="@+id/tv_course_status"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_clock_icon"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/iv_clock_icon"
+        tools:text="未开始" />
+
+    <TextView
+        android:id="@+id/tv_course_status_bt"
+        android:layout_width="70dp"
+        android:layout_height="28dp"
+        android:background="@drawable/shape_course_status_normal"
+        android:gravity="center"
+        android:textColor="@color/color_2dc7aa"
+        android:textSize="@dimen/sp_14"
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        tools:text="调课" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>