package com.lukouguoji.aerologic.page.gnj.unload.detail

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.fastjson.JSON
import com.lukouguoji.aerologic.databinding.ActivityGnjUnloadDetailsBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GnjUnloadListBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner

class GnjUnloadDetailsActivity :
    BaseBindingActivity<ActivityGnjUnloadDetailsBinding, GnjUnloadDetailsViewModel>() {

    override fun layoutId() = com.lukouguoji.aerologic.R.layout.activity_gnj_unload_details

    override fun viewModelClass() = GnjUnloadDetailsViewModel::class.java

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内进港卸机详情")

        binding.viewModel = viewModel
        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )
        viewModel.initOnCreated(intent)
    }

    companion object {
        @JvmStatic
        fun start(context: Context, data: GnjUnloadListBean) {
            val starter = Intent(context, GnjUnloadDetailsActivity::class.java)
                .putExtra(Constant.Key.DATA, JSON.toJSONString(data))
            context.startActivity(starter)
        }
    }

}