Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into dev

邓琴文 3 lat temu
rodzic
commit
9115c5969d

+ 62 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/PianoRoomCourseListAdapter.java

@@ -0,0 +1,62 @@
+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.PianoRoomCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+import com.cooleshow.teacher.constants.CourseConstants;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class PianoRoomCourseListAdapter extends BaseQuickAdapter<PianoRoomCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+
+    public PianoRoomCourseListAdapter(int layoutResId) {
+        super(layoutResId);
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder holder, PianoRoomCourseListBean.RowsBean data) {
+        //时间
+        holder.setText(R.id.tv_time, data.startTime);
+        //title
+        holder.setText(R.id.tv_title, data.groupName);
+        //subjectName
+        holder.setText(R.id.tv_course_name, data.subjectName);
+        TextView tv_course_status = holder.getView(R.id.tv_course_status);
+
+        if (TextUtils.equals(CourseConstants.COURSE_STATUS_NOT_START, data.status)) {
+            //未开始
+            tv_course_status.setText("未开始");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff802c));
+        }
+
+        if (TextUtils.equals(CourseConstants.COURSE_STATUS_ING, data.status)) {
+            //进行中
+            tv_course_status.setText("进行中");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
+        }
+
+        if (TextUtils.equals(CourseConstants.COURSE_STATUS_COMPLETE, data.status)) {
+            //已结束
+            tv_course_status.setText("已结束");
+            tv_course_status.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_999999));
+        }
+    }
+
+    @NonNull
+    @Override
+    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
+        return new BaseLoadMoreModule(baseQuickAdapter);
+    }
+}

+ 10 - 0
teacher/src/main/java/com/cooleshow/teacher/api/APIService.java

@@ -21,6 +21,7 @@ import com.cooleshow.teacher.bean.PayTestBean;
 import com.cooleshow.teacher.bean.PianoRoomCourseCommentBean;
 import com.cooleshow.teacher.bean.PianoRoomCourseHomeworkBean;
 import com.cooleshow.teacher.bean.PianoRoomCourseInfoBean;
+import com.cooleshow.teacher.bean.PianoRoomCourseListBean;
 import com.cooleshow.teacher.bean.ReceivedCommentListBean;
 import com.cooleshow.teacher.bean.ResponseBankCardBean;
 import com.cooleshow.teacher.bean.ResponseBindCardBean;
@@ -105,6 +106,15 @@ public interface APIService {
 
 
     /**
+     * 查询琴房课列表
+     *
+     * @param
+     * @return
+     */
+    @POST(TEACHER_GROUP + "courseSchedule/selectCourseList")
+    Observable<BaseResponse<PianoRoomCourseListBean>> getPianoRoomCourseList(@Body RequestBody body);
+
+    /**
      * 查询陪练课作业信息
      *
      * @param

+ 99 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/PianoRoomCourseListBean.java

@@ -0,0 +1,99 @@
+package com.cooleshow.teacher.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class PianoRoomCourseListBean {
+
+    /**
+     * footer : [{"avatar":"","classDate":"","courseGoupId":0,"courseId":0,"endTime":"","id":0,"signInTime":"","startTime":"","status":"","subjectId":0,"subjectName":"","userId":0,"userName":""}]
+     * limit : 0
+     * nextPage : 0
+     * offset : 0
+     * pageNo : 0
+     * prePage : 0
+     * rows : [{"avatar":"","classDate":"","courseGoupId":0,"courseId":0,"endTime":"","id":0,"signInTime":"","startTime":"","status":"","subjectId":0,"subjectName":"","userId":0,"userName":""}]
+     * 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 ArrayList<RowsBean> rows;
+
+    public static class StatInfoBean {
+    }
+
+    public static class FooterBean {
+        /**
+         * avatar :
+         * classDate :
+         * courseGoupId : 0
+         * courseId : 0
+         * endTime :
+         * id : 0
+         * signInTime :
+         * startTime :
+         * status :
+         * subjectId : 0
+         * subjectName :
+         * userId : 0
+         * userName :
+         */
+
+        public String avatar;
+        public String classDate;
+        public int courseGoupId;
+        public int courseId;
+        public String endTime;
+        public int id;
+        public String signInTime;
+        public String startTime;
+        public String status;
+        public int subjectId;
+        public String subjectName;
+        public int userId;
+        public String userName;
+    }
+
+    public static class RowsBean {
+
+        /**
+         * consumTime : 0
+         * courseId : 0
+         * endTime :
+         * groupName :
+         * imGroupId :
+         * singleCourseTime : 0
+         * startTime :
+         * status :
+         * studentCount : 0
+         * subjectId : 0
+         * subjectName :
+         */
+
+        public int consumTime;
+        public String courseId;
+        public String endTime;
+        public String groupName;
+        public String imGroupId;
+        public int singleCourseTime;
+        public String startTime;
+        public String status;
+        public int studentCount;
+        public int subjectId;
+        public String subjectName;
+    }
+}

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

