Browse Source

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

Pq 3 months ago
parent
commit
f38d23f2c8

+ 1 - 1
BaseLibrary/src/main/java/com/cooleshow/base/constanst/CourseGroupStatusType.java

@@ -8,7 +8,7 @@ import com.cooleshow.base.interfaces.IFilterViewData;
  */
 public enum CourseGroupStatusType implements IPickerViewData, IFilterViewData {
     ALL("", "全部"),
-    NOT("NOT", "未开始"),
+    NOT_START("NOT_START", "未开始"),
     ING("ING", "进行"),
     COMPLETE("COMPLETE", "已结课"),
     CANCEL("CANCEL", "已取消");

+ 11 - 13
teacher/src/main/java/com/cooleshow/teacher/adapter/LiveCourseListAdapter.java

@@ -20,7 +20,7 @@ import androidx.annotation.NonNull;
 /**
  * Author by pq, Date on 2022/4/25.
  */
-public class LiveCourseListAdapter extends BaseQuickAdapter<LiveCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+public class LiveCourseListAdapter extends BaseQuickAdapter<LiveCourseListBean.RowsBean, BaseViewHolder> {
 
     public LiveCourseListAdapter() {
         super(R.layout.item_live_course_list_layout);
@@ -29,22 +29,21 @@ public class LiveCourseListAdapter extends BaseQuickAdapter<LiveCourseListBean.R
 
     @Override
     protected void convert(@NonNull BaseViewHolder holder, LiveCourseListBean.RowsBean data) {
-        //时间
-        holder.setText(R.id.tv_time, UiUtils.getCourseTimeString(data.startTime, data.endTime));
         //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+"人");
+        holder.setText(R.id.tv_buy_num, data.studentCount + "人");
         //封面
         ImageView iv_cover = holder.getView(R.id.iv_bg);
         GlideUtils.INSTANCE.loadImage(getContext(), data.backgroundPic, iv_cover, com.cooleshow.base.R.drawable.bg_video_placeholder);
-        //头像
-        ImageView cir_avatar = holder.getView(R.id.teacher_head);
-        GlideUtils.INSTANCE.loadImage(getContext(), data.avatar, cir_avatar, R.drawable.icon_teacher_default_head);
         //老师名称
-        holder.setText(R.id.teacher_name, UserHelper.getTeacherName(data.username, data.userId));
+        String courseIntroduce = data.getCourseIntroduce();
+        if (TextUtils.isEmpty(courseIntroduce)) {
+            courseIntroduce = "暂无介绍";
+        }
+        holder.setText(R.id.tv_des, courseIntroduce);
 
         TextView tvCourseStatusBt = holder.getView(R.id.tv_course_status);
 
@@ -65,11 +64,10 @@ public class LiveCourseListAdapter extends BaseQuickAdapter<LiveCourseListBean.R
             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);
+        //已上课时
+        holder.setText(R.id.tv_course_completed_value, data.getCompleteCourseNum());
+        //总课时
+        holder.setText(R.id.tv_course_total_value, data.getCourseNum());
     }
 }

+ 2 - 2
teacher/src/main/java/com/cooleshow/teacher/adapter/VIPCourseAdapter.java

@@ -39,9 +39,9 @@ public class VIPCourseAdapter extends BaseQuickAdapter<VIPCourseGroupListBean.Ro
             //进行中
             tv_status.setText(CourseGroupStatusType.ING.getValue());
             tv_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
-        } else if (TextUtils.equals(status, CourseGroupStatusType.NOT.getId())) {
+        } else if (TextUtils.equals(status, CourseGroupStatusType.NOT_START.getId())) {
             //未开始
-            tv_status.setText(CourseGroupStatusType.NOT.getValue());
+            tv_status.setText(CourseGroupStatusType.NOT_START.getValue());
             tv_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff802c));
         } else if (TextUtils.equals(status, CourseGroupStatusType.COMPLETE.getId())) {
             //已结课

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

@@ -31,6 +31,14 @@ public class LiveCourseListBean {
     public List<FooterBean> footer;
     public List<RowsBean> rows;
 
+    public List<RowsBean> getRows() {
+        return rows;
+    }
+
+    public void setRows(List<RowsBean> rows) {
+        this.rows = rows;
+    }
+
     public static class StatInfoBean {
     }
 
@@ -81,5 +89,32 @@ public class LiveCourseListBean {
         public String username;
         public String userId;
         public String imGroupId;
+        public String courseIntroduce;
+        public String courseNum;
+        public String completeCourseNum;
+
+        public String getCourseIntroduce() {
+            return courseIntroduce;
+        }
+
+        public void setCourseIntroduce(String courseIntroduce) {
+            this.courseIntroduce = courseIntroduce;
+        }
+
+        public String getCourseNum() {
+            return courseNum;
+        }
+
+        public void setCourseNum(String courseNum) {
+            this.courseNum = courseNum;
+        }
+
+        public String getCompleteCourseNum() {
+            return completeCourseNum;
+        }
+
+        public void setCompleteCourseNum(String completeCourseNum) {
+            this.completeCourseNum = completeCourseNum;
+        }
     }
 }

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

@@ -15,6 +15,5 @@ public interface LiveCourseContract {
     }
 
     interface Presenter {
-        void queryLiveCourse(boolean isShowLoading,String month, String status, int subjectId,int page);
     }
 }

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

