Selaa lähdekoodia

增加老师端我的课程视频课课程组列表页面

Pq 7 kuukautta sitten
vanhempi
commit
866452c3c2

+ 8 - 4
BaseLibrary/src/main/java/com/cooleshow/base/widgets/CourseGroupFilterView.java

@@ -111,10 +111,14 @@ public class CourseGroupFilterView extends FrameLayout implements View.OnClickLi
     private List<IFilterViewData> secondDatas = new ArrayList<>();
 
     public void setData(List<IFilterViewData> firstDatas, List<IFilterViewData> secondData) {
-        datas.clear();
-        datas.addAll(firstDatas);
-        secondDatas.clear();
-        secondDatas.addAll(secondData);
+        if (firstDatas != null) {
+            datas.clear();
+            datas.addAll(firstDatas);
+        }
+        if (secondData != null) {
+            secondDatas.clear();
+            secondDatas.addAll(secondData);
+        }
         refreshView();
     }
 

+ 1 - 0
student/src/main/java/com/cooleshow/student/adapter/VideoCourseAppointAdapter.java

@@ -57,6 +57,7 @@ public class VideoCourseAppointAdapter extends BaseQuickAdapter<VideoCourseListB
         tv_price_unit.setText(String.format("%d课时", item.getLessonCount()));
         TextView tv_music_num = helper.getView(R.id.tv_music_num);
         tv_music_num.setText(item.getMusicNum() + "首曲目");
+        tv_music_num.setVisibility(item.getMusicNum() > 0 ? View.VISIBLE : View.GONE);
 
         //老师头像昵称
         ImageView iv_avatar=helper.getView(R.id.iv_avatar);

+ 3 - 3
student/src/main/java/com/cooleshow/student/bean/VideoCourseListBean.java

@@ -56,7 +56,7 @@ public class VideoCourseListBean {
         private String teacherId;
         private String userName;
         private int virtualNumber;
-        public String musicNum;
+        public int musicNum;
 
         public int getAuditVersion() {
             return auditVersion;
@@ -194,11 +194,11 @@ public class VideoCourseListBean {
             this.virtualNumber = virtualNumber;
         }
 
-        public String getMusicNum() {
+        public int getMusicNum() {
             return musicNum;
         }
 
-        public void setMusicNum(String musicNum) {
+        public void setMusicNum(int musicNum) {
             this.musicNum = musicNum;
         }
     }

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/MineVideoCourseAdapter.java

@@ -74,6 +74,7 @@ public class MineVideoCourseAdapter extends BaseQuickAdapter<VideoCourseListBean
         tv_price_unit.setText(String.format("%d课时", item.lessonCount));
         TextView tv_music_num = helper.getView(R.id.tv_music_num);
         tv_music_num.setText(item.getMusicScoreNum() + "首曲目");
+        tv_music_num.setVisibility(item.getMusicScoreNum() > 0 ? View.VISIBLE : View.GONE);
 
         //购买人数
         TextView tv_buy_num = helper.getView(R.id.tv_buy_num);

+ 24 - 26
teacher/src/main/java/com/cooleshow/teacher/adapter/VideoCourseListAdapter.java

@@ -22,7 +22,7 @@ import androidx.annotation.NonNull;
 /**
  * Author by pq, Date on 2022/4/26.
  */
-public class VideoCourseListAdapter extends BaseQuickAdapter<VideoCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+public class VideoCourseListAdapter extends BaseQuickAdapter<VideoCourseListBean.RowsBean, BaseViewHolder> {
 
     public VideoCourseListAdapter() {
         super(R.layout.item_video_course_list_layout);
@@ -42,26 +42,30 @@ public class VideoCourseListAdapter extends BaseQuickAdapter<VideoCourseListBean
         TextView tv_title = helper.getView(R.id.tv_title);
         tv_title.setText(item.lessonName);
         //价格
-        TextView tv_price = helper.getView(R.id.tv_price);
-        TextView tv_price_symbol = helper.getView(R.id.tv_price_symbol);
-        boolean isVipType = TextUtils.equals(item.payType, VideoCoursePayType.VIP.getId());
-        if (isVipType) {
-            tv_price.setText("会员");
-            tv_price_symbol.setVisibility(View.GONE);
-            tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_c76e21));
-        } else {
-            //收费
-            tv_price.setText(UiUtils.getVideoCoursePriceText2(item.lessonPrice));
-            if (UiUtils.isFree(item.lessonPrice)) {
-                tv_price_symbol.setVisibility(View.GONE);
-                tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_20bea0));
-            } else {
-                tv_price_symbol.setVisibility(View.VISIBLE);
-                tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff0000));
-            }
-        }
+//        TextView tv_price = helper.getView(R.id.tv_price);
+//        TextView tv_price_symbol = helper.getView(R.id.tv_price_symbol);
+//        boolean isVipType = TextUtils.equals(item.payType, VideoCoursePayType.VIP.getId());
+//        if (isVipType) {
+//            tv_price.setText("会员");
+//            tv_price_symbol.setVisibility(View.GONE);
+//            tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_c76e21));
+//        } else {
+//            //收费
+//            tv_price.setText(UiUtils.getVideoCoursePriceText2(item.lessonPrice));
+//            if (UiUtils.isFree(item.lessonPrice)) {
+//                tv_price_symbol.setVisibility(View.GONE);
+//                tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_20bea0));
+//            } else {
+//                tv_price_symbol.setVisibility(View.VISIBLE);
+//                tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff0000));
+//            }
+//        }
         TextView tv_price_unit = helper.getView(R.id.tv_price_unit);
