瀏覽代碼

bug 修改

邓琴文 3 年之前
父節點
當前提交
0ac13dcb2a

+ 5 - 1
teacher/src/main/java/com/cooleshow/teacher/adapter/CourseTableListAdapter.kt

@@ -101,7 +101,11 @@ class CourseTableListAdapter(layoutResId: Int) :
                     //直播课隐藏
                     tvCourseStatusBt.setVisible(false)
                 }
-                tvCourseStatusBt.text = "评价"
+                if (data?.teacherReplied == 0) {
+                    tvCourseStatusBt.text = "评价"
+                } else {
+                    tvCourseStatusBt.text = "已评价"
+                }
                 baseViewHolder.setText(R.id.tv_course_status, "已结束")
                 tvCourseStatusBt.setBackgroundResource(R.drawable.shape_course_status_normal);
                 tvCourseStatusBt.setTextColor(context.resources.getColor(com.cooleshow.base.R.color.color_2dc7aa))

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

@@ -43,8 +43,8 @@ public class HomeworkAdapter extends BaseQuickAdapter<HomeworkListBean.RowsBean,
         ImageView im_header = helper.getView(R.id.im_header);
         TextView tv_name = helper.getView(R.id.tv_name);
         RecyclerView rv_mark = helper.getView(R.id.rv_mark);
-        GlideUtils.INSTANCE.loadImage(getContext(), item.teacherAvatar, im_header, R.drawable.icon_teacher_default_head);
-        tv_name.setText(item.teacherName);
+        GlideUtils.INSTANCE.loadImage(getContext(), item.studentAvatar, im_header, R.drawable.icon_teacher_default_head);
+        tv_name.setText(item.studentName);
         if (TextUtils.equals(mDecorate, "YES")) {
             tv_state.setVisibility(View.VISIBLE);
             if (TextUtils.equals(item.homeworkStatus, "NOTCOMMIT")) {

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/CourseTableDataBean.java

@@ -61,5 +61,6 @@ public class CourseTableDataBean {
         public String cover;
         public String payCount;
         public String name;
+        public int teacherReplied;
     }
 }

+ 42 - 36
teacher/src/main/java/com/cooleshow/teacher/ui/main/CourseTableFragment.kt

@@ -106,7 +106,7 @@ class CourseTableFragment :
             }
         })
 
-        adapter.setOnItemChildClickListener(OnItemChildClickListener { adapter, view, position ->
+        adapter.setOnItemChildClickListener { adapter, view, position ->
             var data: CourseTableDataBean.StudentListBean =
                 adapter.data[position] as CourseTableDataBean.StudentListBean;
             if (view.id == R.id.tv_course_status_bt) {
@@ -114,50 +114,56 @@ class CourseTableFragment :
                 if (TextUtils.equals(data.status, CourseTableListAdapter.NOT_START)) {
                     var targetDate: Date = TimeUtils.getDate(data.startTime)
                     showCourseTimeSelectView(targetDate, data.courseId);
+                } else {
+                    gotoCourseDetail(position);
                 }
             }
-        })
+        }
 
-        adapter.setOnItemClickListener(OnItemClickListener() { adapter, view, position ->
-            var data: CourseTableDataBean.StudentListBean =
-                adapter.data[position] as CourseTableDataBean.StudentListBean;
-            if (TextUtils.equals(CourseTableListAdapter.OTHER_COURSE, data?.courseType)) {
-                //陪练课 跳转详情页
-                ARouter.getInstance()
-                    .build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
-                    .withString(SparringCourseDetailActivity.COURSE_ID, data.courseId)
-                    .withString(
-                        SparringCourseDetailActivity.COURSE_GROUP_ID,
-                        data.courseGoupId
-                    )
-                    .withString(SparringCourseDetailActivity.STUDENT_ID, data.userId)
-                    .navigation()
-            } else if (TextUtils.equals(
-                    CourseTableListAdapter.PIANO_ROOM_COURSE,
-                    data?.courseType
-                )
-            ) {
-                //琴房课 跳转详情页
-                ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
-                    .withString("course_id", data.courseId)
-                    .navigation()
-            } else {
-                //直播课
-                ARouter.getInstance()
-                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                    .withString(
-                        WebConstants.WEB_URL,
-                        WebConstants.TEACHER_LIVE_DETAIL + "?groupId=" + data.courseGoupId
-                    )
-                    .navigation()
-            }
-        })
+        adapter.setOnItemClickListener { adapter, view, position ->
+            gotoCourseDetail(position);
+        }
         mViewBinding.refreshLayout.setOnRefreshListener {
             queryCurrentDataCourse()
         }
         mViewBinding.refreshLayout.isEnabled = false
     }
 
+    private fun gotoCourseDetail(position: Int) {
+        var data: CourseTableDataBean.StudentListBean =
+            adapter.data[position] as CourseTableDataBean.StudentListBean;
+        if (TextUtils.equals(CourseTableListAdapter.OTHER_COURSE, data?.courseType)) {
+            //陪练课 跳转详情页
+            ARouter.getInstance()
+                .build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
+                .withString(SparringCourseDetailActivity.COURSE_ID, data.courseId)
+                .withString(
+                    SparringCourseDetailActivity.COURSE_GROUP_ID,
+                    data.courseGoupId
+                )
+                .withString(SparringCourseDetailActivity.STUDENT_ID, data.userId)
+                .navigation()
+        } else if (TextUtils.equals(
+                CourseTableListAdapter.PIANO_ROOM_COURSE,
+                data?.courseType
+            )
+        ) {
+            //琴房课 跳转详情页
+            ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
+                .withString("course_id", data.courseId)
+                .navigation()
+        } else {
+            //直播课
+            ARouter.getInstance()
+                .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                .withString(
+                    WebConstants.WEB_URL,
+                    WebConstants.TEACHER_LIVE_DETAIL + "?groupId=" + data.courseGoupId
+                )
+                .navigation()
+        }
+    }
+
     override fun initData() {
         lazyLoad()
     }

+ 5 - 4
teacher/src/main/java/com/cooleshow/teacher/ui/web/HtmlActivity.java

@@ -673,7 +673,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
                     if (permission) {
                         showFileChooser();
                     } else {
-                        DialogHelper.showTipDialog(this,"上传文件需要储存权限,去设置?");
+                        DialogHelper.showTipDialog(this, "上传文件需要储存权限,去设置?");
                     }
                 });
     }
@@ -1040,15 +1040,16 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
         } else if (requestCode == PictureConfig.CHOOSE_REQUEST && mUploadCallbackAboveL != null) {
             // 图片、视频、音频选择结果回调
             List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
-            String avatar = selectList.get(0).getCompressPath();
-
+            String avatar = null;
+            if (selectList != null && selectList.size() > 0) {
+                avatar = selectList.get(0).getCompressPath();
+            }
             if (avatar != null) {
                 mUploadCallbackAboveL.onReceiveValue(new Uri[]{PictureFileUtils.parUri(getApplicationContext(), new File(avatar))});
             } else {
                 mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
             }
             mUploadCallbackAboveL = null;
-
         } else if (requestCode == 1000) {
             if (data != null) {
                 try {