@@ -19,20 +19,20 @@ import org.json.JSONObject;
  */
 public class LiveCoursePresenter extends BasePresenter<LiveCourseContract.LiveCourseView> implements LiveCourseContract.Presenter {
 
-    @Override
-    public void queryLiveCourse(boolean isShowLoading, String month, String status, int subjectId, int page) {
+    public void queryLiveCourse(boolean isShowLoading, String status, String subjectId, String search, int page) {
         if (isShowLoading && getView() != null) {
             getView().showLoading();
         }
         JSONObject jsonObject = new JSONObject();
         try {
-            jsonObject.putOpt("classDate", month);
-            if(!TextUtils.isEmpty(status)){
+//            jsonObject.putOpt("classDate", month);
+            if (!TextUtils.isEmpty(status)) {
                 jsonObject.putOpt("courseState", status);
             }
-            if (subjectId != 0) {
+            if (TextUtils.isEmpty(subjectId)) {
                 jsonObject.putOpt("subjectId", subjectId);
             }
+            jsonObject.putOpt("search", search);
             jsonObject.putOpt("page", page);
             jsonObject.putOpt("rows", Constants.DEFAULT_DATA_SIZE);
         } catch (JSONException e) {

+ 0 - 366
teacher/src/main/java/com/cooleshow/teacher/ui/course/LiveCourseFragment.java

@@ -1,366 +0,0 @@
-package com.cooleshow.teacher.ui.course;
-
-import android.graphics.Color;
-import android.text.TextUtils;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.PopupWindow;
-import android.widget.TextView;
-
-import com.alibaba.android.arouter.launcher.ARouter;
-import com.bigkoo.pickerview.builder.TimePickerBuilder;
-import com.bigkoo.pickerview.listener.CustomListener;
-import com.bigkoo.pickerview.listener.OnDismissListener;
-import com.bigkoo.pickerview.view.TimePickerView;
-import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.chad.library.adapter.base.listener.OnItemChildClickListener;
-import com.chad.library.adapter.base.listener.OnItemClickListener;
-import com.chad.library.adapter.base.listener.OnLoadMoreListener;
-import com.cooleshow.base.common.WebConstants;
-import com.cooleshow.base.constanst.Constants;
-import com.cooleshow.base.router.RouterPath;
-import com.cooleshow.base.ui.fragment.BaseMVPFragment;
-import com.cooleshow.base.utils.LogUtils;
-import com.cooleshow.base.utils.PopupUtil;
-import com.cooleshow.base.utils.TimeUtils;
-import com.cooleshow.base.utils.UiUtils;
-import com.cooleshow.base.widgets.EmptyViewLayout;
-import com.cooleshow.base.widgets.poplist.PopMenuBean;
-import com.cooleshow.base.widgets.poplist.PopupListWindow;
-import com.cooleshow.chatmodule.utils.helper.ChatHelper;
-import com.cooleshow.teacher.R;
-import com.cooleshow.teacher.adapter.CourseStatusFilterAdapter;
-import com.cooleshow.teacher.adapter.LiveCourseListAdapter;
-import com.cooleshow.teacher.bean.CourseFilterStatusBean;
-import com.cooleshow.teacher.bean.LiveCourseListBean;
-import com.cooleshow.teacher.bean.QuerySubjectBean;
-import com.cooleshow.teacher.constants.CourseConstants;
-import com.cooleshow.teacher.contract.LiveCourseContract;
-import com.cooleshow.teacher.databinding.FragmentLiveCourseLayoutBinding;
-import com.cooleshow.teacher.presenter.course.LiveCoursePresenter;
-import com.scwang.smart.refresh.layout.api.RefreshLayout;
-import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-/**
- * Author by pq, Date on 2022/4/25.
- */
-public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayoutBinding, LiveCoursePresenter> implements LiveCourseContract.LiveCourseView, View.OnClickListener {
-    private String currentCourseFilterStatus = CourseConstants.COURSE_FILTER_ALL;
-    private String currentFilterDate;
-    private Date currentSelectDate;
-    private int currentSubjectId;
-    private int currentPage;
-    private LiveCourseListAdapter mAdapter;
-    private EmptyViewLayout mEmptyView;
-    private TimePickerView pvTime;
-    private ArrayList<CourseFilterStatusBean> mCourseFilterStatusBeans;
-    private List<QuerySubjectBean> subjectBeanList = new ArrayList<>();
-    private boolean hasNext = true;
-    private boolean isFirstLoad = true;
-
-    @Override
-    protected FragmentLiveCourseLayoutBinding getLayoutView() {
-        return FragmentLiveCourseLayoutBinding.inflate(getLayoutInflater());
-    }
-
-    @Override
-    protected LiveCoursePresenter createPresenter() {
-        return new LiveCoursePresenter();
-    }
-
-    @Override
-    protected void initView(View rootView) {
-        mViewBinding.tvTime.setOnClickListener(this);
-        mViewBinding.tvCourseStatus.setOnClickListener(this);
-        mViewBinding.tvAgency.setOnClickListener(this);
-    }
-
-    @Override
-    public void refreshData() {
-        super.refreshData();
-        reBuildFilter(currentSelectDate, currentCourseFilterStatus);
-        isFirstLoad = false;
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        if (isFirstLoad) {
-            isFirstLoad = false;
-            reBuildFilter(null, CourseConstants.COURSE_FILTER_ALL);
-        }
-    }
-
-    private void buildDefaultCourseStatusFilterList() {
-        mCourseFilterStatusBeans = new ArrayList<>();
-        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseConstants.COURSE_FILTER_ALL, "全部状态"));
-        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseConstants.COURSE_FILTER_HAS_NOT_STARTED, "未开始"));
-        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseConstants.COURSE_FILTER_IN_PROGRESS, "进行中"));
-        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseConstants.COURSE_FILTER_COMPLETED, "已结束"));
-    }
-
-    private void reBuildFilter(Date date, String status) {
-        currentSelectDate = date != null ? date : TimeUtils.getNowDate();
-        String targetDateTimeStr = TimeUtils.date2String(currentSelectDate, TimeUtils.getSafeDateFormat("yyyy-MM"));
-        if (TextUtils.equals(targetDateTimeStr, currentFilterDate) && TextUtils.equals(currentCourseFilterStatus, status)) {
-            //防止重复条件触发
-            return;
-        }
-        currentFilterDate = targetDateTimeStr;
-        currentCourseFilterStatus = !TextUtils.isEmpty(status) ? status : CourseConstants.COURSE_FILTER_ALL;
-        currentPage = 1;
-        mViewBinding.tvTime.setText(currentFilterDate);
-        queryCourse(true);
-    }
-
-    @Override
-    protected void initData() {
-        mViewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
-            @Override
-            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
-                currentPage = 1;
-                queryCourse(true);
-            }
-        });
-
-        mAdapter = new LiveCourseListAdapter();
-//        mAdapter.getLoadMoreModule().setEnableLoadMoreIfNotFullPage(false);
-        mAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
-            @Override
-            public void onLoadMore() {
-                //上拉加载
-                if (hasNext) {
-                    currentPage++;
-                    queryCourse(false);
-                } else {
-                    mAdapter.getLoadMoreModule().loadMoreEnd();
-                }
-            }
-        });
-        mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
-        mViewBinding.recyclerView.setAdapter(mAdapter);
-        mAdapter.setOnItemClickListener((adapter, view, position) -> {
-            LiveCourseListBean.RowsBean item = (LiveCourseListBean.RowsBean) adapter.getItem(position);
-            ARouter.getInstance()
-                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                    .withString(WebConstants.WEB_URL, String.format(WebConstants.TEACHER_LIVE_DETAIL_NORMAL_COURSE, item.courseGroupId, item.courseId))
-                    .navigation();
-        });
-        mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
-            @Override
-            public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
-                int id = view.getId();
-                if (id == R.id.iv_chat) {
-                    LiveCourseListBean.RowsBean item = (LiveCourseListBean.RowsBean) adapter.getItem(position);
-                    if (item != null) {
-                        ChatHelper.getInstance().goGroupChat(item.imGroupId, "");
-                    }
-                }
-            }
-        });
-
-
-        buildDefaultCourseStatusFilterList();
-    }
-
-    private void queryCourse(boolean isShowLoading) {
-        //根据默认筛选条件查询
-        LogUtils.i("pq", "currentFilterDate:" + currentFilterDate);
-        LogUtils.i("pq", "currentCourseFilterStatus:" + currentCourseFilterStatus);
-        LogUtils.i("pq", "currentSubjectId:" + currentSubjectId);
-        LogUtils.i("pq", "currentPage:" + currentPage);
-        presenter.queryLiveCourse(isShowLoading, currentFilterDate, currentCourseFilterStatus, currentSubjectId, currentPage);
-    }
-
-    private void checkHasNext(int dataSize) {
-        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
-    }
-
-
-    @Override
-    public void onGetLiveCourseSuccess(int page, LiveCourseListBean liveCourseListBean) {
-        if (isDetached()) {
-            return;
-        }
-        if (liveCourseListBean != null) {
-            if (page == 1) {
-                //第一页
-                mViewBinding.refreshLayout.finishRefresh();
-                if (mAdapter != null) {
-                    mAdapter.getData().clear();
-                    mAdapter.notifyDataSetChanged();
-                    if (liveCourseListBean.rows != null && liveCourseListBean.rows.size() > 0) {
-                        checkHasNext(liveCourseListBean.rows.size());
-                        mAdapter.setNewInstance(liveCourseListBean.rows);
-                    } else {
-                        showEmptyView();
-                    }
-                }
-            } else {
-                //加载更多
-                if (mAdapter != null) {
-                    if (liveCourseListBean.rows != null && liveCourseListBean.rows.size() > 0) {
-                        mAdapter.getLoadMoreModule().loadMoreComplete();
-                        checkHasNext(liveCourseListBean.rows.size());
-                        mAdapter.addData(liveCourseListBean.rows);
-                    } else {
-                        mAdapter.getLoadMoreModule().loadMoreEnd();
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void onGetCourseError(int page) {
-        if (isDetached()) {
-            return;
-        }
-        if (page == 1) {
-            mViewBinding.refreshLayout.finishRefresh();
-        } else {
-            if (mAdapter != null) {
-                currentPage--;
-                mAdapter.getLoadMoreModule().loadMoreFail();
-            }
-        }
-    }
-
-    private void showEmptyView() {
-        if (mEmptyView == null) {
-            mEmptyView = new EmptyViewLayout(getContext());
-        }
-        mEmptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_course, "暂无课程~");
-        mAdapter.setEmptyView(mEmptyView);
-    }
-
-
-    private void showTimeSelectPicker() {
-        if (pvTime == null) {
-            pvTime = new TimePickerBuilder(requireContext(), (date, v) -> {//选中事件回调
-                reBuildFilter(date, currentCourseFilterStatus);
-            }).setLayoutRes(com.cooleshow.base.R.layout.pickerview_default_layout, new CustomListener() {
-                        @Override
-                        public void customLayout(View v) {
-                            //自定义布局中的控件初始化及事件处理
-                            final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
-                            TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
-                            tvSubmit.setOnClickListener(new View.OnClickListener() {
-                                @Override
-                                public void onClick(View v) {
-                                    pvTime.returnData();
-                                    pvTime.dismiss();
-                                }
-                            });
-                            ivCancel.setOnClickListener(new View.OnClickListener() {
-                                @Override
-                                public void onClick(View v) {
-                                    pvTime.dismiss();
-                                }
-                            });
-
-                        }
-                    })
-                    .setTextColorOut(getResources().getColor(com.cooleshow.base.R.color.color_aaaaaa))
-                    .setDividerColor(Color.TRANSPARENT)
-                    .setBgColor(Color.TRANSPARENT)
-                    .setLineSpacingMultiplier(2.5f)
-                    .setType(new boolean[]{true, true, false, false, false, false})// 默认全部显示
-                    .setTextColorCenter(getResources().getColor(com.cooleshow.base.R.color.color_1a1a1a))//设置选中项的颜色
-                    .isDialog(false)//是否显示为对话框样式
-                    .setLabel("年", "月", "", "", "", "")
-                    .build();
-
-            pvTime.setOnDismissListener(new OnDismissListener() {
-                @Override
-                public void onDismiss(Object o) {
-                    UiUtils.refreshFilterTextStyle2(false,mViewBinding.tvTime);
-                }
-
-                @Override
-                public void onShow() {
-                    UiUtils.refreshFilterTextStyle2(true,mViewBinding.tvTime);
-                }
-            });
-        }
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(currentSelectDate);
-        pvTime.setDate(calendar);
-        if (!pvTime.isShowing()) {
-            pvTime.show();
-        }
-    }
-
-    @Override
-    public void onClick(View v) {
-        if (v.getId() == R.id.tv_time) {
-            //时间筛选
-            showTimeSelectPicker();
-            return;
-        }
-
-        if (v.getId() == R.id.tv_course_status) {
-            //课程状态筛选
-            List<PopMenuBean> popList = new ArrayList<>();
-            for (CourseFilterStatusBean bean : mCourseFilterStatusBeans) {
-                PopMenuBean popMenuBean = new PopMenuBean();
-                popMenuBean.setActionName(bean.showText);
-                popList.add(popMenuBean);
-            }
-            initCoursePop(mViewBinding.tvCourseStatus, popList, position -> {
-                CourseFilterStatusBean bean = mCourseFilterStatusBeans.get(position);
-                mViewBinding.tvCourseStatus.setText(bean.showText);
-                reBuildFilter(currentSelectDate, bean.value);
-            });
-            return;
-        }
-        if (v.getId() == R.id.tv_agency) {
-            //选择声部
-            if (subjectBeanList.size() == 0) {
-                subjectBeanList.add(new QuerySubjectBean("全部声部", 0));
-            }
-            List<PopMenuBean> popList = new ArrayList<>();
-            for (QuerySubjectBean bean : subjectBeanList) {
-                PopMenuBean popMenuBean = new PopMenuBean();
-                popMenuBean.setActionName(bean.name);
-                popList.add(popMenuBean);
-            }
-            initCoursePop(mViewBinding.tvAgency, popList, position -> {
-                QuerySubjectBean bean = subjectBeanList.get(position);
-                currentSubjectId = bean.id;
-                mViewBinding.tvAgency.setText(bean.name);
-                queryCourse(true);
-            });
-            return;
-        }
-    }
-
-    private void initCoursePop(TextView targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
-        PopupListWindow popWindow = new PopupListWindow(getContext());
-        popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
-        UiUtils.refreshFilterTextStyle2(true, targetView);
-        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
-            @Override
-            public void onDismiss() {
-                UiUtils.refreshFilterTextStyle2(false, targetView);
-            }
-        });
-    }
-
-    public void querySubjectItemSuccess(List<QuerySubjectBean> data) {
-        subjectBeanList.clear();
-        subjectBeanList.add(new QuerySubjectBean("全部声部", 0));
-        subjectBeanList.addAll(data);
-    }
-}

+ 291 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/course/LiveCourseGroupFragment.java

@@ -0,0 +1,291 @@
+package com.cooleshow.teacher.ui.course;
+
+import android.graphics.Color;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemChildClickListener;
+import com.cooleshow.base.common.WebConstants;
+import com.cooleshow.base.constanst.Constants;
+import com.cooleshow.base.constanst.CourseGroupStatusType;
+import com.cooleshow.base.interfaces.IFilterViewData;
+import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.ui.fragment.BaseMVPFragment;
+import com.cooleshow.base.utils.LOG;
+import com.cooleshow.base.utils.PopupUtil;
+import com.cooleshow.base.utils.UiUtils;
+import com.cooleshow.base.widgets.CourseGroupFilterView;
+import com.cooleshow.base.widgets.EmptyViewLayout;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.adapter.LiveCourseListAdapter;
+import com.cooleshow.teacher.bean.LiveCourseListBean;
+import com.cooleshow.teacher.bean.QuerySubjectBean;
+import com.cooleshow.teacher.constants.CourseConstants;
+import com.cooleshow.teacher.contract.LiveCourseContract;
+import com.cooleshow.teacher.databinding.FragmentLiveCourseLayoutBinding;
+import com.cooleshow.teacher.presenter.course.LiveCoursePresenter;
+import com.scwang.smart.refresh.footer.ClassicsFooter;
+import com.scwang.smart.refresh.layout.api.RefreshLayout;
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class LiveCourseGroupFragment extends BaseMVPFragment<FragmentLiveCourseLayoutBinding, LiveCoursePresenter> implements LiveCourseContract.LiveCourseView, View.OnClickListener {
+    private String currentCourseFilterStatus = CourseConstants.COURSE_FILTER_ALL;
+    private String currentSubjectId;
+    private String searchCondition;
+    private int currentPage;
+    private LiveCourseListAdapter mAdapter;
+    private EmptyViewLayout mEmptyView;
+    private ArrayList<IFilterViewData> mCourseFilterStatusBeans;
+    private List<IFilterViewData> subjectBeanList = new ArrayList<>();
+    private boolean hasNext = true;
+    private CourseGroupFilterView mCourseGroupFilterView;
+    private PopupWindow mPopupWindow;
+
+    @Override
+    protected FragmentLiveCourseLayoutBinding getLayoutView() {
+        return FragmentLiveCourseLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected LiveCoursePresenter createPresenter() {
+        return new LiveCoursePresenter();
+    }
+
+    @Override
+    protected void initView(View rootView) {
+        mViewBinding.refreshLayout.setRefreshFooter(new ClassicsFooter(getContext()));
+    }
+
+
+    @Override
+    public void onResume() {
+        super.onResume();
+    }
+
+    private void buildDefaultCourseStatusFilterList() {
+        CourseGroupStatusType[] values = CourseGroupStatusType.values();
+        List<CourseGroupStatusType> courseGroupStatusTypes = Arrays.asList(values);
+        mCourseFilterStatusBeans = new ArrayList<IFilterViewData>(courseGroupStatusTypes);
+    }
+
+    private void reBuildFilter(String status, String subjectId) {
+        if (!TextUtils.isEmpty(currentCourseFilterStatus) &&
+                !TextUtils.isEmpty(currentSubjectId) &&
+                TextUtils.equals(currentCourseFilterStatus, status) &&
+                TextUtils.equals(currentSubjectId, subjectId)) {
+            //防止重复条件触发
+            return;
+        }
+        currentCourseFilterStatus = !TextUtils.isEmpty(status) ? status : CourseConstants.COURSE_FILTER_ALL;
+        LiveCourseGroupFragment.this.currentSubjectId = subjectId;
+        currentPage = 1;
+        getData(true);
+    }
+
+    @Override
+    protected void initData() {
+        mAdapter = new LiveCourseListAdapter();
+        initListener();
+        if (mEmptyView == null) {
+            mEmptyView = new EmptyViewLayout(getContext());
+        }
+        mEmptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_course, "暂无课程~");
+        mAdapter.setEmptyView(mEmptyView);
+//        mAdapter.getLoadMoreModule().setEnableLoadMoreIfNotFullPage(false);
+        mViewBinding.recyclerViewList.setLayoutManager(new LinearLayoutManager(requireContext()));
+        mViewBinding.recyclerViewList.setAdapter(mAdapter);
+        buildDefaultCourseStatusFilterList();
+        reBuildFilter(CourseConstants.COURSE_FILTER_ALL, null);
+    }
+
+    private void initListener() {
+        mViewBinding.tvFilter.setOnClickListener(this);
+        mViewBinding.tvSearch.setOnClickListener(this);
+        mViewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+                currentPage = 1;
+                getData(true);
+            }
+        });
+
+        mViewBinding.refreshLayout.setOnLoadMoreListener(new com.scwang.smart.refresh.layout.listener.OnLoadMoreListener() {
+            @Override
+            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+                //上拉加载
+                if (hasNext) {
+                    currentPage++;
+                    getData(false);
+                } else {
+                    mViewBinding.refreshLayout.finishLoadMoreWithNoMoreData();
+                }
+            }
+        });
+
+        mAdapter.setOnItemClickListener((adapter, view, position) -> {
+            LiveCourseListBean.RowsBean item = (LiveCourseListBean.RowsBean) adapter.getItem(position);
+            ARouter.getInstance()
+                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                    .withString(WebConstants.WEB_URL, String.format(WebConstants.TEACHER_LIVE_DETAIL_NORMAL_COURSE, item.courseGroupId, item.courseId))
+                    .navigation();
+        });
+        mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
+            @Override
+            public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                int id = view.getId();
+                if (id == R.id.iv_chat) {
+                    LiveCourseListBean.RowsBean item = (LiveCourseListBean.RowsBean) adapter.getItem(position);
+                    if (item != null) {
+                        ChatHelper.getInstance().goGroupChat(item.imGroupId, "");
+                    }
+                }
+            }
+        });
+    }
+
+
+    private void getData(boolean isShowLoading) {
+        //根据默认筛选条件查询
+        if (currentPage == 1) {
+            mViewBinding.refreshLayout.resetNoMoreData();
+        }
+        presenter.queryLiveCourse(isShowLoading, currentCourseFilterStatus, currentSubjectId, searchCondition, currentPage);
+    }
+
+    private void checkHasNext(int dataSize) {
+        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
+        mViewBinding.refreshLayout.setNoMoreData(!hasNext);
+    }
+
+
+    @Override
+    public void onGetLiveCourseSuccess(int page, LiveCourseListBean dataList) {
+        if (isDetached()) {
+            return;
+        }
+        LOG.i("pq", "onGetLiveCourseSuccess:" + dataList);
+        if (dataList != null) {
+            if (page == 1) {
+                //第一页
+                mViewBinding.refreshLayout.finishRefresh();
+                if (mAdapter != null) {
+                    mAdapter.getData().clear();
+                    mAdapter.notifyDataSetChanged();
+                    if (dataList.getRows() != null && dataList.getRows().size() > 0) {
+                        checkHasNext(dataList.getRows().size());
+                        mAdapter.setNewInstance(dataList.getRows());
+                    }
+                }
+            } else {
+                //加载更多
+                if (mAdapter != null) {
+                    if (dataList.getRows() != null && dataList.getRows().size() > 0) {
+                        mViewBinding.refreshLayout.finishLoadMore();
+                        checkHasNext(dataList.getRows().size());
+                        mAdapter.addData(dataList.getRows());
+                    } else {
+                        mViewBinding.refreshLayout.finishLoadMoreWithNoMoreData();
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onGetCourseError(int page) {
+        if (isDetached()) {
+            return;
+        }
+        if (page == 1) {
+            mViewBinding.refreshLayout.finishRefresh();
+        } else {
+            if (mAdapter != null) {
+                currentPage--;
+                mViewBinding.refreshLayout.finishLoadMore(false);
+            }
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.tv_filter) {
+            //筛选
+            showFilterView();
+            return;
+        }
+
+        if (id == R.id.tv_search) {
+            currentPage = 1;
+            searchCondition = mViewBinding.etTargetName.getText().toString().trim();
+            getData(false);
+            return;
+        }
+    }
+
+
+    private void showFilterView() {
+        if (mCourseGroupFilterView == null) {
+            mCourseGroupFilterView = new CourseGroupFilterView(getContext());
+            mCourseGroupFilterView.setOnEventListener(new CourseGroupFilterView.OnEventListener() {
+                @Override
+                public void onDismiss() {
+                    if (mPopupWindow != null) {
+                        mPopupWindow.dismiss();
+                    }
+                }
+
+                @Override
+                public void onQuery(String obj, String obj2) {
+                    if (mPopupWindow != null) {
+                        mPopupWindow.dismiss();
+                    }
+                    currentPage = 1;
+                    reBuildFilter(obj, obj2);
+                }
+            });
+        }
+        mCourseGroupFilterView.setData(mCourseFilterStatusBeans, subjectBeanList);
+        ViewGroup parent = (ViewGroup) mCourseGroupFilterView.getParent();
+        if (parent != null) {
+            parent.removeView(mCourseGroupFilterView);
+        }
+        mPopupWindow = PopupUtil.showInDropWrapNObg(getContext(), mCourseGroupFilterView, mViewBinding.viewTopLine, new PopupUtil.ShowListener() {
+            @Override
+            public void onShow(View view, PopupWindow popupWindow) {
+                UiUtils.refreshFilterTextStyle(true, mViewBinding.tvFilter);
+            }
+        });
+        mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle(false, mViewBinding.tvFilter);
+            }
+        });
+    }
+
+
+    public void querySubjectItemSuccess(List<QuerySubjectBean> data) {
+        subjectBeanList.clear();
+        subjectBeanList.add(new QuerySubjectBean("全部", 0));
+        subjectBeanList.addAll(data);
+    }
+}

+ 2 - 2
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineCourseActivity.java

@@ -38,7 +38,7 @@ public class MineCourseActivity extends BaseMVPActivity<ActivityMineCourseLayout
     public static final String SELECT_POSITION = "selectPosition";
     private List<String> titles = new ArrayList<String>(Arrays.asList("VIP定制课","趣纠课", "直播课", "视频课", "琴房课"));
     private ArrayList<Fragment> mFragments = new ArrayList<>();
-    private LiveCourseFragment mLiveCourseFragment;
+    private LiveCourseGroupFragment mLiveCourseFragment;
     private VideoCourseFragment mVideoCourseFragment;
     private PianoRoomCourseFragment mPianoRoomCourseFragment;
     private VIPCourseGroupFragment mVipCourseFragment;
@@ -76,7 +76,7 @@ public class MineCourseActivity extends BaseMVPActivity<ActivityMineCourseLayout
         });
 
         mInterestCourseGroupFragment = new InterestCourseGroupFragment();
