|
@@ -14,12 +14,14 @@ import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+import com.chad.library.adapter.base.listener.OnItemChildClickListener;
|
|
|
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.UiUtils;
|
|
|
import com.cooleshow.base.utils.helper.WebStartHelper;
|
|
|
import com.cooleshow.teacher.R;
|
|
|
import com.cooleshow.teacher.adapter.MineScoreAdapter;
|
|
@@ -96,7 +98,7 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
|
mViewBinding.llUploadScore.setOnClickListener(this);
|
|
|
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
|
|
rvAddress.setLayoutManager(manager);
|
|
|
- mineScoreAdapter = new MineScoreAdapter();
|
|
|
+ mineScoreAdapter = new MineScoreAdapter(auditStatus);
|
|
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
|
|
View emptyLayout = inflater.inflate(R.layout.layout_empty_conent, null);
|
|
|
ImageView im_empty_logo = emptyLayout.findViewById(R.id.im_empty_logo);
|
|
@@ -143,16 +145,7 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
|
mineScoreAdapter.setOnItemClickListener((adapter, view, position) -> {
|
|
|
List<MusicSheetListBean.RowsBean> data = mineScoreAdapter.getData();
|
|
|
MusicSheetListBean.RowsBean rowsBean = data.get(position);
|
|
|
- if (TextUtils.equals(rowsBean.auditStatus, MineScoreActivity.TYPE_UNPASS)||TextUtils.equals(rowsBean.auditStatus, MineScoreActivity.TYPE_OUT_SALE)) {
|
|
|
- ARouter.getInstance().build(RouterPath.WebCenter.ACTIVITY_HTML)
|
|
|
- .withString(WebConstants.WEB_URL, String.format(WebConstants.EDIT_SCORE_PAGE, rowsBean.id))
|
|
|
- .navigation();
|
|
|
- return;
|
|
|
- }
|
|
|
- if (TextUtils.equals(rowsBean.auditStatus, MineScoreActivity.TYPE_OUT_SALE)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (TextUtils.equals(rowsBean.auditStatus, MineScoreActivity.TYPE_UNPASS)) {
|
|
|
+ if (TextUtils.equals(auditStatus, MineScoreActivity.TYPE_UNPASS) || TextUtils.equals(auditStatus, MineScoreActivity.TYPE_OUT_SALE)) {
|
|
|
ARouter.getInstance().build(RouterPath.WebCenter.ACTIVITY_HTML)
|
|
|
.withString(WebConstants.WEB_URL, String.format(WebConstants.EDIT_SCORE_PAGE, rowsBean.id))
|
|
|
.navigation();
|
|
@@ -167,6 +160,22 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
|
.navigation();
|
|
|
});
|
|
|
|
|
|
+ mineScoreAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
|
+ if (view.getId() == R.id.tv_take_down) {
|
|
|
+ if (UiUtils.isFastClick()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //下架
|
|
|
+ if (position < mineScoreAdapter.getData().size()) {
|
|
|
+ MusicSheetListBean.RowsBean rowsBean = mineScoreAdapter.getData().get(position);
|
|
|
+ presenter.takeDownMusicSheet(rowsBean.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private int currentPage;
|
|
@@ -261,4 +270,13 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void takeDownMusicSheetSuccess() {
|
|
|
+ if (isDetached()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ currentPage = 1;
|
|
|
+ queryScore(true);
|
|
|
+ }
|
|
|
}
|