package com.lukouguoji.gnc.page.query.list

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityGncQueryListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants

@Route(path = ARouterConstants.ACTIVITY_URL_GNC_QUERY_LIST)
class GncQueryListActivity :
    BaseBindingActivity<ActivityGncQueryListBinding, GncQueryListViewModel>() {
    override fun layoutId() = R.layout.activity_gnc_query_list

    override fun viewModelClass() = GncQueryListViewModel::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()
    }
}