package com.lukouguoji.aerologic.page.gnj.query.details

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGnjQueryDetailsBinding
import com.lukouguoji.aerologic.databinding.ActivityGnjStashDetailsBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.refresh

class GnjQueryDetailsActivity :
    BaseBindingActivity<ActivityGnjQueryDetailsBinding, GnjQueryDetailsViewModel>() {

    override fun layoutId() = R.layout.activity_gnj_query_details

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内进港运单详情")
        binding.viewModel = viewModel

        viewModel.initOnCreated(intent)

        viewModel.list.observe(this) {
            binding.rv.refresh(it)
        }
    }

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

}