Parcourir la source

增加机构端消息盒子

Pq il y a 1 an
Parent
commit
cdaf903220

+ 5 - 0
institution/src/main/AndroidManifest.xml

@@ -14,5 +14,10 @@
             android:name=".ui.setting.PersonalSettingActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
             android:screenOrientation="portrait" />
+
+        <activity
+            android:name=".ui.message.MessageBoxActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            android:screenOrientation="portrait" />
     </application>
 </manifest>

+ 54 - 0
institution/src/main/java/com/cooleshow/institution/stu/adapter/MessageBoxAdapter.java

@@ -0,0 +1,54 @@
+package com.cooleshow.institution.stu.adapter;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.module.BaseLoadMoreModule;
+import com.chad.library.adapter.base.module.LoadMoreModule;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.base.utils.GlideImageLoaderUtils;
+import com.cooleshow.base.utils.TimeUtils;
+import com.cooleshow.institution.stu.R;
+import com.cooleshow.institution.stu.bean.SystemMessageBean;
+
+import androidx.annotation.NonNull;
+
+/**
+ * 创建日期:2022/5/24 13:50
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class MessageBoxAdapter extends BaseQuickAdapter<SystemMessageBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+
+    public MessageBoxAdapter() {
+        super(R.layout.jg_layout_message_nox_item);
+    }
+
+
+    @Override
+    protected void convert(BaseViewHolder helper, SystemMessageBean.RowsBean item) {
+        ImageView im_type = helper.getView(R.id.im_type);
+        TextView tv_title = helper.getView(R.id.tv_title);
+        tv_title.setText(item.title);
+        TextView tv_content = helper.getView(R.id.tv_content);
+        tv_content.setText(item.content);
+        TextView tv_date = helper.getView(R.id.tv_date);
+        tv_date.setText(TimeUtils.date2String(TimeUtils.string2Date(item.sendTime), "yyyy-MM-dd"));
+        View view_unread = helper.getView(R.id.view_unread);
+        if (item.readStatus == 0) {
+            view_unread.setVisibility(View.VISIBLE);
+        } else {
+            view_unread.setVisibility(View.GONE);
+        }
+        GlideImageLoaderUtils.getInstance().loadImage(getContext(),item.img,im_type,R.drawable.icon_message_other);
+    }
+
+    @NonNull
+    @Override
+    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
+        return new BaseLoadMoreModule(baseQuickAdapter);
+    }
+}

+ 28 - 0
institution/src/main/java/com/cooleshow/institution/stu/api/APIService.java

@@ -6,12 +6,14 @@ import com.cooleshow.institution.stu.bean.AppHomeBean;
 import com.cooleshow.institution.stu.bean.HomeAlbumListBean;
 import com.cooleshow.institution.stu.bean.HomeHotMusicSheetBean;
 import com.cooleshow.institution.stu.bean.HotAlbumBean;
+import com.cooleshow.institution.stu.bean.SystemMessageBean;
 import com.cooleshow.usercenter.bean.SetDetailBean;
 
 import io.reactivex.rxjava3.core.Observable;
 import okhttp3.RequestBody;
 import retrofit2.http.Body;
 import retrofit2.http.POST;
+import retrofit2.http.Path;
 
 import static com.cooleshow.base.common.BaseConstant.AUTH_GROUP;
 import static com.cooleshow.base.common.BaseConstant.CMS_SERVER;
@@ -70,4 +72,30 @@ public interface APIService {
      */
     @POST(STUDENT_GROUP + "userTenantAlbumRecord/detail")
     Observable<BaseResponse<HomeAlbumListBean>> getHomeAlbumList();
+
+    /**
+     * 获取所有消息列表
+     *
+     * @param body
+     * @return
+     */
+    @POST(STUDENT_GROUP + "sysMessage/list")
+    Observable<BaseResponse<SystemMessageBean>> sysMessageList(@Body RequestBody body);
+
+    /**
+     * 一键已读
+     *
+     * @return
+     */
+    @POST(STUDENT_GROUP + "sysMessage/batchSetRead")
+    Observable<BaseResponse<Object>> batchSetRead();
+
+
+    /**
+     * 设置已读
+     *
+     * @return
+     */
+    @POST(STUDENT_GROUP + "sysMessage/setRead/{id}")
+    Observable<BaseResponse<Object>> setCurrentRead(@Path("id") long id);
 }