-        mLiveCourseFragment = new LiveCourseFragment();
+        mLiveCourseFragment = new LiveCourseGroupFragment();
         mVideoCourseFragment = new VideoCourseFragment();
         mPianoRoomCourseFragment = new PianoRoomCourseFragment();
         mVipCourseFragment = new VIPCourseGroupFragment();

BIN
teacher/src/main/res/drawable-xhdpi/icon_live_course_group_tag.png


BIN
teacher/src/main/res/drawable-xxhdpi/icon_live_course_group_tag.png


+ 76 - 83
teacher/src/main/res/layout/fragment_live_course_layout.xml

@@ -1,119 +1,112 @@
 <?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:paddingTop="10dp"
     android:layout_height="match_parent">
 
-    <View
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        android:background="@color/white"
-        android:layout_width="0dp"
-        android:layout_height="0dp"/>
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/guide_line1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        app:layout_constraintGuide_percent="0.33" />
-
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/guide_line2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        app:layout_constraintGuide_percent="0.66" />
-
     <TextView
-        android:id="@+id/tv_time"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
+        android:id="@+id/tv_filter"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
         android:drawableRight="@drawable/icon_arrow_down"
         android:drawablePadding="6dp"
+        android:ellipsize="end"
         android:gravity="center"
         android:includeFontPadding="false"
