package com.lukouguoji.gnc.page.shouyun.list

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityDistributionHandoverBinding
import com.lukouguoji.gnc.databinding.ActivityShouyunListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner

class GncShouYunListActivity :
    BaseBindingActivity<ActivityShouyunListBinding, GncShouYunListViewModel>() {

    override fun layoutId() = R.layout.activity_shouyun_list

    override fun viewModelClass(): Class<GncShouYunListViewModel> {
        return GncShouYunListViewModel::class.java
    }

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内出港收运记录")
        binding.viewModel = viewModel

        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )

        binding.rv.addOnItemClickListener(viewModel)

        viewModel.refresh()
    }

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

}