Browse Source

修改推送跳转

Pq 3 months ago
parent
commit
34fbd43836

+ 5 - 4
BaseLibrary/src/main/java/com/cooleshow/base/utils/JumpUtils.java

@@ -84,7 +84,8 @@ public class JumpUtils {
                     if (TextUtils.equals(routeBean.pageTag, RouteConstants.PAGE_TAG_EVALUATE)) {
                         //跳转评价页面
                         if (BaseApplication.Companion.isTeacherClient()) {
-                            ARouter.getInstance().build(RouterPath.CommentCenter.TEACHER_RECEIVED_COMMENT)
+                            ARouter.getInstance().build(RouterPath.CommentCenter.TEACHER_COURSE_COMMENT)
+                                    .withInt(Constants.SELECT_POSITION, 1)
                                     .navigation();
                             return true;
                         } else {
@@ -184,7 +185,7 @@ public class JumpUtils {
                         return true;
                     }
 
-                    if(TextUtils.equals(routeBean.pageTag,RouteConstants.PAGE_TAG_GROUP_COURSE_GROUP)){
+                    if (TextUtils.equals(routeBean.pageTag, RouteConstants.PAGE_TAG_GROUP_COURSE_GROUP)) {
                         //我的课程->小组课
                         ARouter.getInstance().build(RouterPath.CourseCenter.TEACHER_MINE_COURSE)
                                 .withInt(Constants.SELECT_POSITION, 2)
@@ -192,8 +193,8 @@ public class JumpUtils {
                         return true;
                     }
 
-                    if(TextUtils.equals(routeBean.pageTag,RouteConstants.PAGE_TAG_GROUP_COURSE_CANCEL)){
-                        if(BaseApplication.Companion.isTeacherClient()){
+                    if (TextUtils.equals(routeBean.pageTag, RouteConstants.PAGE_TAG_GROUP_COURSE_CANCEL)) {
+                        if (BaseApplication.Companion.isTeacherClient()) {
                             //我的小组课-已取消
                             ARouter.getInstance().build(RouterPath.CourseCenter.TEACHER_MINE_GROUP_COURSE)
                                     .withInt(Constants.SELECT_POSITION, 4)

+ 10 - 7
teacher/src/main/java/com/cooleshow/teacher/ui/comment/CourseCommentActivity.java

@@ -8,6 +8,7 @@ import android.widget.TextView;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
 import com.alibaba.android.arouter.launcher.ARouter;
+import com.cooleshow.base.constanst.Constants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseActivity;
 import com.cooleshow.base.utils.Utils;
@@ -47,8 +48,17 @@ public class CourseCommentActivity extends BaseActivity<ActivityCourseCommentLay
     @Override
     protected void initData() {
         super.initData();
+        int selectPosition = getIntent().getIntExtra(Constants.SELECT_POSITION, -1);
         initListener();
         initTabLayoutAndViewPager();
+        if (selectPosition != -1 && selectPosition < mFragments.size()) {
+            viewBinding.viewpager.post(new Runnable() {
+                @Override
+                public void run() {
+                    viewBinding.viewpager.setCurrentItem(selectPosition);
+                }
+            });
+        }
     }
 
 
@@ -92,13 +102,6 @@ public class CourseCommentActivity extends BaseActivity<ActivityCourseCommentLay
     @Override
     public void onClick(View v) {
         int id = v.getId();
-        if (id == com.cooleshow.base.R.id.tv_right_text) {
-            //收到评价
-            ARouter.getInstance().build(RouterPath.CommentCenter.TEACHER_RECEIVED_COMMENT)
-                    .navigation();
-            return;
-        }
-
         if (id == R.id.iv_back) {
             finish();
             return;

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/comment/ReceivedCommentActivity.java

@@ -37,6 +37,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 /**
  * Author by pq, Date on 2022/5/5.
  */
+@Deprecated
 @Route(path = RouterPath.CommentCenter.TEACHER_RECEIVED_COMMENT)
 public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCommentLayoutBinding, ReceivedCommentPresenter> implements ReceivedCommentContract.ReceivedCommentView, View.OnClickListener {
     private TimePickerView pvTime;

+ 1 - 0
teacher/src/main/res/layout/activity_received_comment_layout.xml

@@ -82,6 +82,7 @@
 
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
         android:id="@+id/refreshLayout"
+        android:layout_marginTop="12dp"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         app:layout_constraintBottom_toBottomOf="parent"