package com.sixin.module_p.ui.gnj.xieji.details

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.fastjson.JSON
import com.lukouguoji.module_base.bean.GnjUnloadListBean
import com.sixin.module_p.R
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.sixin.module_p.base.BasePdaActivity
import com.sixin.module_p.databinding.ActivityPdaXieJiDetailsBinding

class PdaGnjXieJiDetailsActivity :
    BasePdaActivity<ActivityPdaXieJiDetailsBinding, PdaGnjXieJiDetailsViewModel>() {

    override fun layoutId(): Int {
        return R.layout.activity_pda_xie_ji_details
    }

    override fun viewModelClass(): Class<PdaGnjXieJiDetailsViewModel> {
        return PdaGnjXieJiDetailsViewModel::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, PdaGnjXieJiDetailsActivity::class.java)
                .putExtra(Constant.Key.DATA, JSON.toJSONString(data))
            context.startActivity(starter)
        }
    }

}