-        android:paddingTop="18dp"
-        android:paddingBottom="12dp"
-        android:textColor="@color/color_666666"
-        android:textSize="@dimen/sp_13"
+        android:maxLength="6"
         android:maxLines="1"
-        android:ellipsize="end"
-        android:paddingEnd="10dp"
-        android:paddingStart="10dp"
-        app:layout_constraintWidth_default="wrap"
-        app:layout_constraintHorizontal_chainStyle="spread_inside"
+        android:paddingStart="13dp"
+        android:paddingEnd="8dp"
+        android:text="筛选"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
         app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toLeftOf="@+id/guide_line1"
-        app:layout_constraintTop_toTopOf="parent"
-        tools:text="2021年9月" />
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
 
-    <TextView
-        android:id="@+id/tv_course_status"
+    <View
+        android:id="@+id/view_search_bg"
         android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:drawableRight="@drawable/icon_arrow_down"
-        android:drawablePadding="6dp"
-        android:paddingTop="18dp"
-        android:paddingBottom="12dp"
-        android:gravity="center"
+        android:layout_height="34dp"
+        android:layout_marginEnd="14dp"
+        android:background="@drawable/bg_white_18dp"
+        app:layout_constraintLeft_toRightOf="@+id/tv_filter"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <ImageView
+        android:id="@+id/iv_search_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="12dp"
+        android:src="@drawable/icon_search"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_search_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <com.cooleshow.base.widgets.ClearEditText
+        android:id="@+id/et_target_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="5dp"
+        android:background="@null"
+        android:ellipsize="end"
+        android:hint="请输入搜索关键词"
         android:includeFontPadding="false"
