package com.sixin.module_p.ui.gnc.shouyun.list

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants
import com.sixin.module_p.R
import com.sixin.module_p.base.BasePdaActivity
import com.sixin.module_p.databinding.ActivityPdaGncShouyunListBinding

@Route(path = ARouterConstants.ACTIVITY_URL_GOUT_COLLECTION_RECORD_ACTIVITY)
class PdaGncShouYunActivity :
    BasePdaActivity<ActivityPdaGncShouyunListBinding, GncShouYunViewModel>() {

    override fun layoutId(): Int {
        return R.layout.activity_pda_gnc_shouyun_list
    }

    override fun viewModelClass(): Class<GncShouYunViewModel> {
        return GncShouYunViewModel::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, PdaGncShouYunActivity::class.java)
            context.startActivity(starter)
        }
    }
}