-        tv_price_unit.setText(String.format("/%d课时", item.lessonCount));
+        tv_price_unit.setText(String.format("%d课时", item.lessonCount));
+        TextView tv_music_num = helper.getView(R.id.tv_music_num);
+        tv_music_num.setVisibility(item.getMusicScoreNum() > 0 ? View.VISIBLE : View.GONE);
+        tv_music_num.setText(item.getMusicScoreNum() + "首曲目");
+
         //购买人数
         TextView tv_buy_num = helper.getView(R.id.tv_buy_num);
         tv_buy_num.setText(UiUtils.getBuyNumTip2(item.lessonPrice, item.countStudent));
@@ -71,10 +75,4 @@ public class VideoCourseListAdapter extends BaseQuickAdapter<VideoCourseListBean
         tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
         tv_course_status_tip.setBackgroundResource(R.drawable.shape_d5fff7_9dp_right);
     }
-
-    @NonNull
-    @Override
-    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
-        return new BaseLoadMoreModule(baseQuickAdapter);
-    }
 }

+ 7 - 52
teacher/src/main/java/com/cooleshow/teacher/bean/VideoCourseListBean.java

@@ -25,61 +25,16 @@ public class VideoCourseListBean {
     public int offset;
     public int pageNo;
     public int prePage;
-    public StatInfoBean statInfo;
     public int total;
     public int totalPage;
-    public List<FooterBean> footer;
     public List<RowsBean> rows;
 
-    public static class StatInfoBean {
+    public List<RowsBean> getRows() {
+        return rows;
     }
 
-    public static class FooterBean {
-        /**
-         * auditId : 0
-         * auditName :
-         * auditStatus :
-         * avatar :
-         * countStudent : 0
-         * createTime :
-         * hotFlag : 0
-         * id : 0
-         * lessonCount : 0
-         * lessonCoverUrl :
-         * lessonDesc :
-         * lessonName :
-         * lessonPrice : 0
-         * lessonSubject :
-         * lessonSubjectName :
-         * lessonTag :
-         * sortNumber : 0
-         * teacherId : 0
-         * topFlag : 0
-         * updateTime :
-         * username :
-         */
-
-        public int auditId;
-        public String auditName;
-        public String auditStatus;
-        public String avatar;
-        public int countStudent;
-        public String createTime;
-        public int hotFlag;
-        public int id;
-        public int lessonCount;
-        public String lessonCoverUrl;
-        public String lessonDesc;
-        public String lessonName;
-        public String lessonPrice;
-        public String lessonSubject;
-        public String lessonSubjectName;
-        public String lessonTag;
-        public int sortNumber;
-        public int teacherId;
-        public int topFlag;
-        public String updateTime;
-        public String username;
+    public void setRows(List<RowsBean> rows) {
+        this.rows = rows;
     }
 
     public static class RowsBean {
@@ -129,13 +84,13 @@ public class VideoCourseListBean {
         public String updateTime;
         public String username;
         public String payType;
-        public String musicNum;
+        public int musicNum;
 
-        public String getMusicScoreNum() {
+        public int getMusicScoreNum() {
             return musicNum;
         }
 
-        public void setMusicScoreNum(String musicScoreNum) {
+        public void setMusicScoreNum(int musicScoreNum) {
             this.musicNum = musicScoreNum;
         }
     }

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

@@ -16,6 +16,5 @@ public interface VideoCourseContract {
     }
 
     interface Presenter {
-        void queryVideoCourse(boolean isShowLoading,int subjectId, int page);
     }
 }

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

@@ -1,5 +1,7 @@
 package com.cooleshow.teacher.presenter.course;
 
+import android.text.TextUtils;
+
 import com.cooleshow.base.constanst.Constants;
 import com.cooleshow.base.presenter.BasePresenter;
 import com.cooleshow.base.rx.BaseObserver;
@@ -17,16 +19,16 @@ import org.json.JSONObject;
  */
 public class VideoCoursePresenter extends BasePresenter<VideoCourseContract.VideoCourseView> implements VideoCourseContract.Presenter {
 
-    @Override
-    public void queryVideoCourse(boolean isShowLoading, int subjectId, int page) {
+    public void queryVideoCourse(boolean isShowLoading, String subjectId, String search,int page) {
         if (isShowLoading && getView() != null) {
             getView().showLoading();
         }
         JSONObject jsonObject = new JSONObject();
         try {
-            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);
             jsonObject.putOpt("auditStatus", "PASS");

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

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

+ 0 - 286
teacher/src/main/java/com/cooleshow/teacher/ui/course/VideoCourseFragment.java

@@ -1,286 +0,0 @@
-package com.cooleshow.teacher.ui.course;
-
-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.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.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.SizeUtils;
-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.teacher.R;
-import com.cooleshow.teacher.adapter.CourseStatusFilterAdapter;
-import com.cooleshow.teacher.adapter.VideoCourseListAdapter;
-import com.cooleshow.teacher.bean.CourseFilterStatusBean;
-import com.cooleshow.teacher.bean.QuerySubjectBean;
-import com.cooleshow.teacher.bean.VideoCourseListBean;
-import com.cooleshow.teacher.constants.CourseConstants;
-import com.cooleshow.teacher.contract.VideoCourseContract;
-import com.cooleshow.teacher.databinding.FragmentVideoCourseLayoutBinding;
-import com.cooleshow.teacher.presenter.course.VideoCoursePresenter;
-import com.cooleshow.teacher.widgets.VideoCourseListItemDecoration;
-import com.scwang.smart.refresh.layout.api.RefreshLayout;
-import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
-
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Author by pq, Date on 2022/4/25.
- */
-public class VideoCourseFragment extends BaseMVPFragment<FragmentVideoCourseLayoutBinding, VideoCoursePresenter> implements VideoCourseContract.VideoCourseView, View.OnClickListener {
-    private int currentSubjectId;
-    private int currentPage;
-    private VideoCourseListAdapter mAdapter;
-    private EmptyViewLayout mEmptyView;
-    private List<QuerySubjectBean> subjectBeanList = new ArrayList<>();
-    private boolean hasNext = true;
-    private boolean isFirstLoad = true;
-
-    @Override
-    protected FragmentVideoCourseLayoutBinding getLayoutView() {
-        return FragmentVideoCourseLayoutBinding.inflate(getLayoutInflater());
-    }
-
-    @Override
-    protected VideoCoursePresenter createPresenter() {
-        return new VideoCoursePresenter();
-    }
-
-    @Override
-    protected void initView(View rootView) {
-        mViewBinding.tvSubject.setOnClickListener(this);
-    }
-
-    @Override
-    public void refreshData() {
-        super.refreshData();
-        reBuildFilter();
-        isFirstLoad = false;
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        if(isFirstLoad){
-            isFirstLoad = false;
-            reBuildFilter();
-        }
-    }
-
-    private void buildDefaultCourseStatusFilterList() {
-//        mCourseFilterStatusBeans = new ArrayList<>();
-//        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseFilterConstants.COURSE_FILTER_ALL, "全部"));
-//        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseFilterConstants.COURSE_FILTER_HAS_NOT_STARTED, "未开始"));
-//        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseFilterConstants.COURSE_FILTER_IN_PROGRESS, "进行中"));
-//        mCourseFilterStatusBeans.add(new CourseFilterStatusBean(CourseFilterConstants.COURSE_FILTER_COMPLETED, "已结束"));
-    }
-
-    private void reBuildFilter() {
-        currentPage = 1;
-        queryCourse(true);
-    }
-
-
-    @Override
-    protected void initData() {
-        mViewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
-            @Override
-            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
-                refresh();
-            }
-        });
-
-        mAdapter = new VideoCourseListAdapter();
-        mAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
-            @Override
-            public void onLoadMore() {
-                //上拉加载
-                if (hasNext) {
-                    loadMore();
-                } else {
-                    mAdapter.getLoadMoreModule().loadMoreEnd();
-                }
-            }
-        });
-        mAdapter.getLoadMoreModule().setAutoLoadMore(true);
-        //当自动加载开启,同时数据不满一屏时,是否继续执行自动加载更多(默认为true)
-//        mAdapter.getLoadMoreModule().setEnableLoadMoreIfNotFullPage(false);
-
-        GridLayoutManager gridLayoutManager = new GridLayoutManager(requireContext(), 2);
-        gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
-            @Override
-            public int getSpanSize(int position) {
-                int itemViewType = mAdapter.getItemViewType(position);
-                if (itemViewType == BaseQuickAdapter.LOAD_MORE_VIEW) {
-                    return 2;
-                }
-                return 1;
-            }
-        });
-        VideoCourseListItemDecoration itemDecoration = new VideoCourseListItemDecoration(0, SizeUtils.dp2px(11), 0, SizeUtils.dp2px(11), SizeUtils.dp2px(5.5f));
-        mViewBinding.recyclerView.addItemDecoration(itemDecoration);
-        mViewBinding.recyclerView.setLayoutManager(gridLayoutManager);
-        mViewBinding.recyclerView.setAdapter(mAdapter);
-        buildDefaultCourseStatusFilterList();
-        mAdapter.setOnItemClickListener(new OnItemClickListener() {
-            @Override
-            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
-                VideoCourseListBean.RowsBean item = (VideoCourseListBean.RowsBean) adapter.getItem(position);
-                ARouter.getInstance()
-                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                        .withString(WebConstants.WEB_URL, WebConstants.TEACHER_VIDEO_DETAIL + "?groupId=" + item.id)
-                        .navigation();
-            }
-        });
-    }
-
-
-    /**
-     * 刷新
-     */
-    private void refresh() {
-        // 这里的作用是防止下拉刷新的时候还可以上拉加载
-        mAdapter.getLoadMoreModule().setEnableLoadMore(false);
-        // 下拉刷新,需要重置页数
-        currentPage = 1;
-        queryCourse(true);
-    }
-
-    private void loadMore() {
-        currentPage++;
-        queryCourse(false);
-    }
-
-    private void queryCourse(boolean isShowLoading) {
-        //根据默认筛选条件查询
-        LogUtils.i("pq", "currentSubjectId:" + currentSubjectId);
-        LogUtils.i("pq", "currentPage:" + currentPage);
-        presenter.queryVideoCourse(isShowLoading, currentSubjectId, currentPage);
-    }
-
-    private void checkHasNext(int dataSize) {
-        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
-    }
-
-
-    @Override
-    public void onGetVideoCourseSuccess(int page, VideoCourseListBean liveCourseListBean) {
-        if (isDetached()) {
-            return;
-        }
-        if (liveCourseListBean != null) {
-            mViewBinding.refreshLayout.finishRefresh();
-            mAdapter.getLoadMoreModule().setEnableLoadMore(true);
-            if (page == 1) {
-                //第一页
-                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) {
-                        checkHasNext(liveCourseListBean.rows.size());
-                        mAdapter.addData(liveCourseListBean.rows);
-                        mAdapter.getLoadMoreModule().loadMoreComplete();
-                    } 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().setEnableLoadMore(true);
-                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);
-    }
-
-    @Override
-    public void onClick(View v) {
-        if (v.getId() == R.id.tv_subject) {
-            //课程状态筛选
-            //选择声部
-            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.tvSubject, popList, position -> {
-                QuerySubjectBean bean = subjectBeanList.get(position);
-                currentSubjectId = bean.id;
-                mViewBinding.tvSubject.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);
-    }
-}

+ 261 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/course/VideoCourseGroupFragment.java

@@ -0,0 +1,261 @@
+package com.cooleshow.teacher.ui.course;
+
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.PopupWindow;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.cooleshow.base.common.WebConstants;
+import com.cooleshow.base.constanst.Constants;
+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.teacher.R;
+import com.cooleshow.teacher.adapter.VideoCourseListAdapter;
+import com.cooleshow.teacher.bean.QuerySubjectBean;
+import com.cooleshow.teacher.bean.VideoCourseListBean;
+import com.cooleshow.teacher.contract.VideoCourseContract;
+import com.cooleshow.teacher.databinding.FragmentVideoCourseLayoutBinding;
+import com.cooleshow.teacher.presenter.course.VideoCoursePresenter;
+import com.scwang.smart.refresh.footer.ClassicsFooter;
+import com.scwang.smart.refresh.layout.api.RefreshLayout;
+import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/4/25.
+ */
+public class VideoCourseGroupFragment extends BaseMVPFragment<FragmentVideoCourseLayoutBinding, VideoCoursePresenter> implements VideoCourseContract.VideoCourseView, View.OnClickListener {
+    private String currentSubjectId;
+    private String searchCondition;
+    private int currentPage;
+    private VideoCourseListAdapter mAdapter;
+    private EmptyViewLayout mEmptyView;
+    private List<IFilterViewData> subjectBeanList = new ArrayList<>();
+    private boolean hasNext = true;
+    private CourseGroupFilterView mCourseGroupFilterView;
+    private PopupWindow mPopupWindow;
+
+    @Override
+    protected FragmentVideoCourseLayoutBinding getLayoutView() {
+        return FragmentVideoCourseLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected VideoCoursePresenter createPresenter() {
+        return new VideoCoursePresenter();
+    }
+
+    @Override
+    protected void initView(View rootView) {
+        mViewBinding.refreshLayout.setRefreshFooter(new ClassicsFooter(getContext()));
+    }
+
+    @Override
+    protected void initData() {
+        mAdapter = new VideoCourseListAdapter();
+        if (mEmptyView == null) {
+            mEmptyView = new EmptyViewLayout(getContext());
+        }
+        mEmptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_course, "暂无课程~");
+        mAdapter.setEmptyView(mEmptyView);
+
+        LinearLayoutManager layoutManager = new LinearLayoutManager(requireContext());
+//        VideoCourseListItemDecoration itemDecoration = new VideoCourseListItemDecoration(0, SizeUtils.dp2px(11), 0, SizeUtils.dp2px(11), SizeUtils.dp2px(5.5f));
+//        mViewBinding.recyclerViewList.addItemDecoration(itemDecoration);
+        mViewBinding.recyclerViewList.setLayoutManager(layoutManager);
+        mViewBinding.recyclerViewList.setAdapter(mAdapter);
+        initListener();
+        reBuildFilter(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(false);
+            }
+        });
+        mViewBinding.refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+                //上拉加载
+                if (hasNext) {
+                    currentPage++;
+                    getData(false);
+                } else {
+                    mViewBinding.refreshLayout.finishLoadMoreWithNoMoreData();
+                }
+            }
+        });
+        mAdapter.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                VideoCourseListBean.RowsBean item = (VideoCourseListBean.RowsBean) adapter.getItem(position);
+                ARouter.getInstance()
+                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                        .withString(WebConstants.WEB_URL, WebConstants.TEACHER_VIDEO_DETAIL + "?groupId=" + item.id)
+                        .navigation();
+            }
+        });
+    }
+
+    @Override
+    public void refreshData() {
+        super.refreshData();
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+    }
+
+
+    private void reBuildFilter(String subjectId) {
+        currentPage = 1;
+        currentSubjectId =subjectId;
+        getData(true);
+    }
+
+    private void getData(boolean isShowLoading) {
+        //根据默认筛选条件查询
+        if (currentPage == 1) {
+            mViewBinding.refreshLayout.resetNoMoreData();
+        }
+        presenter.queryVideoCourse(isShowLoading, currentSubjectId, searchCondition,currentPage);
+    }
+
+    private void checkHasNext(int dataSize) {
+        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
+        mViewBinding.refreshLayout.setNoMoreData(!hasNext);
+    }
+
+
+    @Override
+    public void onGetVideoCourseSuccess(int page, VideoCourseListBean dataList) {
+        if (isDetached()) {
+            return;
+        }
+        LOG.i("pq", "interest queryGroupNoticeSuccess:" + 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();
+                        mAdapter.addData(dataList.getRows());
+                        checkHasNext(dataList.getRows().size());
+                    } 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;
+        }
+    }
+
+    public void querySubjectItemSuccess(List<QuerySubjectBean> data) {
+        subjectBeanList.clear();
+        subjectBeanList.add(new QuerySubjectBean("全部", 0));
+        subjectBeanList.addAll(data);
+    }
+
+    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(obj2);
+                }
+            });
+        }
+        mCourseGroupFilterView.setData(null, 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);
+            }
+        });
+    }
+}

