package com.hongyegroup.cpt_ewallet.ui

import android.os.Bundle
import com.guadou.cs_cptservices.base.activity.YYBaseVDBActivity
import com.guadou.lib_baselib.bean.DataBindingConfig
import com.guadou.lib_baselib.engine.toast
import com.guadou.lib_baselib.ext.commContext
import com.guadou.lib_baselib.ext.gotoActivity
import com.guadou.lib_baselib.utils.KeyboardUtils
import com.hongyegroup.cpt_ewallet.BR
import com.hongyegroup.cpt_ewallet.R
import com.hongyegroup.cpt_ewallet.databinding.ActivityAppointmentEnquiryBinding
import com.hongyegroup.cpt_ewallet.mvvm.AppointmentEnquiryViewModel

/**
 * 提现预约的反馈页面
 */
class AppointmentEnquiryActivity : YYBaseVDBActivity<AppointmentEnquiryViewModel, ActivityAppointmentEnquiryBinding>() {

    companion object {
        fun startInstance() {
            commContext().gotoActivity<AppointmentEnquiryActivity>()
        }
    }

    override fun getDataBindingConfig(): DataBindingConfig {
        return DataBindingConfig(R.layout.activity_appointment_enquiry, BR.viewModel, mViewModel)
            .addBindingParams(BR.click, ClickProxy())
    }

    override fun init(savedInstanceState: Bundle?) {

    }

    override fun startObserve() {

    }

    /**
     * DataBinding事件处理
     */
    inner class ClickProxy {

        fun submitEnquiry() {
            KeyboardUtils.hideSoftInput(mActivity)

            toast("提交反馈查询:" + mViewModel.mEnquiryMsg.value)

            AppointmentEnquiryDetailActivity.startInstance()
        }

    }
}