Преглед изворни кода

修改部分判断漏掉的问题

Pq пре 3 месеци
родитељ
комит
329cdd41c3

+ 4 - 2
student/src/main/java/com/cooleshow/student/ui/main/CourseTableFragment.kt

@@ -164,8 +164,10 @@ class CourseTableFragment :
             var data: CourseTableDataBean.StudentListBean =
                 adapter.data[position] as CourseTableDataBean.StudentListBean;
             if (view.id == R.id.iv_go_chat) {
-                if (TextUtils.equals(data.courseType, CourseTableListAdapter.OTHER_COURSE)) {
-                    //陪练课
+                //目前项目很多这样可成类型的判断,扩展性比较差,增加课程类型的话,判断就不对了,后续想想办法吧
+                if (TextUtils.equals(data.courseType, CourseTableListAdapter.OTHER_COURSE) ||
+                    TextUtils.equals(data.courseType, CourseTableListAdapter.VIP_COURSE)){
+                    //VIP课或者趣纠课
                     ChatHelper.getInstance().goChat(data.imUserId, "")
                 } else {
                     //琴房课或者直播课

+ 16 - 6
teacher/src/main/java/com/cooleshow/teacher/ui/main/CourseTableFragment.kt

@@ -111,9 +111,14 @@ class CourseTableFragment :
             if (view.id == R.id.tv_course_status_bt) {
                 //调课(调整时间)
                 if (TextUtils.equals(data.status, CourseTableListAdapter.NOT_START)) {
-                    if(com.cooleshow.teacher.helper.CourseHelper.isCanShowEnterBt(configBean,data.courseType,data.startTime)){
+                    if (com.cooleshow.teacher.helper.CourseHelper.isCanShowEnterBt(
+                            configBean,
+                            data.courseType,
+                            data.startTime
+                        )
+                    ) {
                         gotoCourseDetail(position);
-                    }else{
+                    } else {
                         //调课
                         var targetDate: Date = TimeUtils.getDate(data.startTime)
                         showCourseTimeSelectView(targetDate, data.courseId);
@@ -123,7 +128,10 @@ class CourseTableFragment :
                 }
             }
             if (view.id == R.id.iv_go_chat) {
-                if (TextUtils.equals(data.courseType, CourseTableListAdapter.OTHER_COURSE)) {
+                //目前项目很多这样可成类型的判断,扩展性比较差,增加课程类型的话,判断就不对了,后续想想办法吧
+                if (TextUtils.equals(data.courseType, CourseTableListAdapter.OTHER_COURSE) ||
+                    TextUtils.equals(data.courseType, CourseTableListAdapter.VIP_COURSE)
+                ) {
                     //陪练课
                     ChatHelper.getInstance().goChat(data.imUserId, "")
                 } else {
@@ -165,9 +173,11 @@ class CourseTableFragment :
             ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
                 .withString("course_id", data.courseId)
                 .navigation()
-        } else if(TextUtils.equals(
+        } else if (TextUtils.equals(
                 CourseTableListAdapter.VIP_COURSE,
-                data?.courseType)){
+                data?.courseType
+            )
+        ) {
             //VIP课
             ARouter.getInstance()
                 .build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
@@ -178,7 +188,7 @@ class CourseTableFragment :
                 )
                 .withString(CourseConstants.STUDENT_ID, data.userId)
                 .navigation()
-        }else {
+        } else {
             //直播课
             ARouter.getInstance()
                 .build(RouterPath.WebCenter.ACTIVITY_HTML)

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/work/HomeWorkFragment.java

@@ -121,7 +121,7 @@ public class HomeWorkFragment extends BaseMVPFragment<FragmentHomeworkBinding, H
                 HomeworkListBean.RowsBean rowsBean = homeworkAdapter.getData().get(position);
                 if (TextUtils.equals(rowsBean.type, CourseConstants.OTHER_COURSE)
                         || TextUtils.equals(rowsBean.type, CourseConstants.VIP_COURSE)) {
-                    //陪练
+                    //VIP课或者趣纠
                     ChatHelper.getInstance().goChat(rowsBean.imUserId, rowsBean.studentName);
                 } else {
                     //琴房课或者直播课