-        android:textColor="@color/color_666666"
-        android:textSize="@dimen/sp_13"
-        android:text="课程状态"
         android:maxLines="1"
-        android:ellipsize="end"
-        android:paddingEnd="10dp"
-        android:paddingStart="10dp"
-        app:layout_constraintWidth_default="wrap"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
-        app:layout_constraintLeft_toRightOf="@+id/guide_line1"
-        app:layout_constraintRight_toLeftOf="@+id/guide_line2"
-        app:layout_constraintTop_toTopOf="@+id/tv_time"
-        tools:text="课程状态" />
+        android:paddingStart="8dp"
+        android:textColorHint="@color/color_66000000"
+        android:textColor="@color/color_333333"
+        android:textCursorDrawable="@drawable/shape_2dc7aa_1dp"
+        android:textSize="@dimen/sp_14"
+        android:theme="@style/MyEditText"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintLeft_toRightOf="@+id/iv_search_icon"
+        app:layout_constraintRight_toLeftOf="@+id/tv_search"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
 
     <TextView
-        android:id="@+id/tv_agency"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:drawableRight="@drawable/icon_arrow_down"
-        android:drawablePadding="6dp"
-        android:paddingTop="18dp"
-        android:paddingBottom="12dp"
+        android:id="@+id/tv_search"
+        android:layout_width="56dp"
+        android:layout_height="28dp"
+        android:layout_marginEnd="3dp"
+        android:background="@drawable/shape_1ecdac_18dp"
         android:gravity="center"
         android:includeFontPadding="false"