+ 81 - 46
teacher/src/main/res/layout/fragment_video_course_layout.xml

@@ -1,77 +1,112 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<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"
-    tools:ignore="MissingDefaultResource">
+    android:paddingTop="10dp"
+    android:layout_height="match_parent">
 
-    <View
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_subject"
+    <TextView
+        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:maxLength="6"
+        android:maxLines="1"
+        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_constraintTop_toTopOf="parent"
-        android:background="@color/white"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <View
+        android:id="@+id/view_search_bg"
         android:layout_width="0dp"
-        android:layout_height="0dp"/>
+        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" />
 
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/guide_line1"
+    <ImageView
+        android:id="@+id/iv_search_icon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:orientation="vertical"
-        app:layout_constraintGuide_percent="0.33" />
+        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" />
 
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/guide_line2"
-        android:layout_width="wrap_content"
+    <com.cooleshow.base.widgets.ClearEditText
+        android:id="@+id/et_target_name"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:orientation="vertical"
-        app:layout_constraintGuide_percent="0.66" />
-
+        android:layout_marginEnd="5dp"
+        android:background="@null"
+        android:ellipsize="end"
+        android:hint="请输入搜索关键词"
+        android:includeFontPadding="false"
+        android:maxLines="1"
+        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_subject"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:drawableRight="@drawable/icon_arrow_down"
-        android:drawablePadding="6dp"
+        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:paddingTop="18dp"
-        android:paddingBottom="@dimen/dp_12"
-        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_constraintRight_toLeftOf="@+id/guide_line1"
-        app:layout_constraintWidth_default="wrap"
-        app:layout_constraintHorizontal_chainStyle="spread_inside"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        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_subject">
-
-
+        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>