+ 60 - 0
institution/src/main/java/com/cooleshow/institution/stu/bean/SystemMessageBean.java

@@ -0,0 +1,60 @@
+package com.cooleshow.institution.stu.bean;
+
+import java.util.List;
+
+/**
+ * 创建日期:2022/5/24 13:41
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class SystemMessageBean {
+    public int limit;
+    public int nextPage;
+    public int offset;
+    public int pageNo;
+    public int prePage;
+    public int total;
+    public int totalPage;
+    public List<RowsBean> rows;
+
+    public static class RowsBean {
+        /*
+        	"clientId": "",
+				"content": "",
+				"createOn": "",
+				"errorMsg": "",
+				"group": "",
+				"id": 0,
+				"memo": "",
+				"messageConfigId": 0,
+				"modifyOn": "",
+				"readStatus": 0,
+				"receiver": "",
+				"sendTime": "",
+				"status": "",
+				"subType": "",
+				"title": "",
+				"type": "",
+				"userId": 0
+         */
+        public String clientId;
+        public String content;
+        public String createOn;
+        public String errorMsg;
+        public String group;
+        public long id;
+        public String memo;
+        public long messageConfigId;
+        public String modifyOn;
+        public int readStatus;
+        public String receiver;
+        public String sendTime;
+        public String status;
+        public String subType;
+        public String title;
+        public String type;
+        public long userId;
+        public String img;
+    }
+}

+ 27 - 0
institution/src/main/java/com/cooleshow/institution/stu/contract/MessageBoxContract.java

