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.ActivityGjcWeighingStartBinding
import com.lukouguoji.gjc.viewModel.GjcWeighingStartViewModel
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_WEIGHING_START)
class GjcWeighingStartActivity :
    BaseBindingActivity<ActivityGjcWeighingStartBinding, GjcWeighingStartViewModel>() {

    override fun layoutId() = R.layout.activity_gjc_weighing_start

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("开始计重")
        binding.viewModel = viewModel
        viewModel.initOnCreated(this, intent)
    }

    companion object {
        /**
         * 启动开始计重页面
         * @param context 上下文
         * @param maWbId 运单ID，默认为0（新增模式）
         */
        @JvmStatic
        fun startForAdd(context: Context, maWbId: Long = 0) {
            val starter = Intent(context, GjcWeighingStartActivity::class.java)
                .putExtra(Constant.Key.MAWB_ID, maWbId)
            context.startActivity(starter)
        }
    }
}