+ 94 - 57
teacher/src/main/res/layout/item_video_course_list_layout.xml

@@ -4,20 +4,20 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginLeft="6dp"
-    android:layout_marginTop="12dp"
-    android:layout_marginRight="6dp"
-    android:paddingBottom="9dp"
-    android:background="@drawable/bg_white_10dp">
+    android:layout_marginBottom="12dp"
+    android:background="@drawable/bg_white_6dp"
+    android:paddingBottom="9dp">
 
 
-    <ImageView
+    <com.cooleshow.base.widgets.QMUIRadiusImageView
         android:id="@+id/im_pic"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/dp_95"
+        android:layout_width="146dp"
+        android:layout_height="@dimen/dp_81"
+        android:layout_marginStart="12dp"
+        android:layout_marginTop="12dp"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent"
-        app:qmui_corner_radius="5dp" />
+        app:qmui_corner_radius="6dp" />
 
     <TextView
         android:id="@+id/tv_course_status_tip"
@@ -33,10 +33,10 @@
         android:text="已上架"
         android:textColor="@color/color_2dc7aa"
         android:textSize="@dimen/sp_10"
-        android:visibility="visible"
-        app:layout_constraintLeft_toLeftOf="parent"
+        android:visibility="gone"
+        app:layout_constraintLeft_toLeftOf="@+id/im_pic"
         app:layout_constraintTop_toTopOf="@+id/im_pic"