@@ -0,0 +1,20 @@
+package com.cooleshow.teacher.contract;
+
+import com.cooleshow.base.presenter.view.BaseView;
+import com.cooleshow.teacher.bean.PianoRoomCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+
+/**
+ * Author by pq, Date on 2022/4/20.
+ */
+public interface PianoRoomCourseContract {
+
+    interface PianoRoomCourseView extends BaseView {
+        void onGetPianoRoomCourseListSuccess(int page, PianoRoomCourseListBean bean);
+        void onGetCourseError(int page);
+    }
+
+    interface Presenter {
+        void queryPianoRoomCourseList(boolean isShowLoading,String month, String status, int subjectId,int page);
+    }
+}

+ 57 - 0
teacher/src/main/java/com/cooleshow/teacher/presenter/course/PianoRoomCoursePresenter.java

@@ -0,0 +1,57 @@
+package com.cooleshow.teacher.presenter.course;
+
+import com.cooleshow.base.constanst.Constants;
+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.PianoRoomCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+import com.cooleshow.teacher.contract.PianoRoomCourseContract;
+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 PianoRoomCoursePresenter extends BasePresenter<PianoRoomCourseContract.PianoRoomCourseView> implements PianoRoomCourseContract.Presenter {
+
+    @Override
+    public void queryPianoRoomCourseList(boolean isShowLoading, String month, String status, int subjectId, int page) {
+        if (isShowLoading && getView() != null) {
+            getView().showLoading();
+        }
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.putOpt("month", month);
+            jsonObject.putOpt("status", status);
+            if (subjectId != 0) {
+                jsonObject.putOpt("subjectId", subjectId);
+            }
+            jsonObject.putOpt("page", page);
+            jsonObject.putOpt("rows", Constants.DEFAULT_DATA_SIZE);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        addSubscribe(create(APIService.class).getPianoRoomCourseList(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString())), new BaseObserver<PianoRoomCourseListBean>(getView()) {
+            @Override
+            protected void onSuccess(PianoRoomCourseListBean data) {
+                if (getView() != null) {
+                    getView().onGetPianoRoomCourseListSuccess(page, data);
+                }
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().onGetCourseError(page);
+                }
+            }
+        });
+    }
+}

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

