package com.lukouguoji.gnc.page.query.details

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityGncQueryDetailsBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.refresh

class GncQueryDetailsActivity :
    BaseBindingActivity<ActivityGncQueryDetailsBinding, GncQueryDetailsViewModel>() {

    override fun layoutId() = R.layout.activity_gnc_query_details

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内出港运单详情")

        viewModel.initOnCreated(intent)

        binding.viewModel = viewModel

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

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

}