package com.lukouguoji.gjc.activity

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcGoodsAddBinding
import com.lukouguoji.gjc.viewModel.GjcGoodsAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener

class GjcGoodsAddActivity :
    BaseBindingActivity<ActivityGjcGoodsAddBinding, GjcGoodsAddViewModel>() {

    override fun layoutId() = R.layout.activity_gjc_goods_add

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国际出港货物开始交接")
        binding.viewModel = viewModel

        viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
        binding.rv.addOnItemClickListener(viewModel)

        viewModel.getData()
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, GjcGoodsAddActivity::class.java)
            context.startActivity(starter)
        }
    }
}