package com.lukouguoji.gjc.page.move

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.ActivityIntExpMoveDetailBinding
import com.lukouguoji.gjc.viewModel.IntExpMoveDetailViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjcMove
import com.lukouguoji.module_base.common.Constant

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

    override fun layoutId() = R.layout.activity_int_exp_move_detail
    override fun viewModelClass() = IntExpMoveDetailViewModel::class.java

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

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