-        tools:visibility="visible" />
+        tools:visibility="gone" />
 
     <TextView
         android:id="@+id/course_name"
@@ -44,7 +44,7 @@
         android:layout_height="@dimen/dp_13"
         android:layout_marginEnd="@dimen/dp_5"
         android:layout_marginBottom="@dimen/dp_7"
-        android:background="@drawable/gray_1_radius_bg"
+        android:background="@drawable/shape_66000000_3dp"
         android:gravity="center"
         android:paddingLeft="@dimen/dp_4"
         android:paddingRight="@dimen/dp_4"
@@ -54,73 +54,110 @@
         app:layout_constraintRight_toRightOf="@+id/im_pic" />
 
     <TextView
-        android:lines="2"
         android:id="@+id/tv_title"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="11dp"
-        android:layout_marginTop="5dp"
-        android:layout_marginEnd="11dp"
+        android:layout_marginLeft="12dp"
+        android:layout_marginEnd="5dp"
         android:ellipsize="end"
         android:includeFontPadding="false"
-        android:maxLines="2"
-        android:text="从零开始学竖笛视频课"
+        android:maxLines="1"
         android:textColor="@color/color_1a1a1a"
-        android:textSize="@dimen/sp_14"
-        app:layout_constraintLeft_toLeftOf="parent"
+        android:textSize="@dimen/sp_15"
+        app:layout_constraintBottom_toTopOf="@+id/ll_tag"
+        app:layout_constraintLeft_toRightOf="@+id/im_pic"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/im_pic" />
+        app:layout_constraintTop_toTopOf="@+id/im_pic"
+        app:layout_constraintVertical_chainStyle="packed"
+        tools:text="从零开始学竖笛视频课从零开始学竖笛视频课从零开始学竖笛视频课" />
 