-        android:textColor="@color/color_666666"
-        android:textSize="@dimen/sp_13"
-        android:text="全部声部"
-        android:maxLines="1"
-        android:ellipsize="end"
-        android:paddingEnd="10dp"
-        android:paddingStart="10dp"
-        app:layout_constraintWidth_default="wrap"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
-        app:layout_constraintLeft_toRightOf="@+id/guide_line2"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/tv_time"
-        tools:text="课程状态" />
+        android:text="搜索"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintRight_toRightOf="@+id/view_search_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <View
+        android:layout_marginTop="12dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_search_bg"
+        android:id="@+id/view_top_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"/>
 
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
         android:id="@+id/refreshLayout"
         android:layout_width="match_parent"
         android:layout_height="0dp"
+        app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/tv_time">
-
-
+        app:layout_constraintTop_toBottomOf="@+id/view_top_line"
+        app:srlEnableLoadMore="true">
 
         <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/recyclerView"
+            android:id="@+id/recyclerView_list"
+            android:layout_marginEnd="14dp"
+            android:layout_marginStart="14dp"
             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>

+ 181 - 115
teacher/src/main/res/layout/item_live_course_list_layout.xml

@@ -4,171 +4,237 @@
     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" />
+    android:layout_marginBottom="12dp"
+    android:background="@drawable/bg_white_6dp"
+    android:paddingStart="12dp"
+    android:paddingEnd="12dp"
+    android:paddingBottom="14dp">
 
     <TextView
