package com.lukouguoji.gjj.activity

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjGoodsAddBinding
import com.lukouguoji.gjj.viewModel.GjjGoodsAddViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener

class GjjGoodsAddActivity :
    BaseBindingActivity<ActivityGjjGoodsAddBinding, GjjGoodsAddViewModel>() {

    override fun layoutId() = R.layout.activity_gjj_goods_add

    override fun viewModelClass() = GjjGoodsAddViewModel::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, GjjGoodsAddActivity::class.java)
            context.startActivity(starter)
        }
    }

}