@@ -42,16 +42,20 @@ public class MineCourseActivity extends BaseMVPActivity<ActivityMineCourseLayout
     protected void initView() {
         initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "我的课程");
         viewBinding.radioGroup.setOnCheckedChangeListener((radioGroup, i) -> {
-            if (i == R.id.rb_sparring) {
-                viewBinding.viewPager.setCurrentItem(0);
-            }
-            if (i == R.id.rb_live_course) {
-                viewBinding.viewPager.setCurrentItem(1);
-            }
-            if (i == R.id.rb_video_course) {
-                viewBinding.viewPager.setCurrentItem(2);
-            }
-        });
+                    if (i == R.id.rb_sparring) {
+                        viewBinding.viewPager.setCurrentItem(0,false);
+                    }
+                    if (i == R.id.rb_live_course) {
+                        viewBinding.viewPager.setCurrentItem(1,false);
+                    }
+                    if (i == R.id.rb_video_course) {
+                        viewBinding.viewPager.setCurrentItem(2,false);
+                    }
+                    if (i == R.id.rb_piano_room_course) {
+                        viewBinding.viewPager.setCurrentItem(3,false);
+                    }
+                }
+        );
         viewBinding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
             @Override
             public void onPageSelected(int position) {
@@ -67,18 +71,28 @@ public class MineCourseActivity extends BaseMVPActivity<ActivityMineCourseLayout
             viewBinding.rbSparring.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
             viewBinding.rbLiveCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
             viewBinding.rbVideoCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+            viewBinding.rbPianoRoomCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
         }
         if (position == 1) {
             viewBinding.rbLiveCourse.setChecked(true);
             viewBinding.rbSparring.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
             viewBinding.rbLiveCourse.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
             viewBinding.rbVideoCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+            viewBinding.rbPianoRoomCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
         }
         if (position == 2) {
             viewBinding.rbVideoCourse.setChecked(true);
             viewBinding.rbSparring.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
             viewBinding.rbLiveCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
             viewBinding.rbVideoCourse.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
+            viewBinding.rbPianoRoomCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+        }
+        if (position == 3) {
+            viewBinding.rbPianoRoomCourse.setChecked(true);
+            viewBinding.rbSparring.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+            viewBinding.rbLiveCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+            viewBinding.rbVideoCourse.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+            viewBinding.rbPianoRoomCourse.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
         }
     }
 
@@ -88,9 +102,11 @@ public class MineCourseActivity extends BaseMVPActivity<ActivityMineCourseLayout
         SparringCourseFragment sparringCourseFragment = new SparringCourseFragment();
         LiveCourseFragment liveCourseFragment = new LiveCourseFragment();
         VideoCourseFragment videoCourseFragment = new VideoCourseFragment();
+        PianoRoomCourseFragment pianoRoomCourseFragment = new PianoRoomCourseFragment();
         mFragments.add(sparringCourseFragment);
         mFragments.add(liveCourseFragment);
         mFragments.add(videoCourseFragment);
+        mFragments.add(pianoRoomCourseFragment);
         MineCoursePageAdapter mineCoursePageAdapter = new MineCoursePageAdapter(this);
         mineCoursePageAdapter.setFragments(mFragments);
         viewBinding.viewPager.setAdapter(mineCoursePageAdapter);

+ 314 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/course/PianoRoomCourseFragment.java