-        android:id="@+id/tv_title"
+        android:drawableStart="@drawable/icon_live_course_group_tag"
+        android:id="@+id/tv_time"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
+        android:layout_marginTop="9dp"
         android:includeFontPadding="false"
-        android:textColor="@color/color_1a1a1a"
-        android:textSize="@dimen/sp_16"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
         android:textStyle="bold"
-        app:layout_constraintLeft_toRightOf="@+id/iv_bg"
-        app:layout_constraintTop_toTopOf="@+id/iv_bg"
-        app:layout_constraintVertical_chainStyle="packed"
-        tools:text="张豆张豆豆豆" />
+        android:text="课程状态"
+        android:drawablePadding="6dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
 
-    <ImageView
-        android:id="@+id/iv_chat"
+    <TextView
+        android:id="@+id/tv_course_status"
         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" />
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/tv_time"
+        tools:text="未开始" />
+
+    <com.cooleshow.base.widgets.QMUIRadiusImageView
+        android:id="@+id/iv_bg"
+        android:layout_width="0dp"
+        app:layout_constraintDimensionRatio="h,16:9"
+        app:layout_constraintRight_toRightOf="parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="11dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_time"
+        app:qmui_corner_radius="6dp" />
 
     <TextView
         android:id="@+id/tv_course_name"
         android:layout_width="wrap_content"
-        android:layout_height="@dimen/dp_13"
-        android:layout_marginStart="@dimen/dp_3"
-        android:layout_marginBottom="@dimen/dp_4"
-        android:background="@drawable/gray_1_radius_bg"
+        android:layout_height="@dimen/dp_19"
+        android:layout_marginTop="8dp"
+        android:layout_marginStart="@dimen/dp_8"
+        android:background="@drawable/shape_66000000_3dp"
         android:gravity="center"
         android:includeFontPadding="false"
-        android:paddingStart="@dimen/dp_3"
-        android:paddingEnd="@dimen/dp_3"
+        android:paddingStart="@dimen/dp_6"
+        android:paddingEnd="@dimen/dp_6"
         android:textColor="@color/white"
-        android:textSize="@dimen/sp_9"
-        app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
+        android:textSize="@dimen/sp_12"
+        app:layout_constraintTop_toTopOf="@+id/iv_bg"
         app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
         tools:text="单簧管" />
 
-    <de.hdodenhof.circleimageview.CircleImageView
-        android:id="@+id/teacher_head"
-        android:layout_width="@dimen/dp_18"
-        android:layout_height="@dimen/dp_18"
-        android:layout_marginBottom="@dimen/dp_1"
-        app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
-        app:layout_constraintLeft_toLeftOf="@+id/tv_title" />
+    <TextView
+        android:visibility="gone"
+        android:id="@+id/tv_course_status_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="@drawable/shape_ffe7e7_15dp_left"
+        android:gravity="center"
+        android:paddingStart="12dp"
+        android:paddingTop="3dp"
+        android:paddingEnd="12dp"
+        android:paddingBottom="3dp"
+        android:text="销售中"
+        android:textColor="@color/color_ff1919"
+        android:textSize="@dimen/sp_10"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_course_name"
+        app:layout_constraintRight_toRightOf="@+id/iv_bg"
+        app:layout_constraintTop_toTopOf="@+id/tv_course_name" />
+
 
     <TextView
