package com.zj365.mime.act

import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.UmengEventId
import com.xty.common.arouter.ARouterUrl
import com.xty.common.onEventObject
import com.zj365.mime.databinding.ActMessageDetailBinding
import com.xty.network.model.MessageBean

/**
 * 消息内容
 */
@Route(path = ARouterUrl.MESSAGE_DETAIL)
class MessageDetailAct: IBaseAct() {
    val binding by lazy{ActMessageDetailBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root
    override fun initData() {
        super.initData()
        isDarkBar=true
        var content=""
        intent.extras?.let {
            if(it.containsKey("bean")){
                var msg=it.getSerializable("bean") as MessageBean.SysMsg
                content=msg.notifyContent

            }else if(it.containsKey("content")){
                content=it.getString("content","")
            }
        }

        binding.mMsg.text=content
        onEventObject(baseContext, UmengEventId.WarningMsg, "查看预警消息详情$content")
    }

    override fun initView() {
        super.initView()
        statusBar(binding.title.mView)
        binding.title.mTvTitle.text="消息详情"
        binding.title.mIvBack.setOnClickListener { finish() }
    }
}