+    <LinearLayout
+        android:id="@+id/ll_tag"
+        android:layout_marginTop="8dp"
+        android:orientation="horizontal"
+        app:layout_constraintBottom_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/tv_music_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/shape_f5f6fa_3dp"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:paddingStart="6dp"
+            android:paddingTop="1dp"
+            android:paddingEnd="6dp"
+            android:paddingBottom="1dp"
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/sp_11"
+            tools:text="3首曲目" />
+
+        <TextView
+            android:id="@+id/tv_price_unit"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="4dp"
+            android:background="@drawable/shape_f5f6fa_3dp"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:paddingStart="6dp"
+            android:paddingTop="1dp"
+            android:paddingEnd="6dp"
+            android:paddingBottom="1dp"
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/sp_11"
+            app:layout_constraintBaseline_toBaselineOf="@+id/tv_music_num"
+            app:layout_constraintLeft_toRightOf="@+id/tv_music_num"
+            tools:text="4课时" />
+    </LinearLayout>
 
     <TextView
-        android:id="@+id/tv_price"
+        android:id="@+id/tv_buy_num"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="11dp"
-        android:layout_marginTop="6dp"
-        android:text="¥120"
-        android:textColor="@color/color_ff0000"
-        android:textSize="@dimen/sp_16"
-        android:textStyle="bold"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/tv_title" />
+        android:layout_marginTop="8dp"
+        android:background="@drawable/shape_12ff802c_2dp"
+        android:includeFontPadding="false"
+        android:paddingStart="4dp"
+        android:paddingTop="3dp"
+        android:paddingEnd="4dp"
+        android:paddingBottom="3dp"
+        android:textColor="@color/color_ff6827"
+        android:textSize="@dimen/sp_12"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/im_pic"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        app:layout_constraintTop_toBottomOf="@+id/ll_tag"
+        tools:text="6人已购买" />
 
     <TextView