@@ -0,0 +1,27 @@
+package com.cooleshow.institution.stu.contract;
+
+import com.cooleshow.base.presenter.view.BaseView;
+import com.cooleshow.institution.stu.bean.SystemMessageBean;
+
+import java.util.List;
+
+/**
+ * 创建日期:2022/5/24 11:52
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public interface MessageBoxContract {
+    interface MessageBoxView extends BaseView {
+        void sysMessageListSuccess(int page, SystemMessageBean data);
+
+        void sysMessageListError(int page);
+
+        void setCurrentReadSuccess(long id);
+
+        void batchSetReadSuccess();
+    }
+
+    interface Presenter {
+    }
+}

+ 137 - 0
institution/src/main/java/com/cooleshow/institution/stu/presenter/MessageBoxPresenter.java

@@ -0,0 +1,137 @@
+package com.cooleshow.institution.stu.presenter;
+
+import android.text.TextUtils;
+
+import com.cooleshow.base.constanst.Constants;
+import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
+import com.cooleshow.base.utils.RequestBodyUtil;
+import com.cooleshow.institution.stu.api.APIService;
+import com.cooleshow.institution.stu.bean.SystemMessageBean;
+import com.cooleshow.institution.stu.contract.MessageBoxContract;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.List;
+
+/**
+ * 创建日期:2022/5/24 11:52
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class MessageBoxPresenter extends BasePresenter<MessageBoxContract.MessageBoxView> implements MessageBoxContract.Presenter {
+
+
+    public void sysMessageList(boolean isLoading, int page, String group) {
+        if (isLoading && getView() != null) {
+            getView().showLoading();
+        }
+        JSONObject jsonObject = new JSONObject();
+        try {
+            if (!TextUtils.isEmpty(group)) {
+                jsonObject.put("group", group);
+            }
+            //消息类型;1,表示短信;2,表示邮件; 3,app推送消息
+            jsonObject.put("type", 3);
+            jsonObject.putOpt("page", page);
+            jsonObject.putOpt("rows", Constants.DEFAULT_DATA_SIZE);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        addSubscribe(create(APIService.class).sysMessageList(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString())), new BaseObserver<SystemMessageBean>(getView()) {
+            @Override
+            protected void onSuccess(SystemMessageBean data) {
+                if (getView() != null) {
+                    getView().sysMessageListSuccess(page, data);
+                }
+            }
+
+            @Override
+            public void onComplete() {
+                super.onComplete();
+                getView().hideLoading();
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().sysMessageListError(page);
+                }
+            }
+        });
+    }
+
+    public void batchSetRead() {
+        getView().showLoading();
+        addSubscribe(create(APIService.class).batchSetRead(), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().batchSetReadSuccess();
+                }
+            }
+
+            @Override
+            public void onComplete() {
+                super.onComplete();
+                getView().hideLoading();
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+
+            }
+        });
+    }
+
+    public void setCurrentRead(long id){
+        getView().showLoading();
+        addSubscribe(create(APIService.class).setCurrentRead(id), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().setCurrentReadSuccess(id);
+                }
+            }
+
+            @Override
+            public void onComplete() {
+                super.onComplete();
+                getView().hideLoading();
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+
+            }
+        });
+    }
+
+
+    public void queryCountOfUnread() {
+//        addSubscribe(create(APIService.class).queryCountOfUnread(), new BaseObserver<List<CountOfUnreadBean>>(getView()) {
+//            @Override
+//            protected void onSuccess(List<CountOfUnreadBean> data) {
+//                if (getView() != null) {
+//                    getView().queryCountOfUnreadSuccess(data);
+//                }
+//            }
+//
+//            @Override
+//            public void onComplete() {
+//                super.onComplete();
+//            }
+//
+//            @Override
+//            public void onError(Throwable e) {
+//                super.onError(e);
+//
+//            }
+//        });
+    }
+}

+ 266 - 0
institution/src/main/java/com/cooleshow/institution/stu/ui/message/MessageBoxActivity.java

@@ -0,0 +1,266 @@
+package com.cooleshow.institution.stu.ui.message;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.chad.library.adapter.base.listener.OnLoadMoreListener;
+import com.cooleshow.base.bean.RouteBean;
+import com.cooleshow.base.constanst.Constants;
+import com.cooleshow.base.constanst.RouteConstants;
+import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.ui.activity.BaseMVPActivity;
+import com.cooleshow.base.utils.GsonUtils;
+import com.cooleshow.base.utils.JumpUtils;
+import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.base.widgets.EmptyViewLayout;
+import com.cooleshow.institution.stu.R;
+import com.cooleshow.institution.stu.adapter.MessageBoxAdapter;
+import com.cooleshow.institution.stu.bean.SystemMessageBean;
+import com.cooleshow.institution.stu.contract.MessageBoxContract;
+import com.cooleshow.institution.stu.databinding.JgActivityMessageBoxBinding;
+import com.cooleshow.institution.stu.presenter.MessageBoxPresenter;
+import com.cooleshow.institution.stu.utils.JGJumpUtils;
+import com.scwang.smart.refresh.layout.api.RefreshLayout;
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
+
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+
+/**
+ * 创建日期:2022/5/24 11:14
+ *
+ * @author Ryan
+ * 类说明:
+ */
+@Route(path = RouterPath.JGCenter.MESSAGE_BOX)
+public class MessageBoxActivity extends BaseMVPActivity<JgActivityMessageBoxBinding, MessageBoxPresenter> implements MessageBoxContract.MessageBoxView, View.OnClickListener {
+    //SYSTEM:系统消息 COURSE:课程信息 NOTICE:公告
+    private String group = "";
+
+    @Override
+    public void onClick(View view) {
+        int id = view.getId();
+        if (id == com.cooleshow.base.R.id.tv_right || id == com.cooleshow.base.R.id.tv_right_text) {
+            presenter.batchSetRead();
+        }
+    }
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+    private MessageBoxAdapter messageBoxAdapter;
+
+    @Override
+    protected void initView() {
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "消息盒子");
+        viewBinding.toolbarInclude.tvRightText.setVisibility(View.VISIBLE);
+        viewBinding.toolbarInclude.tvRightText.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_999999));
+        viewBinding.toolbarInclude.tvRightText.setTextSize(11);
+        viewBinding.toolbarInclude.tvRightText.setText("全部已读");
+        viewBinding.toolbarInclude.tvRightText.setOnClickListener(this);
+        viewBinding.toolbarInclude.tvRightText.setPadding(0,0, SizeUtils.dp2px(5),0);
+        viewBinding.toolbarInclude.tvRight.setVisibility(View.VISIBLE);
+        viewBinding.toolbarInclude.tvRight.setBackgroundResource(R.drawable.jg_icon_message_box_clear);
+        viewBinding.toolbarInclude.tvRight.setOnClickListener(this);
+
+        RecyclerView rvAddress = viewBinding.recyclerView;
+        LinearLayoutManager manager = new LinearLayoutManager(this);
+        rvAddress.setLayoutManager(manager);
+        messageBoxAdapter = new MessageBoxAdapter();
+        EmptyViewLayout emptyViewLayout =new EmptyViewLayout(this);
+        emptyViewLayout.setContent(R.drawable.jg_icon_empty_content,"暂无消息");
+        messageBoxAdapter.setEmptyView(emptyViewLayout);
+        rvAddress.setAdapter(messageBoxAdapter);
+        messageBoxAdapter.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                if (null != adapter && null != adapter.getData() && adapter.getData().size() > position) {
+                    SystemMessageBean.RowsBean item = (SystemMessageBean.RowsBean) adapter.getItem(position);
+                    if (item.readStatus == 0) {
+                        presenter.setCurrentRead(item.id);
+                    }
+                    if (!TextUtils.isEmpty(item.memo)) {
+                        try {
+                            RouteBean routeBean = GsonUtils.fromJson(item.memo, RouteBean.class);
+                            if (TextUtils.equals(routeBean.pageTag, RouteConstants.PAGE_TAG_MESSAGE)) {
+                                return;
+                            }
+                            JGJumpUtils.jump(routeBean);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+        });
+    }
+
+    @Override
+    protected JgActivityMessageBoxBinding getLayoutView() {
+        return JgActivityMessageBoxBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected MessageBoxPresenter createPresenter() {
+        return new MessageBoxPresenter();
+    }
+
+    private int currentPage;
+
+    @Override
+    public void initData() {
+        super.initData();
+        viewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+                currentPage = 1;
+                queryList(true);
+            }
+        });
+        messageBoxAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore() {
+                //上拉加载
+                if (hasNext) {
+                    currentPage++;
+                    queryList(false);
+                } else {
+                    messageBoxAdapter.getLoadMoreModule().loadMoreEnd();
+                }
+            }
+        });
+        currentPage = 1;
+        queryList(true);
+    }
+
+    @Override
+    public void sysMessageListSuccess(int page, SystemMessageBean data) {
+        if (data != null) {
+            if (page == 1) {
+                messageBoxAdapter.getData().clear();
+                messageBoxAdapter.notifyDataSetChanged();
+                viewBinding.refreshLayout.finishRefresh();
+                if (data.rows != null && data.rows.size() > 0) {
+                    checkHasNext(data.rows.size());
+                    messageBoxAdapter.setNewInstance(data.rows);
+                } else {
+                    messageBoxAdapter.notifyDataSetChanged();
+                }
+            } else {
+                if (data.rows != null && data.rows.size() > 0) {
+                    messageBoxAdapter.addData(data.rows);
+                    messageBoxAdapter.getLoadMoreModule().loadMoreComplete();
+                    checkHasNext(data.rows.size());
+                } else {
+                    messageBoxAdapter.getLoadMoreModule().loadMoreEnd();
+                }
+            }
+        }
+    }
+
+    private boolean hasNext = true;
+
+    /**
+     * 检查是否还有下一页
+     *
+     * @param dataSize
+     */
+    private void checkHasNext(int dataSize) {
+        hasNext = dataSize >= Constants.DEFAULT_DATA_SIZE;
+    }
+
+    private void queryList(boolean isLoading) {
+        presenter.sysMessageList(isLoading, currentPage, group);
+    }
+
+
+    @Override
+    public void sysMessageListError(int page) {
+        if (page == 1) {
+            viewBinding.refreshLayout.finishRefresh();
+        } else {
+            if (messageBoxAdapter != null) {
+                currentPage--;
+                messageBoxAdapter.getLoadMoreModule().loadMoreFail();
+            }
+        }
+    }
+
+    @Override
+    public void setCurrentReadSuccess(long id) {
+        for (SystemMessageBean.RowsBean rowsBean : messageBoxAdapter.getData()) {
+            if (rowsBean.id == id) {
+                rowsBean.readStatus = 1;
+                break;
+            }
+        }
+        presenter.queryCountOfUnread();
+        messageBoxAdapter.notifyDataSetChanged();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        presenter.queryCountOfUnread();
+    }
+
+//    @Override
+//    public void queryCountOfUnreadSuccess(List<CountOfUnreadBean> data) {
+//        if (null == data || data.size() == 0) {
+//            viewBinding.tvAllUnread.setVisibility(View.GONE);
+//            viewBinding.tvCourseUnread.setVisibility(View.GONE);
+//            viewBinding.tvSystemUnread.setVisibility(View.GONE);
+//            return;
+//        }
+//        int totalCount = 0;
+//        int courseCount = 0;
+//        int systemCount = 0;
+//        for (CountOfUnreadBean datum : data) {
+//            if (datum.key.equals("COURSE")) {
+//                courseCount = datum.value;
+//            } else if (datum.key.equals("SYSTEM")) {
+//                systemCount = datum.value;
+//            }
+//        }
+//        totalCount = courseCount + systemCount;
+//        if (totalCount > 0) {
+//            viewBinding.tvAllUnread.setVisibility(View.VISIBLE);
+//            viewBinding.tvAllUnread.setText(totalCount + "");
+//        } else {
+//            viewBinding.tvAllUnread.setVisibility(View.GONE);
+//        }
+//        if (courseCount > 0) {
+//            viewBinding.tvCourseUnread.setVisibility(View.VISIBLE);
+//            viewBinding.tvCourseUnread.setText(courseCount + "");
+//        } else {
+//            viewBinding.tvCourseUnread.setVisibility(View.GONE);
+//        }
+//        if (systemCount > 0) {
+//            viewBinding.tvSystemUnread.setVisibility(View.VISIBLE);
+//            viewBinding.tvSystemUnread.setText(systemCount + "");
+//        } else {
+//            viewBinding.tvSystemUnread.setVisibility(View.GONE);
+//        }
+//    }
+
+    @Override
+    public void batchSetReadSuccess() {
+        presenter.queryCountOfUnread();
+        currentPage = 1;
+        queryList(false);
+    }
+}