@@ -0,0 +1,314 @@
+package com.cooleshow.teacher.ui.course;
+
+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.view.TimePickerView;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.chad.library.adapter.base.listener.OnLoadMoreListener;
+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.widgets.EmptyViewLayout;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.adapter.CourseStatusFilterAdapter;
+import com.cooleshow.teacher.adapter.PianoRoomCourseListAdapter;
+import com.cooleshow.teacher.adapter.SparringCourseListAdapter;
+import com.cooleshow.teacher.bean.CourseFilterStatusBean;
+import com.cooleshow.teacher.bean.PianoRoomCourseListBean;
+import com.cooleshow.teacher.bean.SparringCourseListBean;
+import com.cooleshow.teacher.constants.CourseConstants;
+import com.cooleshow.teacher.contract.PianoRoomCourseContract;
+import com.cooleshow.teacher.contract.SparringCourseContract;
+import com.cooleshow.teacher.databinding.FragmentPianoRoomCourseLayoutBinding;
+import com.cooleshow.teacher.databinding.FragmentSparringCourseLayoutBinding;
+import com.cooleshow.teacher.presenter.course.PianoRoomCoursePresenter;
+import com.cooleshow.teacher.presenter.course.SparringCoursePresenter;
+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 androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ * 我的课程->琴房课
+ */
+public class PianoRoomCourseFragment extends BaseMVPFragment<FragmentPianoRoomCourseLayoutBinding, PianoRoomCoursePresenter> implements PianoRoomCourseContract.PianoRoomCourseView, View.OnClickListener {
+    private String currentCourseFilterStatus = CourseConstants.COURSE_FILTER_ALL;
+    private String currentFilterDate;
+    private Date currentSelectDate;
+    private int currentSubjectId;
+    private int currentPage;
+    private boolean hasNext = true;
+    private PianoRoomCourseListAdapter mAdapter;
+    private EmptyViewLayout mEmptyView;
+    private TextView mTvEmptyTip;
+    private ImageView mEmptyIcon;
+    private TimePickerView pvTime;
+    private PopupWindow mPopupWindow;
+    private ArrayList<CourseFilterStatusBean> mCourseFilterStatusBeans;
+    private CourseStatusFilterAdapter mCourseStatusFilterAdapter;
+
+    @Override
+    protected FragmentPianoRoomCourseLayoutBinding getLayoutView() {
+        return FragmentPianoRoomCourseLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected PianoRoomCoursePresenter createPresenter() {
+        return new PianoRoomCoursePresenter();
+    }
+
+    @Override
+    protected void initView(View rootView) {
+        mViewBinding.tvTime.setOnClickListener(this);
+        mViewBinding.tvCourseStatus.setOnClickListener(this);
+    }
+
+    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 PianoRoomCourseListAdapter(R.layout.item_piano_room_course_list_layout);
+        mAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore() {
+                //上拉加载
+                if (hasNext) {
+                    currentPage++;
+                    queryCourse(false);
+                } else {
+                    mAdapter.getLoadMoreModule().loadMoreEnd();
+                }
+            }
+        });
+        mAdapter.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                if (position < mAdapter.getData().size()) {
+                    PianoRoomCourseListBean.RowsBean rowsBean = mAdapter.getData().get(position);
+                    if (rowsBean != null) {
+                        ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
+                                .withString("course_id", rowsBean.courseId)
+                                .navigation();
+                    }
+                }
+            }
+        });
+        mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
+        mViewBinding.recyclerView.setAdapter(mAdapter);
+        buildDefaultCourseStatusFilterList();
+        reBuildFilter(null, CourseConstants.COURSE_FILTER_ALL);
+    }
+
+    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.queryPianoRoomCourseList(isShowLoading, currentFilterDate, currentCourseFilterStatus, currentSubjectId, currentPage);
+    }
+
+    @Override
+    public void onGetPianoRoomCourseListSuccess(int page, PianoRoomCourseListBean bean) {
+        if (isDetached()) {
+            return;
+        }
+        if (bean != null) {
+            if (page == 1) {
+                //第一页
+                mViewBinding.refreshLayout.finishRefresh();
+                if (mAdapter != null) {
+                    mAdapter.getData().clear();
+                    mAdapter.notifyDataSetChanged();
+                    if (bean.rows != null && bean.rows.size() > 0) {
+                        checkHasNext(bean.rows.size());
+                        mAdapter.setNewInstance(bean.rows);
+                    } else {
+                        showEmptyView();
+                    }
+                }
+            } else {
+                //加载更多
+                if (mAdapter != null) {
+                    if (bean.rows != null && bean.rows.size() > 0) {
+                        mAdapter.getLoadMoreModule().loadMoreComplete();
+                        checkHasNext(bean.rows.size());
+                        mAdapter.addData(bean.rows);
+                    } else {
+                        mAdapter.getLoadMoreModule().loadMoreEnd();
+                    }
+                }
+            }
+        }
+    }
+
+    private void checkHasNext(int dataSize) {
+        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
+    }
+
+    @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();
+                        }
+                    });
+
+                }
+            })
+                    .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();
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(currentSelectDate);
+        pvTime.setDate(calendar);
+        if (!pvTime.isShowing()) {
+            pvTime.show();
+        }
+    }
+
+    private void initPopu(View targetView) {
+        if (mPopupWindow == null) {
+            View popupContentView = LayoutInflater.from(requireContext()).inflate(com.cooleshow.base.R.layout.list_popu_layout, null);
+            RecyclerView recyclerView = popupContentView.findViewById(R.id.recyclerView);
+            View bg = popupContentView.findViewById(com.cooleshow.base.R.id.view);
+            bg.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (mPopupWindow != null) {
+                        mPopupWindow.dismiss();
+                    }
+                }
+            });
+            mCourseStatusFilterAdapter = new CourseStatusFilterAdapter(com.cooleshow.base.R.layout.notice_popu_list_item);
+            mCourseStatusFilterAdapter.setOnItemClickListener(new OnItemClickListener() {
+                @Override
+                public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                    Object object = mCourseStatusFilterAdapter.getData().get(position);
+                    if (object instanceof CourseFilterStatusBean) {
+                        if (mCourseStatusFilterAdapter != null) {
+                            mCourseStatusFilterAdapter.setSelect(position);
+                        }
+                        CourseFilterStatusBean filterStatusBean = (CourseFilterStatusBean) object;
+                        mViewBinding.tvCourseStatus.setText(filterStatusBean.showText);
+                        reBuildFilter(currentSelectDate, filterStatusBean.value);
+                    }
+                    mPopupWindow.dismiss();
+                }
+            });
+            recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
+            recyclerView.setAdapter(mCourseStatusFilterAdapter);
+            mCourseStatusFilterAdapter.setNewInstance(mCourseFilterStatusBeans);
+            mPopupWindow = PopupUtil.createNoBackPopupWindow(popupContentView, requireContext(), ViewGroup.LayoutParams.MATCH_PARENT,
+                    ViewGroup.LayoutParams.WRAP_CONTENT, true);
+        }
+        mPopupWindow.showAsDropDown(targetView);
+    }
+
+    @Override
+    public void onClick(View v) {
+        if (v.getId() == R.id.tv_time) {
+            //时间筛选
+            showTimeSelectPicker();
+            return;
+        }
+        if (v.getId() == R.id.tv_course_status) {
+            //课程状态筛选
+            initPopu(mViewBinding.tvCourseStatus);
+            return;
+        }
+    }
+}

