package com.lukouguoji.gnc.page.fubang.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.ActivityGncFubangListBinding
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 GncFuBangListActivity :
    BaseBindingActivity<ActivityGncFubangListBinding, GncFuBangListViewModel>() {

    override fun layoutId() = R.layout.activity_gnc_fubang_list

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内出港复磅")
        binding.viewModel = viewModel

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

        binding.rv.addOnItemClickListener(viewModel)

    }

    override fun onResume() {
        super.onResume()
        viewModel.refresh()
    }

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

}