Sfoglia il codice sorgente

增加首页课程提醒 小组课跳转

Pq 7 mesi fa
parent
commit
9a4e0f88fe

+ 24 - 22
student/src/main/java/com/cooleshow/student/ui/main/NewHomeFragmentV2.java

@@ -15,6 +15,7 @@ import com.chad.library.adapter.base.listener.OnItemClickListener;
 import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.constanst.Constants;
 import com.cooleshow.base.constanst.CourseStatusType;
+import com.cooleshow.base.constanst.CourseType;
 import com.cooleshow.base.constanst.EventConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
@@ -802,29 +803,30 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
      * @param bean
      */
     private void gotoCourseDetail(HomeLiveAndVideoBean.RecentCoursesBean bean) {
-        switch (bean.courseType) {
-            case LIVE_COURSE:
-                ARouter.getInstance()
-                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                        .withString(WebConstants.WEB_URL, String.format(WebConstants.TEACHER_LIVE_DETAIL_NORMAL_COURSE, bean.courseGroupId, bean.courseId))
-                        .navigation();
-                break;
-            case OTHER_COURSE:
-            case VIP_COURSE:
-                //趣纠课 VIP课
-                ARouter.getInstance().build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
-                        .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
-                        .withString(CourseConstants.COURSE_GROUP_ID, String.valueOf(bean.courseGroupId))
-                        .navigation();
-                break;
-            case PIANO_ROOM_COURSE:
-                //琴房课 跳转详情页
-                ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
-                        .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
-                        .navigation();
-                break;
+        String courseType = bean.courseType;
+        if (TextUtils.equals(courseType,CourseType.LIVE.getId())) {
+            //直播课
+            ARouter.getInstance()
+                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                    .withString(WebConstants.WEB_URL, String.format(WebConstants.TEACHER_LIVE_DETAIL_NORMAL_COURSE, bean.courseGroupId, bean.courseId))
+                    .navigation();
+        } else if (TextUtils.equals(courseType,CourseType.PRACTICE.getId())|| TextUtils.equals(courseType,CourseType.VIP.getId())) {
+            //趣纠课 VIP课
+            ARouter.getInstance().build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .withString(CourseConstants.COURSE_GROUP_ID, String.valueOf(bean.courseGroupId))
+                    .navigation();
+        } else if (TextUtils.equals(courseType,CourseType.PIANO_ROOM_CLASS.getId())) {
+            //琴房课 跳转详情页
+            ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .navigation();
+        }else if(TextUtils.equals(courseType,CourseType.GROUP.getId())){
+            //小组课
+            ARouter.getInstance().build(RouterPath.CourseCenter.GROUP_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .navigation();
         }
-
     }
 
 

+ 14 - 5
teacher/src/main/java/com/cooleshow/teacher/ui/main/NewHomeFragmentV2.java

@@ -11,6 +11,7 @@ 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.CourseStatusType;
+import com.cooleshow.base.constanst.CourseType;
 import com.cooleshow.base.constanst.EVipType;
 import com.cooleshow.base.constanst.EventConstants;
 import com.cooleshow.base.event.RefreshUserStatusEvent;
@@ -313,7 +314,7 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
             boolean isIng = TextUtils.equals(mRecentCourses.status, CourseStatusType.ING.getId());
             mViewBinding.tvEnterRoom.setText(getString(isIng ? R.string.enter_room_tip_str : R.string.will_start_tip_str));
             mViewBinding.tvEnterRoom.setTextColor(getContext().getResources().getColor(isIng ? R.color.white : com.cooleshow.base.R.color.color_2dc7aa));
-            mViewBinding.tvEnterRoom.setBackgroundResource(isIng ? com.cooleshow.base.R.drawable.shape_2dc7aa_13dp: com.cooleshow.base.R.drawable.shape_13dp_border_2dc7aa_1dp);
+            mViewBinding.tvEnterRoom.setBackgroundResource(isIng ? com.cooleshow.base.R.drawable.shape_2dc7aa_13dp : com.cooleshow.base.R.drawable.shape_13dp_border_2dc7aa_1dp);
             mViewBinding.tvLiveTitle.setText(mRecentCourses.courseGroupName);
             String currentTime = TimeUtils.date2String(new Date(System.currentTimeMillis()), "yyyy-MM-dd");
             String startTime = TimeUtils.date2String(
@@ -345,7 +346,7 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
             return;
         }
 
-        if (TextUtils.equals(bean.courseType, CourseConstants.LIVE_COURSE)) {
+        if (TextUtils.equals(bean.courseType, CourseType.LIVE.getId())) {
             ARouter.getInstance()
                     .build(RouterPath.WebCenter.ACTIVITY_HTML)
                     .withString(
@@ -359,8 +360,8 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
                     .navigation();
             return;
         }
-        if (TextUtils.equals(bean.courseType, CourseConstants.OTHER_COURSE) ||
-                TextUtils.equals(bean.courseType, CourseConstants.VIP_COURSE)) {
+        if (TextUtils.equals(bean.courseType, CourseType.PRACTICE.getId()) ||
+                TextUtils.equals(bean.courseType, CourseType.VIP.getId())) {
             //VIP课或者趣纠课
             ARouter.getInstance().build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
                     .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
@@ -370,13 +371,21 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
             return;
         }
 
-        if (TextUtils.equals(bean.courseType, CourseConstants.PIANO_ROOM_COURSE)) {
+        if (TextUtils.equals(bean.courseType, CourseType.PIANO_ROOM_CLASS.getId())) {
             //琴房课 跳转详情页
             ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
                     .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
                     .navigation();
             return;
         }
+
+        if (TextUtils.equals(bean.courseType, CourseType.GROUP.getId())) {
+            //小组课
+            ARouter.getInstance().build(RouterPath.CourseCenter.GROUP_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .navigation();
+            return;
+        }
     }
 
     @Override