+ 13 - 0
teacher/src/main/res/layout/activity_mine_course_layout.xml

@@ -58,6 +58,19 @@
             android:text="视频课"
             android:textColor="@drawable/btn_radio_text_color_selector_stu"
             android:textSize="@dimen/sp_17" />
+
+        <RadioButton
+            android:id="@+id/rb_piano_room_course"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:button="@null"
+            android:drawableBottom="@drawable/btn_radio_bottom_line_selector"
+            android:drawablePadding="@dimen/dp_8"
+            android:gravity="center"
+            android:text="琴房课"
+            android:textColor="@drawable/btn_radio_text_color_selector_stu"
+            android:textSize="@dimen/sp_17" />
     </RadioGroup>
 
     <View

+ 82 - 0
teacher/src/main/res/layout/fragment_piano_room_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>

+ 136 - 0
teacher/src/main/res/layout/item_piano_room_course_list_layout.xml

@@ -0,0 +1,136 @@
+<?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="20dp">
+
+    <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_toTopOf="parent" />
+
+    <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" />
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_marginTop="10dp"
+        android:background="@color/color_f2f2f2"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/iv_clock_icon" />
+
+    <ImageView
+        android:src="@drawable/icon_piano_room_course"
+        android:id="@+id/iv_avatar"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="17dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line"
+        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_constraintBottom_toTopOf="@+id/tv_course_name"
+        app:layout_constraintLeft_toRightOf="@+id/iv_avatar"
+        app:layout_constraintTop_toTopOf="@+id/iv_avatar"
+        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: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_avatar"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        app:layout_constraintTop_toBottomOf="@+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_6a6a6a"
+        android:textSize="@dimen/sp_11"
+        android:visibility="visible"
+        android:text="0人已购买"
+        app:layout_constraintBottom_toBottomOf="@+id/view_line2"
+        app:layout_constraintLeft_toRightOf="@+id/view_line2"
+        app:layout_constraintTop_toTopOf="@+id/view_line2"
+        tools:text="6人已购买" />
+
+    <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_toTopOf="@+id/view_line"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        tools:text="未开始" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>