package com.lukouguoji.gjc.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.google.gson.Gson
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityIntExpOutHandoverDetailBinding
import com.lukouguoji.gjc.viewModel.IntExpOutHandoverDetailViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjcUldUseBean
import com.lukouguoji.module_base.common.Constant

/**
 * 国际出港-出库交接「板箱详情」（手机版专属页面）
 *
 * 由手机版列表卡片的「查看详情」进入；平板端列表布局不含该入口，故不会走到本页。
 */
class IntExpOutHandoverDetailActivity :
    BaseBindingActivity<ActivityIntExpOutHandoverDetailBinding, IntExpOutHandoverDetailViewModel>() {

    override fun layoutId() = R.layout.activity_int_exp_out_handover_detail
    override fun viewModelClass() = IntExpOutHandoverDetailViewModel::class.java

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("板箱详情")
        binding.viewModel = viewModel
        viewModel.initOnCreated(intent)
    }

    companion object {
        @JvmStatic
        fun start(context: Context, bean: GjcUldUseBean) {
            context.startActivity(
                Intent(context, IntExpOutHandoverDetailActivity::class.java)
                    .putExtra(Constant.Key.DATA, Gson().toJson(bean))
            )
        }
    }
}
