package com.lukouguoji.gjj.activity

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjManifestDetailsBinding
import com.lukouguoji.gjj.viewModel.GjjManifestDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.noNull

class GjjManifestDetailsActivity :
    BaseBindingActivity<ActivityGjjManifestDetailsBinding, GjjManifestDetailsViewModel>() {

    override fun layoutId() = R.layout.activity_gjj_manifest_details

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国际进港舱单详情")
        viewModel.id = intent.getStringExtra(Constant.Key.ID).noNull()

        binding.viewModel = viewModel

        viewModel.getData()
    }

    companion object {
        @JvmStatic
        fun start(context: Context, id: String) {
            val starter = Intent(context, GjjManifestDetailsActivity::class.java)
                .putExtra(Constant.Key.ID, id)
            context.startActivity(starter)
        }
    }
}