-        android:id="@+id/tv_price_symbol"
+        android:visibility="gone"
+        android:id="@+id/tv_price"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="¥"
+        android:layout_marginEnd="12dp"
+        android:text="120"
         android:textColor="@color/color_f44541"
-        android:textSize="@dimen/sp_14"
+        android:textSize="@dimen/sp_18"
         android:textStyle="bold"
-        app:layout_constraintRight_toLeftOf="@+id/tv_price"
-        app:layout_constraintBaseline_toBaselineOf="@+id/tv_price" />
+        app:layout_constraintTop_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_buy_num"
+        app:layout_constraintRight_toRightOf="parent" />
 
     <TextView
-        android:id="@+id/tv_price_unit"
+        android:visibility="gone"
+        android:id="@+id/tv_price_symbol"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="11dp"
-        android:paddingStart="5dp"
-        android:text="/4课时"
-        android:textColor="@color/color_999999"
+        android:text="¥"
+        android:textColor="@color/color_f44541"
         android:textSize="@dimen/sp_14"
+        android:textStyle="bold"
         app:layout_constraintBaseline_toBaselineOf="@+id/tv_price"
-        app:layout_constraintLeft_toRightOf="@+id/tv_price" />
-
-    <TextView
-        android:id="@+id/tv_buy_num"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginLeft="11dp"
-        android:layout_marginTop="5dp"
-        android:includeFontPadding="false"
-        android:text="0人已购买"
-        android:textColor="@color/color_ff802c"
-        android:textSize="@dimen/sp_11"
-        android:visibility="visible"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/tv_price"
-        tools:text="6人已购买" />
+        app:layout_constraintRight_toLeftOf="@+id/tv_price" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>