package com.lukouguoji.gjc.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingDetailsBinding
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants

/**
 * 国际出港板箱过磅详情页
 */
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS)
class GjcBoxWeighingDetailsActivity :
    BaseBindingActivity<ActivityGjcBoxWeighingDetailsBinding, GjcBoxWeighingDetailsViewModel>() {

    override fun layoutId() = R.layout.activity_gjc_box_weighing_details

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国际出港板箱过磅详情")

        binding.viewModel = viewModel

        // 初始化数据（从Intent获取参数）
        viewModel.initOnCreated(intent)
    }

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