查看: 1488|回复: 2

手机端信息中心通知公告能否加一个“读过”功能

升级   0.1%

96

主题

88

回帖

10

积分

注册会员

Rank: 2

积分
10
发表于 2024-6-12 09:39:43 | 显示全部楼层 |阅读模式
用户打开一条通知再回到主页面后刚才的通知标题前加一个“读过”标记,这样通知多的时候就可以记得哪条读过哪条没读过。
回复

使用道具 举报

升级   100%

139

主题

1万

回帖

4万

积分

超级版主

Rank: 8Rank: 8

积分
41458
发表于 2024-6-13 10:34:47 | 显示全部楼层
平台自带的app是没这个功能的,您可以自己去做,在listDocument的接口里会返回一个hasRead字段,记录是否有看过
回复

使用道具 举报

升级   0.1%

96

主题

88

回帖

10

积分

注册会员

Rank: 2

积分
10
发表于 2024-6-22 14:28:57 | 显示全部楼层
感谢,已经实现了。本以为挺复杂,其实有现成的字段。
在安卓端源码CMSApiJson.kt下的CMSDocumentInfoJson类里加一个名叫hasRead的布尔变量,再改一下copyToTodoListItem方法的输出字符串就解决了。
参考代码,做的比较简单没用图片标记已读未读:
/**
* 文章对象
*/
data class CMSDocumentInfoJson(var id: String = "",
                               var createTime: String = "",
                               var updateTime: String = "",
                               var sequence: String = "",
                               var title: String = "",
                               var appId: String = "",
                               var categoryId: String = "",
                               var categoryName: String = "",
                               var categoryAlias: String = "",
                               var form: String = "",
                               var formName: String = "",
                               var creatorPerson: String = "",
                               var creatorIdentity: String = "",
                               var creatorDepartment: String = "",
                               var creatorCompany: String = "",
                               var docStatus: String = "",
                               var publishTime: String = "",
                               var isNewDocument: Boolean = false,
                               var attachmentList: List<String> = ArrayList(),
                               var hasRead: Boolean = false
) {
    /**
     *
     */
    fun copyToTodoListItem(): ToDoFragmentListViewItemVO {
        val time = if (this.publishTime.length>9) {this.publishTime.substring(0, 10)}else{ this.publishTime}
        return if(this.hasRead) {
            ToDoFragmentListViewItemVO(this.id,
                O2.BUSINESS_TYPE_MESSAGE_CENTER,
                this.title,
                "【" + this.categoryName + "】",
                time)
        } else{
            ToDoFragmentListViewItemVO(this.id,
                O2.BUSINESS_TYPE_MESSAGE_CENTER,
                "(未读)"+this.title,
                "【" + this.categoryName + "】",
                time)
        }
    }
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系客服 关注微信 下载APP 返回顶部 返回列表
viewthread