package com.lukouguoji.gnc.page.deposit.list

import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.DialogGncDepositBinding
import com.lukouguoji.gnc.databinding.DialogGncDistributionDriverBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import dev.utils.app.info.KeyValue

class GncDepositDialogModel(
    val carList: String,
    val areaList: List<KeyValue>,
    val callBack: (GncDepositDialogModel) -> Unit
) : BaseDialogModel<DialogGncDepositBinding>(DIALOG_TYPE_CENTER) {

    // 区域
    val area = MutableLiveData("")

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

    override fun onDialogCreated(context: Context) {
        binding.model = this
    }

    fun onConfirmClick() {
        if (area.value.verifyNullOrEmpty("请选择区域")) {
            return
        }
        dismiss()
        callBack(this)
    }

}