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.google.gson.Gson
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcQueryEditBinding
import com.lukouguoji.gjc.viewModel.GjcQueryEditViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjcMaWb
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants

/**
 * 国际出港运单修改页
 */
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_EDIT)
class GjcQueryEditActivity :
    BaseBindingActivity<ActivityGjcQueryEditBinding, GjcQueryEditViewModel>() {

    override fun layoutId() = R.layout.activity_gjc_query_edit

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国际出港运单修改")
        binding.viewModel = viewModel

        // 初始化数据
        viewModel.initOnCreated(intent)
    }

    companion object {
        @JvmStatic
        fun start(context: Context, bean: GjcMaWb) {
            val starter = Intent(context, GjcQueryEditActivity::class.java)
                .putExtra(Constant.Key.DATA, Gson().toJson(bean))
            context.startActivity(starter)
        }
    }
}