-        tools:text="哈哈哈哈哈哈哈哈哈哈"
-        android:id="@+id/teacher_name"
+        android:id="@+id/tv_title"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:paddingLeft="@dimen/dp_6"
-        android:textColor="@color/color_999999"
-        android:textSize="@dimen/sp_13"
+        android:ellipsize="end"
+        android:includeFontPadding="false"
         android:maxLines="1"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_16"
+        android:textStyle="bold"
+        android:layout_marginTop="8dp"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
+        app:layout_constraintRight_toRightOf="@+id/iv_bg"
+        app:layout_constraintTop_toBottomOf="@+id/iv_bg"
+        app:layout_constraintVertical_chainStyle="packed"
+        tools:text="张豆张豆豆豆" />
+
+    <TextView
+        android:id="@+id/tv_des"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
         android:ellipsize="end"
-        app:layout_constraintWidth_default="wrap"
-        app:layout_constraintHorizontal_bias="0"
-        app:layout_constraintHorizontal_chainStyle="packed"
-        app:layout_constraintRight_toLeftOf="@+id/view_line2"
-        app:layout_constraintBottom_toBottomOf="@+id/teacher_head"
-        app:layout_constraintLeft_toRightOf="@+id/teacher_head"
-        app:layout_constraintTop_toTopOf="@+id/teacher_head" />
-
-    <View
-        android:id="@+id/view_line2"
-        android:layout_width="1dp"
-        android:layout_height="11dp"
-        android:layout_marginStart="@dimen/dp_8"
-        android:background="@color/color_d3d3d3"
-        android:visibility="visible"
-        app:layout_constraintRight_toLeftOf="@+id/tv_buy_num"
-        app:layout_constraintBottom_toBottomOf="@+id/teacher_name"
-        app:layout_constraintLeft_toRightOf="@+id/teacher_name"
-        app:layout_constraintTop_toTopOf="@+id/teacher_name" />
+        android:includeFontPadding="false"
+        android:maxLines="1"
+        android:textColor="@color/color_777777"
+        android:textSize="@dimen/sp_14"
+        android:layout_marginTop="4dp"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
+        app:layout_constraintRight_toRightOf="@+id/iv_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title"
+        tools:text="国际著名长笛演奏家、教育家子珊女士为您讲教育家子珊女士为您讲教育家子珊女士为您讲" />
 
     <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:layout_marginTop="11dp"
+        android:background="@drawable/shape_12ff802c_2dp"
+        android:textColor="@color/color_ff6827"
+        android:textSize="@dimen/sp_12"
         android:visibility="visible"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintBottom_toBottomOf="@+id/view_line2"
-        app:layout_constraintLeft_toRightOf="@+id/view_line2"
-        app:layout_constraintTop_toTopOf="@+id/view_line2"
+        android:paddingStart="4dp"
+        android:paddingEnd="4dp"
+        android:paddingTop="3dp"
+        android:paddingBottom="3dp"
+        android:includeFontPadding="false"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_des"
         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"
+
+    <TextView
+        android:visibility="gone"
+        android:id="@+id/tv_price"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="¥120"
+        android:textColor="@color/color_f44541"
+        android:textSize="@dimen/sp_20"
+        android:textStyle="bold"
+        android:includeFontPadding="false"
+        app:layout_constraintTop_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_buy_num"
+        app:layout_constraintRight_toLeftOf="@+id/tv_price_unit" />
+
+    <TextView
+        android:visibility="gone"
+        android:includeFontPadding="false"
+        android:id="@+id/tv_price_unit"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingStart="2dp"
+        android:text="/4课时"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_12"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/iv_bg" />
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_price" />
+
 
     <ImageView
-        android:id="@+id/iv_clock_icon"
+        android:layout_marginEnd="4dp"
+        android:id="@+id/iv_course_tag"
         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" />
+        android:src="@drawable/icon_course_completed_tag"
+        app:layout_constraintRight_toLeftOf="@+id/tv_course_completed_title"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_course_completed_title"
+        app:layout_constraintTop_toTopOf="@+id/tv_course_completed_title" />
 
     <TextView
-        android:id="@+id/tv_time"
+        android:id="@+id/tv_course_completed_title"
         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" />
+        android:text="已上课时"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_12"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_course_completed_value"
+        app:layout_constraintRight_toLeftOf="@+id/tv_course_completed_value" />
 
 
     <TextView
-        android:id="@+id/tv_course_status"
+        android:id="@+id/tv_course_completed_value"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:includeFontPadding="false"
+        android:paddingStart="3dp"
+        android:paddingEnd="3dp"
+        android:text="0"
+        android:textColor="@color/color_2dc7aa"
+        android:textSize="@dimen/sp_12"
+        android:textStyle="bold"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_course_total_title"
+        app:layout_constraintRight_toLeftOf="@+id/tv_course_total_title" />
+
+    <TextView
+        android:id="@+id/tv_course_total_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:includeFontPadding="false"
+        android:text="/总课时"
         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="未开始" />
+        android:textSize="@dimen/sp_12"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_course_total_value"
+        app:layout_constraintRight_toLeftOf="@+id/tv_course_total_value" />
+
 
     <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:id="@+id/tv_course_total_value"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:includeFontPadding="false"
+        android:paddingStart="3dp"
+        android:paddingEnd="3dp"
+        android:text="0"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_12"
+        android:textStyle="bold"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_buy_num"
+        app:layout_constraintTop_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintRight_toRightOf="parent" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:src="@drawable/icon_chat_small"
         android:visibility="gone"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        tools:text="调课" />
+        app:layout_constraintBottom_toBottomOf="@+id/tv_title"
+        app:layout_constraintLeft_toRightOf="@+id/tv_title"
+        app:layout_constraintTop_toTopOf="@+id/tv_title" />
+
+
+
 </androidx.constraintlayout.widget.ConstraintLayout>