BIN
institution/src/main/res/drawable-xhdpi/icon_message_other.png


BIN
institution/src/main/res/drawable-xhdpi/jg_icon_message_box_clear.png


BIN
institution/src/main/res/drawable-xxhdpi/icon_message_other.png


BIN
institution/src/main/res/drawable-xxhdpi/jg_icon_message_box_clear.png


+ 5 - 0
institution/src/main/res/drawable/bg_red_ovil.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="@color/color_ff1313" />
+</shape>

+ 27 - 0
institution/src/main/res/layout/jg_activity_message_box.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tool="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:orientation="vertical">
+
+
+    <include
+        android:id="@+id/toolbar_include"
+        layout="@layout/common_toolbar_layout" />
+
+    <com.scwang.smart.refresh.layout.SmartRefreshLayout
+        android:id="@+id/refreshLayout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:overScrollMode="never"
+            android:scrollbars="none" />
+    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+</LinearLayout>

+ 66 - 0
institution/src/main/res/layout/jg_layout_message_nox_item.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tool="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:paddingTop="15dp"
+    android:layout_height="wrap_content">
+
+
+    <ImageView
+        android:id="@+id/im_type"
+        android:layout_width="@dimen/dp_42"
+        android:layout_height="@dimen/dp_42"
+        android:layout_marginLeft="15dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="12dp"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_16"
+        app:layout_constraintLeft_toRightOf="@+id/im_type"
+        app:layout_constraintTop_toTopOf="@+id/im_type"
+        tool:text="陪练课购买" />
+
+    <View
+        android:id="@+id/view_unread"
+        android:layout_width="@dimen/dp_6"
+        android:layout_height="@dimen/dp_6"
+        android:visibility="gone"
+        android:background="@drawable/bg_red_ovil"
+        app:layout_constraintLeft_toRightOf="@+id/tv_title"
+        app:layout_constraintTop_toTopOf="@+id/im_type" />
+
+
+    <TextView
+        android:id="@+id/tv_content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="69dp"
+        android:layout_marginTop="3dp"
+        android:layout_marginRight="17dp"
+        android:ellipsize="end"
+        android:maxLines="5"
+        android:textColor="@color/color_7a7a7a"
+        android:textSize="@dimen/sp_13"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title"
+        tool:text="李乐李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课李乐乐已预约12节陪练课乐已预约12节陪练课,请查看课表,为学员课程做好准备吧!" />
+
+
+    <TextView
+        android:id="@+id/tv_date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="17dp"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_11"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        tool:text="刚刚" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>